MySQL - The Basics // Learn SQL in 23 Easy Steps
HTML-код
- Опубликовано: 9 июн 2024
- JOIN me for a full beginner’s tutorial on MySQL. Learn the basics of relational databases by recreating AirBnb’s database with raw SQL fireship.io/tags/sql/
Buy the MySQL Pillow fireshipio-swag.creator-sprin...
References
Diagram drawsql.app/fireship/diagrams...
Installer dev.mysql.com/downloads/insta...
MySQL Docs dev.mysql.com/doc/
#mysql #database #tutorial
00:00 0. SQL is King
00:49 1. The Legend of Ted Codd
01:24 2. ORM Magic
02:00 3. What is a RDBMS?
02:37 4. Draw SQL Diagrams
02:56 5. Schemas, Datatypes, & Constraints
04:12 6. Be Normalized
05:00 7. Install MySQL on Windows/Mac
05:50 8. Create a New Database
06:13 9. SQLTools VS Code Extension
06:46 10. --comments
07:02 11. Basic SQL Syntax
08:04 12. Primary Key
08:31 13. Varchar vs Text
09:31 14. INSERT New Data
10:28 15. Read or SELECT Data
10:57 16. LIMIT & ORDER
11:23 17. Filtering with WHERE
11:50 18. LIKE pattern matching
12:19 19. INDEX for read speed
12:56 20. JOIN a relationship
15:41 21. Alias AS
16:08 22. JOIN through a middle man
16:58 23. DROP a video
Install the quiz app 🤓
iOS itunes.apple.com/us/app/fires...
Android play.google.com/store/apps/de...
Upgrade to Fireship PRO at fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
My VS Code Theme
- Atom One Dark
- vscode-icons
- Fira Code Font - Наука
I literally spent $4,000 and four months on my college course for database management to learn what you just taught extremely well in 17 minutes.
yeah its sad isnt it..
Spending 4k on learning one single subject is nuts bro
Seriously, or just exaggerating?
@@nikhilbajaj3797 yeah, but that’s what it costs per class at my university in the US (if you include the cost of room and board and fees and whatnot). I should have gone to a cheaper university, but my parents and older siblings expectations pushed me here. I had a great experience, but if I could go back and make a different decision I absolutely would
@@legionsra I appreciate the kind words, and you’re absolutely right I won’t be pressuring my kids into the same situation I got pushed into. That book sounds extremely interesting, I’ll be looking into it 😁
Two MySQL DBAs walk to a NoSQL bar, but they had to leave because they couldn't find any tables! :)
Two tables sitting in a bar
then a select statement came and said can i join u??
They also had to leave because they couldn't get in, the bar clearly has an agenda against SQLs
Why mysql walk into a bar that doesn't like relations...
@@alvinxyz7419 HAHAHAHAHAHAHAHAHHA
nice pun
I been using MySQL for over 14 years now, yet i still watched a 17 minute video on 'The Basics'.... Totally worth it!
Cool, same here. Since ~2002 😀
Have you ever written pages long SQL queries? If so, what were the use cases? I really wonder :)
@@keremardicli4013 Speed, in MSSQL for example procedures and triggers tend to be a lot faster then using a shit language like php. since everything is done within sql. All those shitty queries you tend to make with an ORM and some linked list garbage speed up tons.
For example recently I had to generate questions for something based on the database that was being used. Alas I did it in MSSQL with procedures and triggers to build the whole procedure.
Cool. I have a question if you don't mind i just started SQL out of curiosity. I understood how to make a database. My question is how do i make it user friendly i mean what if some one has to enter a data into my database but they shouldn't use insert statement. Something like a data entry form ? How do i make connections to database and data entry form ?
Sorry if this is a stupid question
@@Rawyu you can use HTML form along with php in your web app and sanitize your data . This way you can get user inserted data but avoid sql injection.
This semester, I'm taking "Introduction to Databases" in college. This 17 minute video taught me more about databases and SQL than my professor has done in 15 weeks (8 hours a week). So as of now, the 120 hours I've spent in class < 17 minutes of this video
College in a nutshell. Wish this was all covered in a trade school, we'd learn more in a year than getting a masters in CS.
In this case, your college is really really bad, or you are a bad student.
sad reality of most colleges
all that time spent in school is to learn that one thing u can't learn anywhere else. i was pissed
@@arno.claudeor he's memeing and doesn't realize that the only reason he was able to digest this video so easily is because he'd spent half a year working on it already
"I use arch, btw"
You had to say that, didn't you? 😂
Linux users when they couldn't tell someone that they use linux for 5minutes => 🤯😭😷😱🤒
Legit laughed out loudly when he said that
Arch users are like Harvard graduates, they'll get out of their way to let you know.
i think i know what your profile picture is.. btw
Purpose of this entire vid was to just be able to mention that 😂😂😂
I saw a great movie about databases today.
I can't wait for the SQL
Which movie??
Name?
Which movie?
@@No_Namee111 r/woooosh
@@shrin210 r/woooosh
Dang, they really didn't get the joke 🥶
2 things for anyone still trying to use this guide in 2022 for Windows. The installer does not set the PATH variable for MySQL! You have to add the bin folder to your path variables manually. Also be sure to select the legacy authentication system when installing or else the VSCode extension he recommends won't work and give you a "Client does not support authentication protocol requested by server" error.
PIN!
Yes! Thank you! I had the same problem. ChatGPT helped :D But boosting this so others might see it.
PIN THIS @Fireship
PIN THIS
Pin this
9:12 "country" should be CHAR(2) instead of VARCHAR(2)
Because country ID always has 2 characters and CHAR absolutely meant for fixed character length. Thus, long term disk usage + performance efficiency.
Didn't understand but I agree
@@toopkarcher each data type takes a different amount of bites which effect disk space on the server as the database gets filled with data.
@@davincis1 how do you find how many bites one type takes up compared to another?
@@daniellewilson8527 google is the way. Different types use different numbers of bytes to store them, and with regards to char vs varchar, if it's variable the system likely needs to set aside some extra space on the hardware to account for potential resizing etc
@@toopkarcher he means that varchar can have a number of characters upto the length you specify, which means that if you tell it to have 255 it will go upto that number while also can be less for eg 200, 15 or even 0 which is Null.
But char will always have fixed number not more not less and since no country code comprises less than two letters/chars you can tell dbms to have exactly two characters for country code. But as far as i think it won't save space and it it does it would be varchar instead.
That drop keyword joke is Awesome 😂
i love how this dude summarized a whole college course in 17 mnts !
how the education should be.
I have DBMS this sem, nice I watched it ahead 😂
You've never attended a college course have you...
@@alexismandelias I have and I must agree with this guy. For me it was 1 whole year of Database classes to see pretty much everything explained in the video except that it was in a totally different and harder manner. In the end (next semesters) you didn't even smell databases in posterior classes until the end of college if you didn't go to a "scientific research", which is pretty much a project with a teacher where you do 100% of the work and he get the credits for it.
@@alexismandelias But that's my experience here in Brazil. I don't know where you live and where you've got your degree but I sure do hope it was someplace better than most of them.
It's amazing how much knowledge he can pack in into such a short amount of time, and yet make everything crystal clear 👏
I've been through *many* SQL beginner courses. You certainly take the cake for explaining the concepts quickly and effectively.
Jeff you accidentally dropped the rest of the video using the drop keyword, please reupload it.😂😂
Thanks for watching the whole video!
My whole semester's DBMS syllabus covered in 17 min, Nice 🙄 🔥
Lmao. The feels.
really? seems pretty basic to me, and I'm about to graduate with master's degree
Me before 1hour- Should have paid more attention in my DBMS class
Me now- Should have subscribed to Fireship a few months ago.
As a former SQL dev I appreciate you making this video. Especially since ppl tend to have this weird idea about SQL that it’s an outdated complex technology when it really isn’t bad at all. Thank you 😊
It is bad
@mr.darkside35 Check out the responsibilities of a Data Architect or a Data Engineer. Must become one of the most respectable positions in IT in near future.
Because you created this awesome SQL related video I think its hightime you make a ORM(s) related tutorial like TypeORM for Typescript Nodejs or the python one. A series on them will be more awesome💪
Will do! Also plan on covering tools like Hasura.
@@Fireship Interesting, I heard about it before but never used it. Waiting for that🤞
Love that ending, legit startled me for a couple seconds 😂
Thank you! My whole Database course in my university in just 17m straight!! That's all I have to review before my interview
Despite having used SQL for many years, I still watch the whole video, because I will probably learn something I didn't know!
Thanks Jeff❤️
“I use arch btw”
@Mr. Mehi arch is famous for really difficult to install and use (which is not entirely true) so telling "I use arch" is more of a flexing. Anyway it's not that hard to use honestly and recently you can also install arch with a proper installation interface (earlier you have to do all with command line).
@@sanjay_swain jokes on you. You still have to do it command-line way because there's no GUI yet. Before it used to be copy-pasta from wiki now it's more over like selecting from the given option.
I use mujiOS, btw
Glad I stumbled on this channel. All these short videos are amazing! This was a no-nonsense refresher to what I learned in College many years ago. Also enjoying the other vids. Subbed. 👍🏼
This one of the best examples of how to explain SQL I have ever seen. Watch other people talk for 4 hours, still no idea what hell they are talking about. This guy did 4 hours in 17 mins in a good way. Thank you sir. Thank you
All your video contents are really great and helpful. For me, there was an instance where I had absolutely no context on the things to refer from. You always come up with a short and concise version concept. I really use your video content for brushing up. Trust me people who are watching all this video.
"Short video which covers up all topic isn't an easy task". It takes lots of skills and experience to do so!
Thank you for all you're content
Damn!
The ending was cool ❤
Thank you much for this awesome, simple tutorial! I'm eager to learn more of this good stuff about SQL.
Thank you for uploading this video! This helps me cover all things I need for this semester as well as my project. Keep up the good work, Jeff!
Easy to digest and thoroughly entertaining video on MySQL I've seen so far. Well done.
This is amazing! My first SQL video ever. I must say there is so much to digest that i My need to rewatch it a few more times.
I wish every tutorial on earth would seem like this... Everything is explicit, plain and simple. Even your screen resolution and graphical elements are so helpful. A great thank you for your work and sharing your knowledge with us!
That's also because SQL is literally purely declarative more so than any other language. So it comes across that way as well.
I've been working with databases for 20 years and still learned a few things!!! Great video...
I've always wanted to learn sql but this is the first video that I have watch from the beginning to the end.
The speed is fast enough and the content is very useful, a very good showcase
That abrupt ending was hilarious 😂😂
I love how he keeps saying sequel, S.Q.L or structured query language to try not trigger anyone, keep it up man :^)
This video taught me what a left join and a right join does. Been writing raw queries but I always stick to inner join. Thanks man.
Thanks so much for these insanely good tutorials! I needed a database for a project and had never touched SQL before; i got it up and running super quickly thanks to this video!
Notification squad 🙋🏻♂️
for people watching in 2023 @6:32 there will be a setting called "password mode" change it from "SQLTools Driver Credentials" to "Save as plaintext in settings"
Thanks, but I get this error for some reason, can you advice me something?
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
@@vonderklaas same I need help toooo
@@vonderklaas Moral of the story is you did something wrong in the configuration process
@@vonderklaas Ok not sure what is wrong with youtube but I have replied several times to your comment and it never went through.
@@Piston1776 Weird, well it's okay!
Bro you literally save me from this semester. I got no prior knowledge in sql but you given hope to pass the sem. Thanks a lot man..
This channel never disappoints me. All the vital information is compressed into small videos and delivered efficiently in an entertaining way. This guy is a genius.
I needed this! I meant the video. A dolphin pillow would be nice too :)
Now i can add SQL to my resume,
"I use arch btw" 😂
Brilliant! Really appreciate the time you put into these videos.
I was looking for a good Tutorial on the topic a day back and here it is today. Love your videos
Can you make a video about the difference between different SQL Databases? I don't really see why I would choose, for example, PostgreSQL over MySQL, MS SQL Server or even Oracle.
Great stuff as always! 👍👍
Post is supposedly for enterprise lvl, big queries. MySQL is most effective in small to medium business, using light to mid queries.
The fact that these videos are free blows my mind. So much knowledge in 17 minutes
This is hands down the best tutorial on mySQL and SQL... And its all in 17 Min 🤯🤯🤯
WoW, this just saved me hours of study. Straight forward instructions and brilliant examples Thank You !
Semester worth knowledge in 17+ mins 😂 great work as always. Ending was smart and hilarious 😂
I think UPDATE, GROUP BY and COUNT should also have made it into the video as they are very bread-and-buttery for SQL. Another thing: I really much prefer working with something like JooQ than an ORM. You get safety and flexibility at the same time. And SQL is actually really easy to learn (as you have shown), so no need for an ORM! They'll only slow you down by being a weird black box you'll have to mess with after some point.
what is JooQ??
@@yash1152writing sql in Java
What an ending! Awesome, as everything on your channel. Thank you for all your effort to help us grow!
I usually pause educative videos so many times because they are boring but I watch yours without pausing them, you are the best
Fun trivia: the "My" in MySql stands for the Swedish author's daughter who was named My, which is pronounced like regular "M", plus the initial "Y" note from "You".
It's not a pronunciation you have to change. Keep calling it MySql, as in "SQL that is mine", no need to confuse your coworkers about the native pronunciation of the app. It's like you have imported the name into your language, but haven't changed the spelling :P like how most languages do for other country names, ex Sweden vs Sverige, Germany vs Deutschland, MySQL vs MySQL :)
MariaDB
"I use arch btw"
How can you say something so controversial yet so brave.
You are making me wish I was born later so I could learn everything in a good way from you lmao
Good video. Needed to review sql after doing it in my bsc and that made it all come back fast
this course is so great and has all the needed info you need it in a short time, big thanks ❤❤
So much for studying this in school when you've got fireship ❤️
Woah.. How? I just had to start with MySQL and Fireship to the rescue! 🔥
Thanks for explaining SQL steps. Greatly appreciated.
I like the way videos of the channel are straight to the point❤️
Lol the ending was perfect 😂😂
Liked the video without even watching it. I know it's gonna be lit 🔥🔥🔥🔥🔥🚒
Thanks alot. Especially on the Join table part. You've really been helpful Jeff 🤗
You are the greatest person on Earth! Exactly what I searched the net - straight to it. Thanks!
"I use Arch, btw"
Nice flexing, bro 😉
thank you
could anyone explain the joke about Arch ?! xD
@@ridl27 long story short, arch users for some reason always had to mention that they use arch to the point that it became a meme
"Google is your best friend" - (Almost) Every developer's motto
duckduckgo*
@@szhzs6121 no developer needs that much privacy in code-time.
Google is much better in it.
Yup
the sign-off was great. good work my dude, and thank you!
Dude you have no ideia how your videos are helping me out
Commenting for the pillow, staying to learn MySQL
16:40 The code here is incorrect and will NOT work the way you intend it to, because:
the "Rooms.owner_id = guest_id" part will find rooms where the owner is also the guest (i.e. owner books his/her own room),
instead, it should be replaced with
"Rooms.id = room_id" which matches room ID in Rooms table and Bookings table.
Otherwise, excellent informative video!
I agree with it being incorrect and your fix being the good one, but what his code will do is rather returning all (owner, room) pairs for each booking the owner has made anywhere no ?
always a pleasure to watch fireship videos
Going through the process of designing my first database. Great info to know!
Me: from today I must sleep less and study more
Goes to youtube for studying...
RUclips video: MySQL pillow giveaway
It is said that the MySQL pillow will help you store all the exam notes...
Your videos are concise and well edited. Always a pleasure to watch. The DROP ending made me smile ^^
thanks again fireship!! your my favorite channel about programming
"how do you know, that someone is using arch..."
Such a piece of video! It's gonna be useful right now I'm coursing DB modeling in my college. Thank you so much!
Exactly the refresher I needed, thanks
Damn... You never let your viewers down
Best channel ever came across
Thank you so much for existing! 🙇
Very helpful video, didn't know about ORM and Sequelize. Thank you
so clear ,to the point and in no time thanks a lot
thanks for the video. It was relatively short but it covered all the crucial concepts of mysql and sql in general
More helpful information per frame than any video I have ever seen. Thank you.
I would like to briefly note that in almost every video you get equally good suggestions, as far as extensions for VSC are concerned. Thanks for that!
great video,, short and to the point! thanks
I was looking for my SQL tutorial bang you are here with that amazing tutorial in 17 mins
I literally spent a whole semester, 4 credit course, with weekly practical-assignment, just to learn it from you in 17 minutes, and your version is better. Thanks bro
Was looking forward this! Amazing!
Just in time for my project, I love you so much, thanks!
This video came at a perfect time for me, just when I really needed to refresh MySQL knowledge :) Thanks!
Literally the best SQL course in the world!
That ending though 👑
Summarized nicely in 17mins, good format.
Learned so many new information about SQL. FIREShip on FIRE!
This is just great stuff, thank you for your service to the community
Thanks man, I finally understood joins
This is fabulous, you are an amazing human, thank you so much.
Dropped the video at the right time ! i was preparing for a mySQL test
Nice Video! Covering Basics of MySQL!
lovvveeeee fireship ,i get fired up after watching your videos