SQL Explained in 100 Seconds

Поделиться
HTML-код
  • Опубликовано: 5 июл 2024
  • Learn the fundamentals of Structured Query Language SQL! Even though it's over 40 years old, the world's most popular databases still run on SQL.
    Foreign key basics docs.microsoft.com/en-us/sql/...
    #dev #database #100SecondsOfCode
    Draw SQL Diagrams drawsql.app/
    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
  • НаукаНаука

Комментарии • 489

  • @danieljayne8623
    @danieljayne8623 3 года назад +2651

    Why am I watching this when I have 10 years of SQL experience? Can't get enough of these videos!

    • @shishkebab64
      @shishkebab64 3 года назад +215

      @John Doe Sounds like SQL was too difficult for you

    • @phatakom
      @phatakom 3 года назад +12

      @@shishkebab64 🤣🤣🤣

    • @danieljayne8623
      @danieljayne8623 3 года назад +21

      I probably used MongoDB about 9 years ago for the first time 😄 The two aren't mutually exclusive

    • @prasannavenkatesh8245
      @prasannavenkatesh8245 3 года назад +9

      @@shishkebab64 LoL 😂😂😂

    • @mihajanstrehovec5114
      @mihajanstrehovec5114 3 года назад +11

      Passive agressive much @everyone

  • @erwinmesi
    @erwinmesi 3 года назад +1086

    Maybe we can change the title to: "Your College Semester in 100 seconds"?

    • @ChaoticNeutralMatt
      @ChaoticNeutralMatt 3 года назад +7

      Lmao 🤣

    • @-indeed8285
      @-indeed8285 3 года назад +2

      🤣🤣🤣

    • @shalinisil9214
      @shalinisil9214 3 года назад +1

      Yess

    • @DR3WS1
      @DR3WS1 3 года назад +8

      This would cover the first 3 weeks of my 1st DB module in college

    • @_boris
      @_boris 3 года назад +1

      still more comprehensive than my college DB modules

  • @anupjoseph7368
    @anupjoseph7368 3 года назад +1041

    sequel for short, now that's how you settle both sides of a debate

    • @smellyD5655
      @smellyD5655 3 года назад +81

      If you want to shorten it, say "squeal". Save another syllable.

    • @GavHern
      @GavHern 3 года назад +27

      im sure that he spent a little bit of time figuring out how to make everyone satisfied haha

    • @smellyD5655
      @smellyD5655 3 года назад +9

      And pronounce "vi" "six"

    • @stolensentience
      @stolensentience 3 года назад +14

      The guy who coined it pronounced it as “sequel”

    • @smellyD5655
      @smellyD5655 3 года назад +33

      @@stolensentience that line of reasoning has not settled the gif pronunciation debate either.

  • @FM-kl7oc
    @FM-kl7oc 3 года назад +853

    SQL: Instead of describing every step necessary to produce a wanted end result, you instead describe what you want the end result to look like, and the database will figure out the steps necessary to produce that end result for you. This aspect of SQL and query engines have always fascinated me.

    • @luisbeneyto6154
      @luisbeneyto6154 2 года назад +12

      P

    • @rodrigozanabria2978
      @rodrigozanabria2978 Год назад +59

      @@luisbeneyto6154 riveting statement

    • @SuperBlackReality
      @SuperBlackReality Год назад +20

      Well, it was just ahead of it's time with all this: the computer knows better
      spoiler: it doesn't

    • @reilandeubank
      @reilandeubank Год назад

      @@user-bj4lp3fr1o And now I can tell chat GPT about a database and ask it in plain english what Data I want and it can write a valid query 99% of the time

    • @Alixdkari
      @Alixdkari 8 месяцев назад

      lol why did they make sql when they can just use a filter on an excel sheet? dumb nerds!

  • @CoenCritcho
    @CoenCritcho 3 года назад +101

    An SQL Query walks into a bar and goes up to two tables and asks "Can i join you?"

  • @stokbrood
    @stokbrood 3 года назад +197

    in 100 minutes/days/years... We'll never know
    Edit: The title originally didn't contain "Seconds"

    • @samarmohan9891
      @samarmohan9891 3 года назад +3

      lol, its funny that i said that first but you got more likes :D

    • @benouattara6249
      @benouattara6249 3 года назад +30

      @@samarmohan9891 it's funny that you are tracking his numbers of likes

    • @thisbevibhor
      @thisbevibhor 3 года назад +7

      @@samarmohan9891 How the turntables.

    • @Fireship
      @Fireship  3 года назад +62

      That's what happens when you publish from your phone 🤦‍♀️

    • @benouattara6249
      @benouattara6249 3 года назад +4

      @@Fireship gotta make an AI for that

  • @RedShift5
    @RedShift5 3 года назад +207

    Some pro tips after years of experience: use singular type (table) names, use a fully descriptive name for the primary key (player_id, team_id, ...) and reuse those names for foreign keys, make sure to properly apply constraints (foreign key constraints and for example a column can only contain a value between 0 and 10), try to avoid NULLs as much as possible, don't bother with datetime types (just use bigint unix timestamp and always ALWAYS store in UTC), learn as much about your database server as you can because it can do a lot more than you think, use the force!

    • @uv42
      @uv42 Год назад +2

      I've always wanted to use a bigint Unix timestamp but wherever I've worked they always use a date time. Had to fix so many bugs related to timezones.

  • @UliTroyo
    @UliTroyo 3 года назад +169

    DrawSQL looks like such a neat tool.

    • @frankhuurman3955
      @frankhuurman3955 3 года назад +29

      thanks for the tool name :) was actually curious about it. Too bad there isn't a free variant on this

    • @azventures8038
      @azventures8038 3 года назад +4

      @@frankhuurman3955 There is, for public tables

    • @SumanRoy.official
      @SumanRoy.official Год назад +1

      ​@@frankhuurman3955mysql workbench, it ain't that beautiful to look at but its good, else you can pirate dbforge

    • @frankhuurman3955
      @frankhuurman3955 Год назад

      @@SumanRoy.official Thanks! I'll check it out :)

  • @degree1996
    @degree1996 3 года назад +116

    The only channel where I'd watch something i already know about regarding computer science, your videos are captivating man, keep it up

    • @kushal6065
      @kushal6065 2 года назад +5

      cuz it's short and sweet with soothing and relaxing voice

    • @rinie875
      @rinie875 2 года назад

      @@kushal6065 lmao true

  • @tobiasrasmussen4347
    @tobiasrasmussen4347 2 года назад +33

    I am just now learning SQL Server and your video is God-sent. I mean, the concise explanation, the language used, the graphical representations, etc. It's just perfectly done!

  • @56independent42
    @56independent42 3 года назад +106

    when reccomendations are quicker then notifications

  • @AdityaKumar-fl1tb
    @AdityaKumar-fl1tb 3 года назад +19

    I was searching for this!
    Thank you for the video!
    Keep the hard work going! 🔥🔥🔥🔥

  • @cormanec210
    @cormanec210 3 года назад +43

    Early enough for the title to be "SQL Explained in 100' without the 'seconds'

    • @sodiboo
      @sodiboo 3 года назад +3

      title written in less than 100 lmao

    • @softwarelivre2389
      @softwarelivre2389 3 года назад

      yes

    • @cormanec210
      @cormanec210 3 года назад +2

      Holy crap... now I know how effective being early is when making your comment.

  • @f2yd
    @f2yd 3 года назад +255

    They took half a year to explain this in Uni and you did in 100 seconds, nicely done! I might be wrong, but at 2:01 the "primary" and "foreign" labels seem to be swapped.

    • @Ali2307013
      @Ali2307013 3 года назад +27

      You are right about the last point. You seem very focused haha.

    • @mikoajfiedorczuk9431
      @mikoajfiedorczuk9431 2 года назад +64

      it's more like it takes half a year to fully understeand what is he saying in those 100s

    • @kennyelkhart
      @kennyelkhart 2 года назад +11

      I bet they took half a year to explain this and *much* more to give you a proper understanding. If they didn’t, you got ripped off.

    • @captainlennyjapan27
      @captainlennyjapan27 10 месяцев назад +1

      Thanks for this cuz I was confused a bit

  • @Thokpower1
    @Thokpower1 3 года назад +8

    Why did I learn more from this 100 second free RUclips video than the thousand dollar university course I took

  • @stanleywarren129
    @stanleywarren129 2 года назад +1

    I'm a huge basketball fan and know nothing about sql but the fact that you used basketball as your example really helped me alot

  • @sessionswithtemitope
    @sessionswithtemitope 3 года назад +3

    Thanks to this I understand what primary key and foreign key is. I would like to see an extended tutorial on all JOINs and some random Clauses like Trigger.

  • @candiedskull9841
    @candiedskull9841 10 месяцев назад

    I love watching your explanations before I really dive into something, and then later after I've done some more in-depth learning. Still waiting on the rewatch for when I actually "know" something though

  • @creatingwithcode1630
    @creatingwithcode1630 3 года назад +1

    Greg Ostertag... there's a blast from the past.
    Another great vid Jeff. Thx! 👍🏾

  • @kokomanation
    @kokomanation Год назад

    I am an amateur developer and your videos have really helped me gain spherical knowledge on CS

  • @n_core
    @n_core Год назад +1

    >Video about SQL
    Everyone else: Talk about database, data manipulation, MySQL, PostgresSQL, SQL Server, etc.
    Me: Civilization V & VI modding!

  • @stevie1da_
    @stevie1da_ 3 года назад +2

    I'm required to take a database class for my cs degree, this video just summarized the entire content of that class

  • @penguinmonk7661
    @penguinmonk7661 Год назад

    Wonderfully efficient, thank you. This was a master class in minimalized visual explanation .

  • @nolram
    @nolram 3 года назад +4

    This was great, I cant wait for the SQL !

  • @OleksandrBorysenko333
    @OleksandrBorysenko333 11 месяцев назад

    I'm trying to learn SQL and this video gives me a bit more understanding! It helps 👍

  • @poloyc
    @poloyc 3 года назад

    I really like your videos! Short, but FULL of content. Thanks for sharing ;)

  • @ruaidhrilumsden
    @ruaidhrilumsden 3 года назад +28

    Sorry for the downer but in MS SQL Server the statement at the end of the video wouldn't work. The WHERE clause has to come after the JOIN statement. I haven't used much of MySQL and haven't touched any of the others so not sure if the syntax varies and it lets you do it that way.

    • @esclavodeluna8000
      @esclavodeluna8000 2 года назад +1

      My college makes us use the oracle standard and I don't think it would work either.

    • @dammitanothername
      @dammitanothername Год назад +1

      LOL this logic in the video wouldn't work anywhere. They all need the source before they can limit the source's data. So joins come before the where clause. i've worked on ms sql, mysql, redshift, snowflake, oracle, sqlite, access...all kinds of tech. good catch. very astute.

  • @BarbaHectic
    @BarbaHectic 2 года назад

    Absolutely love these series!

  • @kuldipthakkar2606
    @kuldipthakkar2606 3 года назад +1

    I just love your explaination....Simple...Short...Superrr 🥳

  • @abdulwahidgul
    @abdulwahidgul 3 года назад +14

    I think you have to join the table and then set the where condition. The other way would give your an error

    • @Phatrikko
      @Phatrikko 3 года назад +3

      Was wondering which flavor of SQL that is. The WHERE goes at the end in mssql, mysql, and I think Oracle. Can't speak to any others though.

    • @EinKesselBuntes
      @EinKesselBuntes 3 года назад +3

      Each part of the query is executed sequentially and the order is a bit different to how you read the statement. The execution order is as follows:
      [1] FROM and JOINs
      [2] WHERE
      [3] GROUP BY
      [4] HAVING
      [5] SELECT
      [6] DISTINCT
      [7] ORDER BY
      [8] OFFSET

    • @penguindrummaster
      @penguindrummaster 2 года назад

      @@EinKesselBuntes You separate DISTINCT and ORDER BY but I was somewhat certain that DISTINCT relied on a SORT operation to complete to guarantee the uniqueness of the returned set (it's a small nitpick that doesn't really matter).
      The thing that does matter, and why I appreciate you grouping FROM and JOINs on the same item, is that just because an item is listed first (like FROM before a JOIN) doesn't guarantee that query processor will start there. It's one of those intermediate lessons you learn after working with it forever that you have little control over the order of operations, and generally the best you can do is nudge it in your intended direction, lol

  • @ejm110
    @ejm110 3 года назад

    I am not programmer but a network guy, I really do enjoy your videos

  • @dan6erbond
    @dan6erbond 3 года назад +2

    Me: Has been using SQL for years.
    Also me: Watches anyway because Jeff's about to blow my mind.

  • @FunGuyx0x
    @FunGuyx0x 3 года назад +12

    1:50 shouldnt be the where clause after the join :D?

    • @manishbfmv
      @manishbfmv 3 года назад +1

      Ya same question..

  • @gregor3148
    @gregor3148 3 года назад +13

    I primarily use MySQL 8 for everything. Tried lots of time to shift to other db but nothing beats the power of SQL. I might perhaps switch something else in future but in generally, all my production apps are running smoothly on MySQL. With JSON type supported, it becomes even more useful

  • @ubisuccle
    @ubisuccle Год назад +1

    This alone taught me more than my college Databases class

  • @Max-42
    @Max-42 3 года назад +4

    Awesome as always!

  • @rakshitpatel9664
    @rakshitpatel9664 3 года назад +7

    Mark my words
    In near future this channel will be on top choices of every Developer in the world.

    • @RaymondRewind
      @RaymondRewind 6 месяцев назад +2

      hello from the future, you were right!

  • @kiwihour333
    @kiwihour333 3 года назад

    About to do this in school. Thanks for the explanation

  • @mridulbarman027
    @mridulbarman027 3 года назад +2

    I like you videos even before played, and you never disappoint me ❣️

  • @lelosithole7402
    @lelosithole7402 Год назад

    Wow great explanation makes it soooo easy , Thank you !

  • @dovinhas
    @dovinhas 3 года назад

    i learn in this short video, more any other course or tutorial even books. congrats.

  • @samuelsamuel4099
    @samuelsamuel4099 3 года назад +2

    Mom: no we already have mysql at home
    Mysql at home: Excel

  • @renu3463
    @renu3463 3 года назад +6

    More on Svelte firebase

    • @Fireship
      @Fireship  3 года назад +2

      Sveltekit is looking very cool

    • @renu3463
      @renu3463 3 года назад +2

      @@Fireship it uses Snowpack under the hood, I guess.

    • @codeaperture
      @codeaperture 3 года назад

      What about sapper ? Will it ever be released??

    • @electrolyteorb
      @electrolyteorb 3 года назад

      @@codeaperture nope

    • @electrolyteorb
      @electrolyteorb 3 года назад

      happy to see svelte enthusiasts... :)

  • @panzach
    @panzach 3 года назад +3

    @ 2:02 Primary/Foreign labels should be swapped: `Players.team_id` is the Foreign key and the `Teams.id` is the Primary key

  • @RuiAndrada
    @RuiAndrada 3 года назад +1

    Like without see, it's always a terrific vídeo!

  • @kaojaicam
    @kaojaicam 3 года назад

    Excellent description, thanks

  • @thelaitas
    @thelaitas 3 года назад +2

    Thanks, I never knew that Greg Ostertag played for the Jazz

  • @anonymousrashiyama1432
    @anonymousrashiyama1432 3 года назад

    Looking forward to more Database interview topics, please

  • @asina1773
    @asina1773 Год назад +1

    Thanks for the video,
    I'm a business student and I'm primarely interested in marketing. Do you guys think that learning SQL to making analysis on using a data for marketing purposes helps me out?

  • @judysalem-ht2gw
    @judysalem-ht2gw 18 дней назад

    00:03 SQL is the standard language for relational database systems.
    00:23 IBM introduced System R database with standardized syntax in 1986
    00:43 Establish relationships between data points
    01:02 Structuring data in smallest normal form to eliminate duplication
    01:19 SQL syntax contains key parts
    01:37 Filter results using the WHERE keyword
    01:52 SQL uses join keyword to connect data from different tables
    02:09 SQL is a structured query language supported by many databases.
    .

  • @Tarotakii
    @Tarotakii 2 месяца назад

    Did you ever do the full tutorial? I'm taking Database at my college and your explanation cleared a bunch of things I didn't understand. :)

  • @KishanKa
    @KishanKa 3 года назад

    Great start for beginners. Could you please make a short and detailed video on mongodb?

  • @Ari-ej6lb
    @Ari-ej6lb 3 года назад +1

    Thanks, perfect timing

  • @lancemarchetti8673
    @lancemarchetti8673 Год назад

    Nice!... lambda loves squirrel sql mounted on a svelte backend that regulates Hugo along transitional database contracts. Tash hags included! .
    Yay!

  • @davidabba7663
    @davidabba7663 3 месяца назад

    short and on the point thank you

  • @fercho3689
    @fercho3689 5 месяцев назад

    I just learned more about it here than in my one semester class

  • @MorganHvidt
    @MorganHvidt 3 года назад

    Full SQL tutorial would amazing 🙏

  • @tapu_
    @tapu_ 3 года назад +9

    My homies use Json as database.

    • @softwarelivre2389
      @softwarelivre2389 3 года назад

      On small test projects I even use csv as database and then keep calling string.trim().split('
      ').map(row => row.trim().split(';').map(cell => cell.trim()));

    • @Amaraticando
      @Amaraticando 3 года назад +1

      For POC tests and fake APIs, try json-server.
      For real stuff, a real database is the way.

  • @echoptic775
    @echoptic775 3 года назад

    Bruh, im not kidding i started learning sql yesterday and u made the video

  • @jackass984you
    @jackass984you 3 года назад

    good vid, full sql tutorial would be awesome

  • @songokussj4cz
    @songokussj4cz 3 года назад +2

    I'm kind of "new" to SQL (mssql) and right now I have few tables with relations, no problem. But how do I design a table for USER SETTINGS? I mean for example site background (and few others). Where and what values would the table have for logged in users?

  • @Amplifimusic
    @Amplifimusic 3 года назад +1

    Can you do a video of Gemini? The middle ground between Gopher and http

  • @the_linguist_ll
    @the_linguist_ll Год назад

    You would not believe how much of a lifesave SQL is during linguistic fieldwork

  • @FabricioLucianoCastillo
    @FabricioLucianoCastillo 3 года назад

    please, do a full video. It'll be awsome

  • @TheOrteme
    @TheOrteme Год назад

    FULL TUTORIAL IS VERY NICE IDEA

  • @patrickck8185
    @patrickck8185 3 года назад +4

    yeah lets go for the full tutorial..

  • @FilipCodes
    @FilipCodes 3 года назад +1

    Sql tutorial cant wait!!

  • @pixiedev
    @pixiedev 3 года назад

    Loved this explanation. Plz make full sql video.
    #fireship #fireshipio #100secofcode

  • @PterPmntaM
    @PterPmntaM 3 года назад

    Great video and tool for drawing diagram

  • @marlonmarcello
    @marlonmarcello 3 года назад

    A full SQL tutorial please!

  • @poglord._
    @poglord._ 3 года назад +1

    Amazing work 😁.

  • @adnanamin1843
    @adnanamin1843 3 года назад

    Loved it! ✌️

  • @jorritwegman9143
    @jorritwegman9143 3 года назад +2

    Fun video! It would have been nice if you added in that SQL is a descriptive language, so the text you write isn't actually executed. It's translated to an optimized script, which then gets executed.

    • @ShadowriverUB
      @ShadowriverUB Год назад

      Its executive code as it technicly same as commands and have procedural features and you can execute in sequance. Lot of classical php cms install by not having information how database is constucted which would be descriptive, but sequance of sql queues which builds the database. What you dezcribe could be said about C or C++ or C#. Also programing languages can addapt sql like features like Linq in C#

  • @AkshaySinghJamwal
    @AkshaySinghJamwal 3 года назад

    Wow, really informative video.

  • @antontraceur
    @antontraceur 3 года назад

    Hey, thanks for the coolest videos for devs. What is the tool you used for graphical representation of the schema?

  • @cockroachdb
    @cockroachdb 3 года назад +1

    Impressive Greg Ostertag reference.

  • @fernandoorozco3474
    @fernandoorozco3474 3 года назад

    He should stop asking "... If you wanna see", of course we want to, I mean, it's a fireship video. 🔥

  • @JimmyS2
    @JimmyS2 3 года назад

    Can you plz make a short on : Stored procedure

  • @toxaq
    @toxaq 3 года назад +5

    The most important part was missed: ACID compliance. You can actually trust and rely on the data integrity, unlike most document databases...

    • @Nikola9517
      @Nikola9517 3 года назад +1

      i was searching for this dumb comment ngl

  • @dammitanothername
    @dammitanothername Год назад

    this is good for beginners. The hard part is learning how to think in logical terms to get what you want. the last sql statement in the video is wrong. as someone pointed out the where clause is mistakenly placed before the join.

  • @elektr1x7881
    @elektr1x7881 3 года назад +1

    SQL Explained in 100
    "100 what? apples? bananas?"

  • @ThomasGodart
    @ThomasGodart 3 года назад +17

    While I generally like those short videos, this one is mostly wrong or lacks important concepts, for a change. Databases are not "based on SQL" they're based on what is called an "engine", and the SQL language is just the API that is used to access it. Tables don't need a key. Keys can span over multiple columns. Accessing data needs to be done through indexes for performance, and indexes can also span to multiple columns. Databases also deal with events and can cascade behaviour to enforces certain integrity contrains. SQL also has capacities for mutation over the scheme of the data, and most of the databases engines can perform those mutations while the database is running other requests in parallel, and those requests will succeed.

    • @Fireship
      @Fireship  3 года назад +14

      I agree, there are some areas for improvement here. Working on a full SQL video and taking your comment into account.

  • @KTechy-
    @KTechy- 6 месяцев назад

    Great explantion❤❤

  • @hank9th
    @hank9th 3 года назад

    I think a good SQL sequel would be "Different types of SQL JOINs explained in 100 seconds"

  • @demonslayer8502
    @demonslayer8502 2 года назад

    really awesome man

  • @codingisinourdna
    @codingisinourdna 7 месяцев назад

    Structured Query Language , SQL or Sequel for short *lol , this made me distracted for the first minute and had to rewatch 😆

  • @santokhan_
    @santokhan_ 3 года назад

    Thank you. It helps❤️❤️❤️

  • @monkemode8128
    @monkemode8128 3 года назад

    No clue what any of this means but sounds interesting, nice video 👍👍

  • @adil_elkhallouki
    @adil_elkhallouki 2 года назад

    thanks I like clear and short 👍

  • @lunoxlob
    @lunoxlob 11 месяцев назад

    I feel like a dummy, I have been planning to start learning SQL because it is so important, but I struggle to understand this 2-minute video, and it gets overwhelming! I think I will end up switching careers in the end

  • @niteshkhatri6224
    @niteshkhatri6224 3 года назад

    Can anybody tell which theme he uses for vs code. It looks so cool and materialistic 🔥

  • @okopyl
    @okopyl 3 года назад

    Yeah, please make a complete tutorial on SQL

  • @GKNaidu-hb5zv
    @GKNaidu-hb5zv 3 года назад

    informative video.. ♥️ from India

  • @abhinavsrivastava
    @abhinavsrivastava 3 года назад +1

    which schema designer tool did you use?

  • @lukash534
    @lukash534 Год назад

    For what does i exactly need left join ? Nice video

  • @Vkakash
    @Vkakash 20 дней назад

    best explaination ever

  • @snappyie
    @snappyie 3 года назад

    Which software are you using for designing SQL databases? That looked really cool!

  • @pharmokan
    @pharmokan 3 года назад

    MIND BLOWN FOREIGN KEY

  • @codeaperture
    @codeaperture 3 года назад +1

    I needed this. Hey Jeff I do struggle with modelling the data layer. Especially relationships and joins between them. How can I learn this. Any platform you guys use?..

    • @monkemode8128
      @monkemode8128 3 года назад

      For me, udemy and building stuff. Theory is good but practice is critical too.

  • @sansko
    @sansko 3 года назад +1

    I feel like you got the Primary and Foreign key switched around. `id` is the primary key on `Teams`, referenced by the foreign key named `team_id` in the `Players` table