Pro tip for anyone who needs to do any database administration: Start every destructive command with BEGIN TRANSACTION, and a ROLLBACK, then type your command in between. Change ROLLBACK to COMMIT once you're sure that your command is ok. Saved my butt a number of times at my job. Happy to be going back to the basics of CS.
@tiagotele15 ай бұрын
Awesome tip! Thanks!
@donfeto76369 күн бұрын
Ty , hope your butt stays always safe.
@edumartim10 ай бұрын
this professor is a teaching machine, way to go!!!!
@enisten Жыл бұрын
Just beautiful. This was a significant improvement over last year's lecture and I really liked it. Thank you Prof. Malan!
@dancedeja15 күн бұрын
50:29 "but my little baby table that came back -- not a technical term". Love the precision from the instructor ❤
@riyajath_hmd10 ай бұрын
Great lecture as always. Thanks CS50 and Prof. David Malan for offering this course to everyone free of cost.
@asheaven1st11 ай бұрын
I love how he teach.. I love how he explain.. Man.. Wish the world have a people like him on every life-aspect
@vikingthedude11 ай бұрын
Like when i was learning to drive 😔
@samnadim99133 ай бұрын
Salam, everyone wishes someone would pick up the trash but they're not that person. Be that person when there isn't that person don't expect that person to show up, so you should be that person
@yavor059 ай бұрын
Thank you Prof. Malan! A great lecture! It is very kind of you to make such knowledge readily accessible and explained in a captivating way.
@IsisBarrett-Lally10 ай бұрын
Awesome video! I'm picking up SQL for the first time, and using it as part of my PhD in humanities, and this was perfect to get started, thank you!
@bassycounter9 ай бұрын
Equal equals equal in sequel is my new favorite tongue twister
@activationfunction Жыл бұрын
Learning SQL is like learning PLC programming. The syntax, theory, workflow, framework... are pretty straightforward. The clusterfeck comes when you start working and realizing that other people's system and setup are ridiculous (and now you are tasked with maintaining or scaling it).
@youMatterItDoesGetBetter11 ай бұрын
Especially when you get real-world experience with legacy SQL systems. Databases are a f*cking nightmare to work through. It's all archaic non-sense.
@Blackfeet9 ай бұрын
Yeet.
@youMatterItDoesGetBetter9 ай бұрын
You should see the DB2 Database at my work. It's a foreign language with SQL sprinkled in.
@PasirPrism11 ай бұрын
i went to an SQL course at Oracle 25 years ago... the basics have not changed but this is clearly and well explained and once you master it, it is so much better than python for large data queries . CS50 is really the best.
@charliebitmyfinger712410 ай бұрын
I don't think SQL and Python are even comparable.
@beyond199410 ай бұрын
Python evidently has larger parameters for its usage,. However, in the context of data analysis, they can be comparable. @@charliebitmyfinger7124
@SnPnibba10 ай бұрын
@@charliebitmyfinger7124 bros out here comparing general purpose full fledged programming language to a query language lmao
@user-ex5pg3oy9c8 ай бұрын
@@SnPnibba I think HTML is the best programming language!
@mohammeds50073 ай бұрын
@@user-ex5pg3oy9c😂😂😂
@tingdongliao70368 ай бұрын
Great lecture Dr. Malan! Shout out to the supporting team behind too for breaking the educational barriers
@0001ssss11 ай бұрын
Thank you, dr. Malan People like you are really inspirational for CS world.
@MartaBayou22 күн бұрын
You are the best teacher and the best person mr David
@MartaBayou22 күн бұрын
Thank you for your patience and support you are the best teacher
@semihturku3426 ай бұрын
I started learning to code with the CS50P series and now I am continuing with CS50X. I watch and learn a lot about coding. Thank you for all of it.
@FigueMonk6 ай бұрын
I am just like you! We have achieved a lot so far. Congratulations, my friend. See you in CS50W!
@GenZ_01_5 ай бұрын
I finished school but it feels like Ive just started the real one.school of life. Cs50 is ranked right at the top classes.
@zeeshan.safdar11 ай бұрын
the best intro of CS50
@skblink7 ай бұрын
This lecture is worth the same as an entire semester of two subjects in my university course
@denysolleik98967 ай бұрын
Actually it's completely worthless. You can just have a chatgpt with things you don't understand. I've seen this guy before. He's using way too many words to explain the basics. He's just wasting everyones time trying to promote how prestegious universities are, but everyone is capable of learning. Some people, those who go to a university, need a little pushing. As if it's a mental illness.
@bonadoni7627 ай бұрын
@@denysolleik9896 Not everyone is as smart as you, brother. I myself am not a fan of learning through ChatGPT or any other AI because it easier for me to learn things through a person's explanation.
@Swegrid7 ай бұрын
@@denysolleik9896 Get laid dude
@sagarpanwar28456 ай бұрын
Then why you are here.
@hedgehog_hey5 ай бұрын
@@denysolleik9896 Why u here ?
@Dan-y3f7p11 ай бұрын
Honestly wish the first part of the lecture opening csv files was included in the last video. Really struggled with this in pset DNA
@sefonefinpsefnpefn419110 ай бұрын
true
@CalvinApraku8 ай бұрын
@@sefonefinpsefnpefn4191 just drag the csv file from your local computer and drop it in the web terminal
@aniiko41388 ай бұрын
Same lol
@martinepstein98267 ай бұрын
For DNA I just skipped the CSV module and did it with string methods. In particular .split(",")
@Josh-Parkhill3 ай бұрын
@@martinepstein9826 have you seen the TV show guy 'Smart Guy'
@aalekhmotani38773 ай бұрын
best tutorial ever, he is too good at teaching
@alyonkabenya Жыл бұрын
getting the information from the first part of the lecture would be super useful for the DNA task 😄
@_kage_ Жыл бұрын
fr
@farhanarahman937511 ай бұрын
you mean the problem from week 6?
@sefonefinpsefnpefn419110 ай бұрын
@@farhanarahman9375yes
@jjfam7779 ай бұрын
Exactly what I said 😭😭
@juli.729 ай бұрын
Carter covers that on week's 6 section. Don't skip them! The sections from each week are super useful.
@SilvanaSuarezCarvajal3 ай бұрын
Hata ahora he aprendido todas estas cosas en cursos de 6 meses, realmente fueron útiles para profundizar, pero estar viendo esto ahora sintetiza todo lo que he aprendido y le da una razón de ser, un algo real en lo que utilizarse.
@pain_equals_growth16 күн бұрын
46:17 DAY 1 1:08:22 DAY 2 1:26:25 DAY 2.1
@sheldonj82047 ай бұрын
Guys, if your terminal left aligns the output (unlike in the video), type in sqlite3 prompt: .mode table
@donfeto76368 күн бұрын
Great, even though I know all that information, I keep getting back to CS50 to see the great David teaching.
@MasterOfYourself8 ай бұрын
Thank You, David for everything. I really liked the Milk analogy.
@rishavjain50876 ай бұрын
at 32:08, doesn't the count contains "problems", so how david could get an answer for "Scratch"? if that was your question, well scratch was also a problem set..check out here 30:50, just after Hello worlds and Filter
@harshpareta-o6o2 ай бұрын
This lecture was just INSANE; I mean, got lot of things to learn
@meg.cabellera10 ай бұрын
I'm grateful that I can understand English, as it allows me to learn from some of the world's leading professors.
@meg.cabellera10 ай бұрын
我好喜歡他在講解 join 語法時,從長到短來介紹三種語法篇幅 1:42:17 Executing joins with multiple tables in SQL 1:44:36 Different ways to join tables in SQL
@polaris_babylon11 ай бұрын
An operating systems course by CS50 would be awesome
@ninedaniel24611 ай бұрын
One of the best teachers EVER!!
@gennadyshevchenko79408 күн бұрын
1:17:18 There is another explanation why relational databases are called that way. Because they are based on relational theory.
@user-kt1iz4vc3x5 ай бұрын
2:06:00 unfortunately there is a mistake here. placing the two queries in one transaction does not solve the race condition issue. there are several solutions, one of them is to just add (or delete) an entry to the Likes table and each time this happens trigger a function that updates the likes counter, which can be stored as a column of the Post table.
@ceal21377 ай бұрын
I'm using Windows, installed sqlite3 on WSL using "sudo apt install sqlite3" some minor differences and I wonder why 1:56:26 when I typed sqlite3 favorites.db, it didn't ask for a confirmation if I want to create a new db 1:59:18 it didn't show alias n above the number 34
@MartaBayou22 күн бұрын
I will learn about today's lecture when I was grade 12 on the last year
@Hellmiauz2 ай бұрын
1:51:14 "So when you run create *INDEX*? (maybe?)
@nicholaslydon70898 ай бұрын
fantastic lecture as always, thank you!
@goagirl9767 Жыл бұрын
The opening music is awesome! Came for the class but stayed to listen to the opening music on loop!
@Dante-fk4yi Жыл бұрын
Your priority = zero
@goagirl9767 Жыл бұрын
Haha so true! You go become a tech tycoon!
@monkeysgone2heaven111 ай бұрын
reminded me of the start of a James Bond film
@chamaocharles8 ай бұрын
Amazing professor! I was looking for vídeo tutorial to recommend to a friend. This one is perfect.
@ad57728 ай бұрын
I got a question, I wonder if you can help, I notice his terminal is so clean when running his programs, do you have an idea how he set it up like that ?
@chamaocharles8 ай бұрын
@@ad5772 Hi! I never used, but I believe he is executing commands on the command line window on VS Code (press CTRL + J). I usually use Microsoft Studio Managment Studio to access usually SQL Server. He is using SQLite. Ask ChatGPT: "How to execute sql commands on sqlite through vs code terminal window". Here is the answer that it respond it: ``` You can use an extension to open, view, and query SQLite database files directly in **Visual Studio Code**. Here's how: 1. **Install the Extension**: - Click on **Extensions** in the left sidebar (you can also open the Extensions menu by pressing **Ctrl + Shift + X** on Windows or Linux, or **Command + Shift + X** on macOS). - Type **SQLite** and install the extension by **alexcvzz**. - Click on the **Install** button. 2. **Open an SQLite File**: - Once you've installed the extension, you can open an SQLite file by: - Right-clicking on the file in **Explorer**. - Clicking on **Open Database**. - The database will appear as a collapsed menu in the **Explorer** tab. - Click on **SQLite Explorer** to expand the database. - You can then click on a specific table and view its data or run a query. 3. **Running Queries**: - To run a query, create a **.sql** file (e.g., **001.sql**) and type your query. - For example, to select the first 10 rows from a table called **albums**, use: ```sql SELECT * FROM albums LIMIT 10; ``` - To run the query: - Press **Ctrl + Shift + P** on Windows and Linux (or **Command + Shift + P** on macOS). - Type **SQLite run query** and select **SQLite: Run Query**. - A new tab with the query results will open. 4. **Closing the Database**: - When you're done working with the database, you can close it by: - Pressing **Ctrl + Shift + P** on Windows and Linux (or **Command + Shift + P** on macOS). - Typing **SQLite run query** and clicking on **SQLite: Close Database**. Remember to expand the **SQLite Explorer** menu in the left sidebar after opening the database. Happy querying! 😊 For more details, you can refer to [this article](bobbyhadz.com/blog/vscode-view-query-sqlite).¹ Origem: conversa com o Bing, 09/05/2024 (1) How to open, view and query SQLite in VS Code | bobbyhadz. bobbyhadz.com/blog/vscode-view-query-sqlite. (2) Transact-SQL with Visual Studio Code. code.visualstudio.com/docs/languages/tsql. (3) How to run SQL query in visual Studio Code - Stack Overflow. stackoverflow.com/questions/72743136/how-to-run-sql-query-in-visual-studio-code. ```
@robertjcliuАй бұрын
You are demonstrating to me the value of Harvard although I'v never stepped into the territory of U.S.A.
@tanvirhasanmonir162710 ай бұрын
As always best lecture 💚
@worldwar_two28944 ай бұрын
i wish i'd like David Malan's content 100000000x🙃
@SothearithKONGMrMuyKhmer10 ай бұрын
❤❤ Great lecture as always.
@tuanh966111 ай бұрын
1:16:33 I think he meant to say "primary key"
@WellnessChronicleАй бұрын
Yes I guess
@winnieroze9 ай бұрын
There's a whole new intro now!!
@cachaça_baby11 ай бұрын
Learning from a Harvard Teacher from a brazilian favela for free.
@jamespawson604510 ай бұрын
Otimo irmao! Boa sorte pelo futuro! Segue assim :-)
@dannyisrael9 ай бұрын
Niiiice! 🙌
@RashadPrince9 ай бұрын
This is so awesome to hear. I've been listening to him for free on Apple podcast since 2009 🙏 This is even before he started doing free lectures for everyone and even you could download the videos off the Apple podcast because it was only for Harvard students at that time Now it's for everyone 🎉
@RuanSantos258 ай бұрын
lol same! Vamo que vamo irmão 🤙
@giulia69306 ай бұрын
Learning from a country that helped make your country a favela for free 🤔
@Bati_6 ай бұрын
This wonderful vide has made me appreciate the pandas library.
@monitorstolenfromikea6 ай бұрын
Lol this stuff was complex
@gennadyshevchenko79408 күн бұрын
1:51:14 - 'create index' or 'create database'?
@Mo-ip4mm7 ай бұрын
This is so nice for beginners
@maianhvkАй бұрын
1:16:34 I think he meant to say "Primary key is the column that uniquely identifies your data", not "foreign key..."
@Nanagos Жыл бұрын
47:53 "Equal equals equality in the world of 'Sequal'." 😂
@Hellmiauz2 ай бұрын
Would it be better if IMDB had a table "genres" with a unique genre id and a genre (text) and then have a relationship table with foreign show ids and foreign genre ids?
@vincentkosmol96792 ай бұрын
1:03:19 All of these sheets
@tensevo3 ай бұрын
regarding sql injection attacks, i imagine some enterprising young staff member deleting those extra characters, as it looks untidy, unknowing that it actually protects the database.
@Aman-fz1ew11 ай бұрын
great lecture ;
@manifestasisanubari Жыл бұрын
I'm a noob in SQL but why isn't my sqlite3 interface as neat as this interface with ASCII art? I downloaded it from the original website and I'm using it from Windows cmd. Is this a different version or from a different source? Mine doesn't even display the headers
@davidjmalan Жыл бұрын
Best to use cs50.dev ! Or on Windows, you can run `sqlite3 -table` !
@manifestasisanubari Жыл бұрын
@@davidjmalan OMG didn't expect Dr. Malan to reply to this! I thought that maybe others watching would reply. Thank you David! It works 🥰🥰🥰
@MazineZ11 ай бұрын
A simple solution is to set your mode to table by using the following command `.mode table`
@100drips5 ай бұрын
First, i thought SQL is dry and boring. But these problems sets are so much fun. My favorites so far!
@wellakshually4 ай бұрын
21:50 something completely unrelated: the spelling of "favourite" is different from the US version "favorite"
@qqqalo2 ай бұрын
9:04 is wrong. You close a file by writing `file.close()`, not `close(file)`
@k16e10 ай бұрын
So thorough!
@mrtn-py9zl7 ай бұрын
Describing joins as glue should result in the wrong mental model though. The use case Joins have been invented for is a glue-use-case, but it's a quite specific edge case. In actuality, joins are combinatoric operations, so you'd start with explaining cross joins first. All other joins are essentially cross joins within a domain (specified by keys with ON/USING) where you chuck out NULLs selectively depending on the kind of join (e.g. right-side NULLs in LEFT JOIN). Understanding the combinatorics nature of joins is so essential, especially when debugging and a key we thought was unique is not actually unique.
@Russ_Paul10 ай бұрын
What would be the easiest way to view a relational view (as per in the video with the connected boxes) of the schema for shows.db? Could I export .schema's output into some sort of previewer? edit: The term I was looking for is 'entity-relationship diagram'. As a manual workaround and some help from docs, I converted the sql to postgresSQL and used the dbizzy extention for vscode. It is a bit basic and doesn't show the one-to-one, one-to-many etc symbols, but it's a start.
@muyanjassenyonga33989 ай бұрын
Incredible eloquence at such talking speed ?
@Jason-ot6jv3 ай бұрын
Been a backend dev for about 2yrs now. My best advice is to pronounce SQL as `ES QUEUE ELLE` and NOT `SQEAL` or `SEA QUILL`
@aleclippe621311 ай бұрын
GOAT ACTIVITIES
@Solao9264 ай бұрын
"Tough crowd" 💀
@aniketbisht28239 ай бұрын
NGL, the intro reminds me of GOT intro. EPIC.
@antonioskokiantonis705111 ай бұрын
Without data there is no need for CS!
@bilalbeny417211 ай бұрын
thank you so much for this lecture, it was useful 🎯
how did he make his terminal so clean when he run his programs. I have vs code but I have literally failed to setup such an environment. Please be kind I am old
@kennessu46427 ай бұрын
ctrl + l if im not wrong
@kennessu46427 ай бұрын
ctrl + L
@vivekanand25882 ай бұрын
50:26 "baby table, not a technical term" :-DD
@AungThiha-xj2bb7 ай бұрын
Thank you sir
@bagasafrizal82195 ай бұрын
can id use varchar? i merge two tables using varchar id but there is always no table content
@aopen1309 ай бұрын
my favorite joke related to SQL and database XKCD 327 Little Bobby TABLE
@branthebroken232310 ай бұрын
Where can i find the data you use in the starting of the video?
@kremznerg Жыл бұрын
It would be great, if you could upload the favorites.csv file to the Lecture Notes!
@davidjmalan Жыл бұрын
Done!
@MatheusHenrique-hu1cx Жыл бұрын
im trying to find this file
@pinakpaninath432111 ай бұрын
what is the logic behind row 1, why all the entries has come in answer?, this is column value right
@isaacbull-t6g3 ай бұрын
how can i get the shows database so i can work on the same problem set?
@javierdemendonca2573 ай бұрын
You are an argentinian and watching a lecture on computer science... suddenly a Messi picture shows up holding the world cup 🤩🤩🤩
@aopen1309 ай бұрын
oh david mentioned the bobby table :) at the end
@ksport1211 ай бұрын
we need some videos for networking
@abhisheknavgan6829 Жыл бұрын
i wonder wh y there are only 2 comments in such a informative video?
@ItzBusinessbhai Жыл бұрын
Because the matrix has attacked the minds of youth and made them into TIkTOK mind consuming dancing and shit videos and spending their life as a second class citizen as said by Top G !
@centipedekid9824 Жыл бұрын
@@ItzBusinessbhaiOr most people just don't know about this because Harvard doesn't advertise these videos. What makes more sense a psyop like mk ultra or poor advertisement.
@kremznerg Жыл бұрын
maybe because it was uploaded today?
@MooseGoWoof Жыл бұрын
@@ItzBusinessbhai Or maybe most people just watch through CS50 Video Player? That makes more sense then the matrix. I don't see much reason for people to go here anyways other than for timestamps.
@xuenf7 ай бұрын
The first 30 minutes would have been helpful for the last problem set dna
@rayedriasat811 ай бұрын
One question: at 2:06:24 Does python automatically insert the missing semi-colons at the end of sql commands? and also, I guess there shouldn't be semi-colon after db.execute() command as python doesn't need ( ; )
@reanimator911 ай бұрын
Hello, would love to know the music composer's name
@sankar_vj_11 ай бұрын
Hi Team, Can anyone teach about ETL concepts and how it works in real time project.
@sahilghuge53026 ай бұрын
48:02 GROUP BY
@ramnaresh_811 ай бұрын
what does code means in terminal when $ code favourites.csv is given in command line??
@jamespawson604510 ай бұрын
Code opens your file in the code editor
@cuongday90053 ай бұрын
Sorry, where can I find those databases ?
@konan91 Жыл бұрын
This year's SQL lecture is a lot easier to follow, which is convenient since I was halfway through the old one when it uploaded. I'm not sure about the new introduction though, the music choice is a little strange, I miss the old one
@enisten Жыл бұрын
Yeah, the same thing happened to me. I was watching the old one on SQL when the new set of lectures was uploaded. And I agree with you on both of your points!
@bert6774 Жыл бұрын
Show 62614:Zeg 'ns Aaa 😂 That's an old Dutch serie which my parents always watches
@polaris_babylon11 ай бұрын
That's great!
@domxgun7 ай бұрын
If they all teached like that I could get behind 100k degrees
@spht9ng6 ай бұрын
100k degree schools tend to have professors of this caliber yes.
@gathandi5531 Жыл бұрын
Where can i get Show.db file?
@Imagoofygoober422 ай бұрын
Intro music is 🔥🔥🔥 - ouch
@magicmaddox9 ай бұрын
DAVID
@muhammadnabeedhaider49267 ай бұрын
genre to show should be many to many as a genre can have multiple shows
@shafialanower3820 Жыл бұрын
Wait everything getting uploaded all at once? Nice
@vashisht111 ай бұрын
I know this already. But I still feel that I don't known anything. I am under valuing myself...please help sql interview seems very daunting
@jamespawson604510 ай бұрын
Yes, you are undervaluing yourself! Everyone feels like this with new material at some point. Just go back, watch it again, make some notes. Practice what he’a doing while you’re watching in the code editor they provide for free. You can also search out YT videos on the subject too. But don’t worry, we all feel like this at some point, it’s normal.