Learn PostgreSQL Tutorial - Full Course for Beginners

  Рет қаралды 2,658,472

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

Пікірлер: 2 000
@AmanSinghYT
@AmanSinghYT 5 жыл бұрын
⭐️ Contents ⭐️ ⌨️ (0:03:16) What is a Database ⌨️ (0:05:17) What is SQL And Relational Database ⌨️ (0:09:10) What is PostreSQL AKA Postrgres ⌨️ (0:10:53) PostgreSQL Installation (Mac OS) ⌨️ (0:14:21) PostgreSQL Installation (Windows) ⌨️ (0:17:38) GUI Clients vs Terminal/CMD Clients ⌨️ (0:21:39) Setup PSQL (MAC OS) ⌨️ (0:25:22) Setup PSQL (Windows) ⌨️ (0:30:15) How to Create Database ⌨️ (0:33:35) How to Connect to Databases ⌨️ (0:38:12) A Very Dangerous Command ⌨️ (0:41:37) How To Create Tables ⌨️ (0:45:46) Creating Tables Without Constraints ⌨️ (0:49:12) Creating Tables with Constraints ⌨️ (0:55:55) Insert Into ⌨️ (0:59:14) Insert Into Example ⌨️ (1:02:36) Generate 1000 Rows with Mockaroo ⌨️ (1:12:28) Select From ⌨️ (1:15:18) Order By ⌨️ (1:19:53) Distinct ⌨️ (1:21:59) Where Clause and AND ⌨️ (1:25:29) Comparison Operators ⌨️ (1:29:35) Limit, Offset & Fetch ⌨️ (1:32:43) IN ⌨️ (1:35:43) Between ⌨️ (1:37:45) Like And iLike ⌨️ (1:43:10) Group By ⌨️ (1:46:41) Group By Having ⌨️ (1:52:08) Adding New Table And Data Using Mockaroo ⌨️ (1:55:40) Calculating Min, Max & Average ⌨️ (1:59:48) Sum ⌨️ (2:01:55) Basics of Arithmetic Operators ⌨️ (2:05:59) Arithmetic Operators (ROUND) ⌨️ (2:09:43) Alias ⌨️ (2:12:32) Coalesce ⌨️ (2:16:15) NULLIF ⌨️ (2:20:21) Timestamps And Dates Course ⌨️ (2:23:21) Adding And Subtracting With Dates ⌨️ (2:25:58) Extracting Fields From Timestamp ⌨️ (2:27:28) Age Function ⌨️ (2:29:24) What Are Primary Keys ⌨️ (2:31:23) Understanding Primary Keys ⌨️ (2:36:26) Adding Primary Key ⌨️ (2:40:55) Unique Constraints ⌨️ (2:49:15) Check Constraints ⌨️ (2:54:45) How to Delete Records ⌨️ (3:01:36) How to Update Records ⌨️ (3:05:55) On Conflict Do Nothing ⌨️ (3:11:09) Upsert ⌨️ (3:16:41) What Is A Relationship/Foreign Keys ⌨️ (3:19:48) Adding Relationship Between Tables ⌨️ (3:25:04) Updating Foreign Keys Columns ⌨️ (3:29:30) Inner Joins ⌨️ (3:35:17) Left Joins ⌨️ (3:40:53) Deleting Records With Foreign Keys ⌨️ (3:47:27) Exporting Query Results to CSV ⌨️ (3:50:42) Serial & Sequences ⌨️ (3:57:18) Extensions ⌨️ (3:59:39) Understanding UUID Data Type ⌨️ (4:05:54) UUID As Primary Keys ⌨️ (4:16:30) Conclusion
@hejsjsi2449
@hejsjsi2449 2 жыл бұрын
THANKS
@mendylanda125
@mendylanda125 2 жыл бұрын
Thanks!
@sattasundertalukder1972
@sattasundertalukder1972 2 жыл бұрын
awesome man...Thanks a bunch.....
@abbiemorancie547
@abbiemorancie547 2 жыл бұрын
GREAT! THANKS MEHN
@venusbahrami2875
@venusbahrami2875 2 жыл бұрын
Thanks, can you send the link that he talks about it at 1:54?
@andrerangel7654
@andrerangel7654 5 жыл бұрын
Somebody give that man a medal!!
@zbigniewbrzezinski8869
@zbigniewbrzezinski8869 4 жыл бұрын
I will !
@smile-tk7yt
@smile-tk7yt 4 жыл бұрын
@@zbigniewbrzezinski8869 😅😂😅😂
@allanmachado2011
@allanmachado2011 4 жыл бұрын
big agree
@zes3813
@zes3813 4 жыл бұрын
wrr
@ouichoulhicham5726
@ouichoulhicham5726 3 жыл бұрын
i only have a cookie
@sewind6613
@sewind6613 2 жыл бұрын
That someone would take their time to make such a complete set of tutorials, and to make them available for free, is amazing. Words are not enough to express my gratitude, and my respect for you.
@Friend_2162
@Friend_2162 Жыл бұрын
I believe they were not free in the beginning. We can just appreciate they are free eventually after just 4 years :)
@calvinbarajas5144
@calvinbarajas5144 3 жыл бұрын
This lecture is amazing because (a) Nelson knows the exact technical terminology, (b) he is very patient and methodical, (c) covers the basics very well, (d) gives professional insight into how to use PostgreSQL.
@elco7956
@elco7956 2 жыл бұрын
**proceeds to call an asterisk a star**
@user-xw4mu6nz4t
@user-xw4mu6nz4t Жыл бұрын
@@elco7956 I've been a web developer for 7 years and I still do that.
@IceEnglish-ii7jv
@IceEnglish-ii7jv Жыл бұрын
​@@elco7956 asterisk AS star 😮
@electrolyteorb
@electrolyteorb Жыл бұрын
​@@elco7956 @IceEN Holy mother of GOD!!!!
@DZZYGaming
@DZZYGaming 7 ай бұрын
@@elco7956 imagine being overly critical because someone didnt say asterisk XD
@khateebanwer7466
@khateebanwer7466 3 жыл бұрын
For someone who is following this tutorial currently : 1) at around 01:06:00 when you go through the SQL file in VSCode , do change the value of varchar of gender greater than 20 because Mockaroo includes more than 2 genders in randomly generated database which will throw an error during its execution through cli when not changed. 2)When using terminal (for windows users ) , you might get errors during execution of sql file through cli due to path format which can easily be dealt with --> before even opening your postgres ,navigate through the command line where the actual file is located and then open postgres and use \i filename.extension to execute your file. 3)When installing postgres , always provide passwords without any alphanumeric characters like "$" otherwise it will throw an error during the installation phase ( I don't know what is that error as it was really vague but this worked for me).
@LooseFlannel
@LooseFlannel 3 жыл бұрын
just so you know you can also change the data Mockaroo gives, you can set it to only be male and female
@khateebanwer7466
@khateebanwer7466 2 жыл бұрын
@@LooseFlannel Thanks for the information , brother.
@MrMadmaggot
@MrMadmaggot 2 жыл бұрын
In ubuntu when I try to import the person.sql it denies me the permission.
@Technomic-o
@Technomic-o 2 жыл бұрын
Thanks man , can you please elaborate more on pointe 2 ? following the way mention on the video Im getting missing requirement error . i even went through the command line where the actual file is located and used \i filename.extension but still not able to execute it
@facundoarrascaeta3143
@facundoarrascaeta3143 2 жыл бұрын
@@Technomic-o I used i\ 'C:/Users/:myuser/Downloads/person.sql' on windows and it worked, you have to put the path in quotes
@АйдарХабиров-т3к
@АйдарХабиров-т3к 5 жыл бұрын
Thank You for using easy English. I understand a lot of. Respect from Russia with 41 peoples.
@nyteskun
@nyteskun 4 жыл бұрын
41+1
@sergeyvechkitov221
@sergeyvechkitov221 4 жыл бұрын
+1
@WeirdAlSuperFan
@WeirdAlSuperFan 4 жыл бұрын
just fyi this guy's English is terrible, but hey at least it's simple
@АлексейДогачев
@АлексейДогачев 4 жыл бұрын
@nabil libre just racist up there
@diegodelsol1309
@diegodelsol1309 4 жыл бұрын
@@WeirdAlSuperFan How so? He is speaking slowly and clearly and obviously has a good grasp of the concepts.
@gunk4196
@gunk4196 2 жыл бұрын
The fact that this is free is insane! A very good course on Postgres. I finished this in less than 24 hours and before starting I didn't even know what 'SQL' was but now I feel like I have a solid understanding of Postgres.
@richumathew7352
@richumathew7352 8 ай бұрын
Also train and make project before you forget
@O_o___o_0
@O_o___o_0 2 жыл бұрын
First thank you so much for this amazing course, easy to follow and straight to the point For those like me that will be learning on PostgreSQL 14, at 33:50 he uses the command psql --help for the option help and on Windows and PSQL 14 it's actually the \? options command that will give you the same result.
@SamareshMaity231
@SamareshMaity231 2 жыл бұрын
thanks Johan
@olamideadigun9206
@olamideadigun9206 2 жыл бұрын
So many things have changed with mockaroo too. My Gender column has 8 inputs so you don't have to add Hello to practice CHECK CONSTRAINT.
@SHrehman12
@SHrehman12 2 жыл бұрын
OMG, Thank you
@kalamansihans
@kalamansihans 2 жыл бұрын
thanks! I didn't notice this helpful comment. Anyway another work around I found for this is to go to the directory of the bin folder and enter psql --help. It works the same.
@ady4230
@ady4230 2 жыл бұрын
Thanks man
@niyazi95
@niyazi95 3 жыл бұрын
33:39 guys if you cant run "psql" command in the command line, you must add it to system environments, find the postgresql folder in C:\ and add its "bin" folder to "Path" variable in the env.
@divakarsiva623
@divakarsiva623 3 жыл бұрын
@Niyazi Yildirim can u explain in detail....since many of us have the same problem
@mergenberdiyev8438
@mergenberdiyev8438 3 жыл бұрын
@@divakarsiva623 Maybe it's already late, but here is a video how to do that kzbin.info/www/bejne/ZnalnImwfqehpcU&ab_channel=jinujawadm
@arpansingh4284
@arpansingh4284 3 жыл бұрын
@@mergenberdiyev8438 Nope , its never late . Thanks !
@billyssk666
@billyssk666 3 жыл бұрын
@@mergenberdiyev8438 This tutorial doesn't work with version 14. There is no "bin" folder with the psql.exe file. Anyone have another fix?
@yatskovych
@yatskovych 3 жыл бұрын
@@billyssk666 worked just fine for me (version 14.1). Maybe you didn't see bin folder of psql.exe file
@alexnavarro2628
@alexnavarro2628 2 жыл бұрын
Seriously a 10/10 course! I sat down and watched this whole thing in a single session. I seriously appreciate your teaching style, and how well you explained everything. Thank you!
@madhanmurali4877
@madhanmurali4877 5 жыл бұрын
Completed till WHERE Clause and you're getting straight to the point without wasting time. It is really helpful for a complete newbie like me. Thank you!
@chamchamchaam
@chamchamchaam 2 ай бұрын
Your are an excellent teacher, I understand everything fully and I've actually sat through this 4 hour lecture for 9 hours. 9 hours included breaks and lunch/dinner.
@gwagner3446
@gwagner3446 5 жыл бұрын
Dude, this course was VERY GOOD! Basically binged through the whole 4 hours and felt like no time! Very didactic and well explained. THANK YOU SO MUCH FOR THIS AMAZING CONTENT!!
@kieranbarker1902
@kieranbarker1902 3 жыл бұрын
This video is excellent. I'm only as far as creating tables (around the 41-minute mark) but it's already better than the courses I could find on Udemy! Thank you! 🙏
@coderart__2802
@coderart__2802 2 жыл бұрын
Thanks
@TheAremoh
@TheAremoh 5 жыл бұрын
From being scared to run sql command from command line to liking it. Thanks for this awesome video
@Terzaghi12
@Terzaghi12 4 жыл бұрын
For Windows users, the command 'psql' only will work if you edit the environment variables and add 'C:\Program Files\PostgreSQL\13\bin' to your path, the 13 it's the version of Postgres i've installed. After that, the command you have to enter on the cmd or powershell is: psql -U postgres then it will ask for the password you set on the installation
@karljasoncangas8525
@karljasoncangas8525 Жыл бұрын
thanks Capt.
@anwinkon242
@anwinkon242 Жыл бұрын
thanks this really worked for me
@manisha_nair
@manisha_nair Жыл бұрын
Thanks a lot man!
@nikethvelala5424
@nikethvelala5424 Жыл бұрын
Thank you 🫡
@sirhuman560
@sirhuman560 10 ай бұрын
Thank you brotherrr :))
@chriswilson8584
@chriswilson8584 5 жыл бұрын
The best PostgresQL tutorial I've seen so far.
@SoupEmperor
@SoupEmperor 24 күн бұрын
You're incredible man, a 4 hour course for everyone to use completely free. These are valuable, increasingly rare vestiges of the web where knowledge is shared freely.
@fahansheikh
@fahansheikh 2 жыл бұрын
for user using ubuntu/linux(check if postgres is preinstalled in your system) following the installation steps may cause installation of two versions of postgres simultaneously which can cause unnecessary trouble for beginners.
@LordBenjamin1998
@LordBenjamin1998 5 жыл бұрын
One of the best tutorials out here for PostgreSQL, the explanation is clear and the pace of it is great for beginners. Props to you.
@TonnySanjiao
@TonnySanjiao 5 жыл бұрын
Great work man. Thank you from Barcelona. I like your voice, it's very clear to understand to non English-speaking like me.
@yunjiehong4649
@yunjiehong4649 5 жыл бұрын
Really clear accent! Easy to understand. Thank u, bro.
@maaxmith
@maaxmith 4 жыл бұрын
To anyone getting an error when using the psql command in Windows Terminal: You need to add "psql" to your system path variables: - In the search bar, type "env" and click on "Edit the system environment variables" - Click on "Environment Variables" - Then, in the "System Variables" table, click on the column with the Variable name "Path" and then click on "Edit" - Click on "New" and paste the path to the "bin" folder of your psql installation. E.g. in my case, its "C:\Program Files\PostgreSQL\13\bin", but it could be different based on where you installed PostgreSQL or what version you have. Now restart the Console, and the command should work.
@BexruzXolmuminov
@BexruzXolmuminov 4 жыл бұрын
thank you man.
@afunnykorean
@afunnykorean 4 жыл бұрын
Im getting this prompt after I have typed "psql" Password for user "****": (Note "****" is my folder path, that looks like this when i open command prompt-> C:\Users\"****">) When i enter my postgressql database password, it says psql: error: FATAL: password authentication failed for user "****" My postgressql username is set to default, and not "****". Any idea what is causing this?
@afunnykorean
@afunnykorean 4 жыл бұрын
I figured it out, you have to type: psql -U 'userName'
@maaxmith
@maaxmith 4 жыл бұрын
@@afunnykorean or "psql -U postgres". I actually don't know the cause of that bug, but its at least easy to fix :)
@elBanananas
@elBanananas Жыл бұрын
this should be top comment.
@stalinengoma7680
@stalinengoma7680 3 жыл бұрын
Very comprehensive video. I didn’t know about any database before and this man just plugged everything I needed to know how databases work. Thank you man
@adamrolczyk7217
@adamrolczyk7217 3 жыл бұрын
It was my long long dream to learn Postgres. I watched the entire video almost in one sitting, making notes in vscode and using commands in terminal. Thank you so much for sharing this knowledge. Can't wait to use it to build something cool.
@sadramohh
@sadramohh 2 жыл бұрын
Can we maybe have the notes? pretty please?
@franciscojavierramirezhern8588
@franciscojavierramirezhern8588 5 жыл бұрын
I had a lot of extra work trying to follow some parts of this awesome course, the difference between MacOS and Windows are tinny, but important, when you try to import file using \i you must have to use '/' not '\' and other differences that I had to search on google and stack, but finally.... Thanks for sharing this course, I appreciate this. I heard something that bad MySql settings are so dangerous and complicate to fix and protect from SQL injection, so, he said PostgreSQL is more secure and flexible, but I just looking for answers. Anyway, nice work! greetings!
@yepyepyep3
@yepyepyep3 4 жыл бұрын
thanks! needed help with that exact part
@Nephros
@Nephros 3 жыл бұрын
Thanks a lot
@tunmbi_okediran
@tunmbi_okediran 11 ай бұрын
Yeah, thanks a bunch
@gourishaverma8740
@gourishaverma8740 3 ай бұрын
it did not work for me
@John-fd9fe
@John-fd9fe 3 жыл бұрын
I love the fact that we have timestamps. I already knew a lot of SQL, I just needed to learn PostgreSQL and I could skip a lot of the lessons. Thank you very much.
@TubeSwarn
@TubeSwarn 4 жыл бұрын
The teacher's pace is just awesome!! He is the best teacher in the world.
@richard1991ish
@richard1991ish 6 ай бұрын
also just going to take a moment to appreciate how excellent this tutorial is. Clear, concise, straight to the point with real-world examples. Worked through the whole thing, and learned a TON. TYSM! ⭐⭐⭐⭐⭐
@Ervin66672
@Ervin66672 2 жыл бұрын
Thanks!
@banisan2035
@banisan2035 3 жыл бұрын
Thank you so much for this tutorial! It always fills me with joy when so much effort is put into something that simply benefits everyone without expecting anything in return. So much wholesome altruism in the IT community.
@ugljesavojvodic3384
@ugljesavojvodic3384 4 жыл бұрын
For Windows users it's even easier, even though it seems to be confusing, just enter database name when it ask for it. This how it looks in the shell: - Server [localhost]: Database [postgres]: test Port [5433]: Username [postgres]: Password for user postgres:your_pw - Please note when you connect for the first time you are actually connect to default one and that's why you don't enter any name, it will have name"postgres", and the owner is also default one, guess the name - "postgres". - When you login with all empty parameters you noted line in terminal like "postgres=#", well the part before "=#" is actually name of database, so in this default case "postgres". - You noted he has owner "amigoscode" (when he list all databases) , it's actually added role, check postgres documentation how to add role and change owner of table. - Also, when you are in "postgres=#" database you can easily switch to another (that is already created, it won't create it by itself) database using command: \c another_database_name (example: "postgres=# \c test" result: "test=#")
@pranayreddy7303
@pranayreddy7303 4 жыл бұрын
thank u its really helpful could u please tell me how to clear the terminal
@ugljesavojvodic3384
@ugljesavojvodic3384 4 жыл бұрын
​@@pranayreddy7303 Actually I never clear terminal, no matter of what I am working on :) Try with \! clear Usually I just hit enter few times... :D Be aware of using ; at the end of sequence... It's mentioned in this tutorial. But during login to database, I'm not sure how can it be cleared...
@yatskovych
@yatskovych 3 жыл бұрын
thanks so much! I was confused about switching to another DB, so I went to the comments. You rock
@ugljesavojvodic3384
@ugljesavojvodic3384 3 жыл бұрын
@@yatskovych I'm glad to se it is helpful 👍 Thank for feedback.
@O_o___o_0
@O_o___o_0 2 жыл бұрын
@@ugljesavojvodic3384 Man, thank you soooooo much! I ended up stuck with that yesterday and you made my day this morning 🤘🙏
@m.alisetiapratama6932
@m.alisetiapratama6932 5 жыл бұрын
What a timing! Just in time when I want to learn it. Appreciate it a lot guys!
@Lampalot
@Lampalot 2 жыл бұрын
MashAllah brother such an amazing course, May Allah give you jannah !
@DEwithDhairy
@DEwithDhairy Жыл бұрын
Postgresql Interview Questions And Answers: kzbin.info/aero/PLqGLh1jt697xtgiGwGUTFpOctT82ANdJZ&si=MdIpypaVnxU13_XK
@OladipupoPopoola
@OladipupoPopoola 5 жыл бұрын
Wow! I just finished this course and I must confess you took me from a noob to an intermediate pro. Thank you so much. but I can't fid your other courses.....please share link in reply. I really appreciate. God bless you bro.
@michaelvigato3228
@michaelvigato3228 5 жыл бұрын
Boi this is excellent, it's really hard to believe this is free
@manishseal8990
@manishseal8990 3 жыл бұрын
For 1:09:04, for windows user, type in the following command \i 'C:\\Users\\your_name\\Downloads\\person.sql'. (Take note of the double slashes and apostrophes)
@gauravupadhyay6602
@gauravupadhyay6602 2 жыл бұрын
I was stuck here, thanks a lot :)
@vedanttiwari2961
@vedanttiwari2961 Жыл бұрын
Thanks a lot, i was this close to give up but you saved me.
@roardinoson7
@roardinoson7 4 ай бұрын
or invert the slashes
@adeyemoemmanuel5082
@adeyemoemmanuel5082 Ай бұрын
Pls I dint get this.....what should be in my name, amd what's the user's??
@kasperkat2004
@kasperkat2004 3 жыл бұрын
Nelson, you outdid yourself with this! I am using Windows and psql and it works. There are no problems with it. But I have been using command lines/terminals for years. Thanks again Lad.
@mythic414
@mythic414 3 жыл бұрын
Thank you for this video! You're a great teacher and the material was clear and straight to the point. Definitely one of the best online courses i've come across
@harlanreece2348
@harlanreece2348 3 жыл бұрын
I am reaching out to you because your post appears to be the most recent. I have a basic question that you may be able to answer. No luck reaching Nelson.
@random-0
@random-0 Жыл бұрын
@@harlanreece2348 you should have asked the doubt directly in the comment
@Ou8y2k2
@Ou8y2k2 5 жыл бұрын
1:21:60 should be 1:21:59 in the description. Thanks for the course.
@krzysztoflechowski81
@krzysztoflechowski81 5 жыл бұрын
you are great, I wish your tutorial was there when I started my SQL journey 15 years ago.
@kirollosmagdy275
@kirollosmagdy275 5 жыл бұрын
does it mean that after 15 years of experience , you're still looking for tutorials ? , omg what scary future do we juniors have 😅
@krzysztoflechowski81
@krzysztoflechowski81 5 жыл бұрын
@@kirollosmagdy275 you'll allways be learning as there's more to know, not that scary these days. I haven't worked on PG as much as on other databases. I knew it was great, but haven't had a chance in my projects. The more I appreciate how effective the author made it here.
@kjane3390
@kjane3390 4 жыл бұрын
I am only 8.42 minutes through and I already felt the urge to thank you for such an incredible video. I have a terrible attention span and I am genuinely excited for what the next 4 hours will bring. Thank you thank you thank you!!!!!
@user-xw4mu6nz4t
@user-xw4mu6nz4t Жыл бұрын
Legend has it Mr. Terrible-Attention-Span still hasn't finished the video,
@abdikhaliqmohamoud3373
@abdikhaliqmohamoud3373 2 жыл бұрын
The best and complete PostgreSQL Course out there.
@mauroavellaneda9019
@mauroavellaneda9019 3 жыл бұрын
Minute 24:57: To be able to write in bash profile or like in this case, zshrc, after you open the text editor, you need to type "i" to start typing. Another way of saving it is, when you finish what you need to type, press scape and then Shift + z + z. (two times "z")
@sarathradhakrishnan2135
@sarathradhakrishnan2135 3 жыл бұрын
I must admit, this is way more better than some Udemy courses.
@reynaldlamury4772
@reynaldlamury4772 3 жыл бұрын
there is also good course about postgreSQL there in udemy from Jose Portilla if iam not mistaken
@brian1801
@brian1801 3 жыл бұрын
Nelson -- quite simply -- YOU ROCK!!! Seriously outstanding content, videos and presentation skills. Thank you for taking the time to create this awesome course. Wishing you nothing but the greatest success!
@StarBattle08
@StarBattle08 4 жыл бұрын
1:53:33 Make sure the currency is set to none, otherwise it won't work if you use numeric for the type for the price
@babichilakalapudi9759
@babichilakalapudi9759 4 жыл бұрын
Literally beating my head for 1hr. Bro .. you saved me ! Tq
@rgraptor2542
@rgraptor2542 8 ай бұрын
thank you tons friend.
@ciscogopro8481
@ciscogopro8481 2 жыл бұрын
Thank you Nelson, I went through the whole video and for the first time after so many tutorial finally I understood and learn about database and Postgres. Thank you do much for make easy for newbies.
@vladimiraleksic4066
@vladimiraleksic4066 10 ай бұрын
Great job. I am enrolled in the Code Institute online boot camp and the tutorials there cannot be compared with this material in terms of quality. Thank you a lot.
@arvi8843
@arvi8843 4 жыл бұрын
Thank you so much for congratulating me by the end of this video for finishing this course. I learned a lot! 💯 💯 💯
@leondaz
@leondaz 4 жыл бұрын
If you're having trouble in AVG, use this "SELECT AVG(price::money::numeric) from car;" and this basically casts the VARCHAR money to Money (adds commas every 3 numbers) and casts the result to a number (decimal) as numeric is an alias for decimal in postgreSQL.
@HologramJay
@HologramJay 2 жыл бұрын
Nice. Thank you!
@gideonrichards1862
@gideonrichards1862 3 жыл бұрын
Thanks you this was a really helpful course, even as we are now on 13.2. A couple of comments to aid the user of the tutorial, if I may: 1) Please can you explain at the beginning how to get back to the =# prompt - I struggled on the Mac because the ctrl is ctrl button and not cmd button; 2) Please can you explain how you clear the screen at the beginning of the tutorial; 3) Please can yous tree at the beginning how important accurate typing is for the student; 4) Please can you ensure when you are using a comma and not a dot (e.g. NUMERIC(19, 2)) that that is clear. I did miss that. Apart from that this has really helped me and I would recommend it to anyone doing PostgreSQL as a beginner. I will look up the longer more advance course! Kind Regards Gideon
@itsReshad
@itsReshad 3 жыл бұрын
I cant believe the quality of content and explanation in this video. Brilliant course explaining PostgreSQL. Very easy to follow - Highly recommend it!
@SharinganCrypto
@SharinganCrypto 2 жыл бұрын
reference: 21:50 connect to postgres 50:35 create table 1:05:28 creating 1000 rows (import) 1:06:44 loading sql file in editor 1:07:50 \i file 1:15:23 order by 1:55:49 min, max, avg 2:27:33 age function
@dalvandi
@dalvandi 3 жыл бұрын
Tutorial really gets down to the basics and is a really good starting point for beginners like myself with no previous experience with databases! Especially cool that you covered the installation for both MacOS and Windows!
@xilllllix
@xilllllix 3 жыл бұрын
indeed! what a great teacher and lecture! i feel like i can do whatever i want now with Postgres...
@ВладимирАдамчук-в6ы
@ВладимирАдамчук-в6ы 5 жыл бұрын
Thanks from Russia. Great tutorial!
@vs4vijay
@vs4vijay 5 жыл бұрын
Very Informative!!! Watched the whole video in 1.25x speed. I would suggest to walk us through on TRIGGERS, VIEWS, INDEXING, TRANSACTIONS and JSON data handling.
@smyasir0
@smyasir0 5 жыл бұрын
good suggestion Soni ! you know any tutorials regarding these ?
@kokoyoke2775
@kokoyoke2775 3 жыл бұрын
Working as an oracle dba, even non IT employees could use this db. This is really help me to learn postgres, respect sir!!!
@timothyajani7100
@timothyajani7100 5 ай бұрын
Finally I've faced my Fears. This is the best database course ever. I'll be done with the course today. I never knew database could be this easy. I'm so happy
@Ian69885
@Ian69885 5 жыл бұрын
I can not thank you enough. you explain the subject way better than my lecturer
@diegopiscoya4318
@diegopiscoya4318 5 жыл бұрын
Lmao that seems to be a really recurrent event in cs matters
@shahman1
@shahman1 5 жыл бұрын
@@diegopiscoya4318 its true, surprisingly or unsurprisingly
@banisan2035
@banisan2035 3 жыл бұрын
Hey everyone. For windows users on the mockaroo section: I encountered some problems importing the .sql file. Apparently psql doesn't accept the common backslashes \ that are used for paths on windows. So you need to use forward slashes / like on linux or mac. So for example, here's what I typed in psql: \i C:/Users/MyName/Desktop/person.sql
@olamideadigun9206
@olamideadigun9206 2 жыл бұрын
I am stuck with "No such file or directory".
@Adivasi7777
@Adivasi7777 2 жыл бұрын
@@olamideadigun9206 \i 'C:/wherever_you_downloaded_it/person.sql' ......Don't forget the single apostrophe...
@rezafadillah5129
@rezafadillah5129 2 жыл бұрын
@@Adivasi7777 thank you bro
@rezafadillah5129
@rezafadillah5129 2 жыл бұрын
thank you for the information
@hrishavdeka4187
@hrishavdeka4187 2 жыл бұрын
thanks a lot I was stuck here for so long
@notsoaverageraj7917
@notsoaverageraj7917 3 жыл бұрын
2:16:57 : "I have 10 apples and I want to divide it with 0 people" That totally makes sense as it sounds like my sibling.
@johnwick-m4m
@johnwick-m4m 3 жыл бұрын
LOL
@gustavoadolfogrisalesmonto1910
@gustavoadolfogrisalesmonto1910 2 жыл бұрын
@@johnwick-m4m at least you (one person)
@shashanksingh4968
@shashanksingh4968 2 жыл бұрын
This is an awesome go to guide for learning Postgres SQL DB for an absolute beginner, you can get your SQL refreshed also along the way. I learnt a lot along the way, though the course is bit outdated for November 2022, have some execution errors for the queries shown in videos, but thanks to people in comment section who become savior and help the fellows out along the way. Happy Learning team. Let's code something! ❤❤
@mgultas
@mgultas 3 жыл бұрын
This video is one of the best SQL and PostgreSQL intro videos that I have come across. Thanks.
@michaelvigato3228
@michaelvigato3228 5 жыл бұрын
50:35 Isn't a PRIMARY KEY attribute automatically also NOT NULL?
@panther-xc8929
@panther-xc8929 4 жыл бұрын
Correct! Primary key columns cannot have NULL values, so it's pointless to define it there
@mahdipakravan676
@mahdipakravan676 4 жыл бұрын
Actually , Not Null is unuseful command for primary
@Getaneh188
@Getaneh188 4 жыл бұрын
Yes, primary key is not null and unique
@shimanshuyadav5654
@shimanshuyadav5654 2 жыл бұрын
thanks bro even I had this doubt
@rohitdalal954
@rohitdalal954 4 жыл бұрын
If you are on Windows, to insert the data using Mockaroo: \i 'C:\\INSERT\\YOUR\\PATH\\HERE'; What a great tutorial this is. A simple and clear explanation. Thank you so much ;)
@TechZuppo
@TechZuppo 4 жыл бұрын
G.O.A.T.
@pranayreddy7303
@pranayreddy7303 4 жыл бұрын
atill i cant open the .sql file in terminal
@Dineshsharma-ec6ys
@Dineshsharma-ec6ys 4 жыл бұрын
I got permission denied error help me out
@rohitdalal954
@rohitdalal954 4 жыл бұрын
@@Dineshsharma-ec6ys Try to use single quote 'path' for the file path.
@adeyemiblessing
@adeyemiblessing 2 жыл бұрын
Thanks a lot for this. Just saved me from fraustration
@BigSmoke-r9w
@BigSmoke-r9w 6 ай бұрын
Finished this in 3 days! Thank you good sir
@BigSmoke-r9w
@BigSmoke-r9w 5 ай бұрын
Came back in this video to practice, thanks again!
@elijahdare9826
@elijahdare9826 5 ай бұрын
@@BigSmoke-r9wNice one
@martinpenchev2263
@martinpenchev2263 4 жыл бұрын
NOT all HEROES wear CAPES, but this guys in not hero, he is a legend, A LEGEND, thanks man !
@rohankapur5776
@rohankapur5776 3 жыл бұрын
wonderful course. I'm ditching nosql dbs for postgres permanently after this. thank you
@prometheus8457
@prometheus8457 2 жыл бұрын
To those on Windows, to clear the screen, run "\! clear" or "\! cls". Hope this helps.
@az-ni7hc
@az-ni7hc 2 жыл бұрын
Awesome. Thanks a lot
@johnboscoobi4529
@johnboscoobi4529 Ай бұрын
Thanks a lot. But how does he do it that the result of the query gets cleared, leaving only the queries (codes) behind.
@ruixue6955
@ruixue6955 2 жыл бұрын
19:59 client 20:53 Postico 22:24 client in terminal: psql 22:32 *-p* for the port 25:58 connect to db with psql
@ianawilsonn
@ianawilsonn Жыл бұрын
Halfway through, and it's a great course so far. Some of the material is a little dated, as Postgresql has made some changes as they are at version 15+. For example: Postgresql uses "SELECT factorial(5);" now instead of "SELECT 5!;" to get the factorial of 5. Might be time for an updated course.
@anandakumarsanthinathan4740
@anandakumarsanthinathan4740 3 жыл бұрын
AT 2:03:39, SELECT 10 / 2 gives a result of 5. If we are to try SELECT 10 / 4, it would give the answer as 2, and not 2.5. This is because of the way computers work. An integer divided by an integer will always yield an integer. On the other hand, if you are to type-in SELECT 10.0 / 4, then you would get the right answer 2.5, because in this case the numerator is not an integer any more and is a fractional decimal number. And so the answer given out is also a fractional decimal number.
@alexandrspiridonov9569
@alexandrspiridonov9569 3 жыл бұрын
It is not the first PostgreSQL tutorial I watch, but this one is the best. Thank you)))))
@seannagle1714
@seannagle1714 2 жыл бұрын
This is fantastic, and I am learning a lot. It is nice to have someone who takes it slow and allows you to follow through the command line perspective. Very helpful. One thing I think might be a mistake, or correct me if I am confused, but around 1:19:00 you give an example of "SELECT * FROM person ORDER BY id, email". I am pretty sure that SQL never gets to sorting by email considering the first item it is sorting by is a primary key. Am I right there? You make reference to the emails all starting with a at the top, but that must just be coincidental, no? Thanks a million for this video, and I look forward to finishing it and recommending it to anyone who wants to learn SQL!
@hokage97531
@hokage97531 4 жыл бұрын
I'm at 35:00, using windows and bversion 12 of PostgresQL, and the commands seem completely different. first off I get a prompt that says "(database name)=#", rather than the ~ he gets, second, the --h commans isnt working. I'm typing in "help" to get commands, and it says \h for sql help, and \? for psql help. I typed in \? assuming it would show me the same PSQL help it shows on the video, but it shows a completely different set of commands, al starting with \ instead of with --. I haven't watched the rest of the video, but so far it seems like it's different for windows. I hope not. EDIT: I did manage to do the rest of the tutorial without problems, it works on windows aswell, I just skipped this step in particular. Wonderful tutorial. However I'm having trouble trying to add a NOT NULL constraint to an already created row. Is this possible? I'm using " ALTER TABLE person MODIFY name VARCHAR(30) NOT NULL; " and it says there's a syntax error around modify. Any help?
@Naveenkashyap243
@Naveenkashyap243 4 жыл бұрын
do 'ALTER TABLE person ALTER COUMN name SET VARCHAR(30) NOT NULL;' this might help
@darkdraconium
@darkdraconium 4 жыл бұрын
Thank you for including this top bit, when it got to this point in the video I was dreading that this video might have already gotten out dated as I'm also working with 12 myself.
@tejasparekh6808
@tejasparekh6808 4 жыл бұрын
Amazing explanation man!!! you just made my lockdown fruitful....thanks a lot.
@gouravgoel2974
@gouravgoel2974 4 жыл бұрын
great
@mmkamalraj8931
@mmkamalraj8931 2 жыл бұрын
End to End Postgres. Starting with SELECT * to JOINS in the same methodical explanation. Best vid to learn and practice postgres.
@melanieprevot4926
@melanieprevot4926 Жыл бұрын
Definitely the best psql tutorial for beginners i have ever seen ! Thank you sir.
@shivangchaturvedi237
@shivangchaturvedi237 Жыл бұрын
One update for 2:04:24 : SELECT 100!; gives an error. So alternatively, one can use SELECT FACTORIAL(4); to get the answer. Give a 👍 if this helped you.
@scienceofart9121
@scienceofart9121 5 жыл бұрын
I'm only in the 20th minute but I liked this tutorial soo much, Thanks man !
@inventaunmanana4860
@inventaunmanana4860 3 жыл бұрын
In 1:57:00 you might not be able to calculate the average of the price column. This happens if you generated the table using the dollar sign on the price. The solution I found is: cast price to a text, replace the '$' by nothing (' '), and cast back to numeric: SELECT AVG(REGEXP_REPLACE(price::text, '[$,]', '', 'g')::numeric) from car;
@venusbahrami2875
@venusbahrami2875 2 жыл бұрын
can you say where we should use it?
@olakunleoluwatobi3054
@olakunleoluwatobi3054 Жыл бұрын
Thanks, it worked.
@rgraptor2542
@rgraptor2542 8 ай бұрын
This dollar sign also can cause an error, "invalid input syntax for type numeric", another way to fix if you don't want to regenerate the data is to go into the vscode file and highlight one of the dollar signs and ctrl+shift+L which should select every dollar sign then delete them and save it. edit: or someone else says you can switch the data type in the file from NUMERIC to MONEY
@ladibakare7794
@ladibakare7794 2 ай бұрын
@@rgraptor2542 Many thanks for your comment. Deleting the dollar sign worked for me.
@homemadebymiko
@homemadebymiko 4 ай бұрын
Absolute Gold! Thank you so much - Great content to follow from absolute beginner to being comfortable. This definitely gave me the foundation I need to explore PostgreSQL documentation & terminal on my own.
@laurscode5778
@laurscode5778 3 жыл бұрын
So I usually don't like tutorials but this one was really cool and the author really know what he is teaching about. Explained in a really easy way so everybody will understand that)
@anton.m.korshunov
@anton.m.korshunov 5 жыл бұрын
My applause to the speaker! Enough deep and straightforward material at the same time!
@EuanFR
@EuanFR 2 жыл бұрын
Really good, for beginners or as a refresher to prepare interviews. Just a small improvement that could be made: I was especting a chapter to explain (summarize) the differents types of alter table queries (ie ADD, DROP, MODIFY, CHANGE). It would be an honor to help you providing a french version of these courses.
@КатяПетриковская
@КатяПетриковская 2 жыл бұрын
Thank you so much! Such a great job you've did. Wish you all the best and inspiration to learning people. Thank you again!
@omyeole7221
@omyeole7221 8 күн бұрын
Thank you Amigo and free code camp for such amazing course on PostgreSQL. You made me learn many things about SQL. Before I didn't even know anything about SQL but now after completing this course I have learnt lot of things and I can integrate this with django. Thank You.
@ihorrud5088
@ihorrud5088 Жыл бұрын
The best tutorial I've ever seen for PostgreSQL!
@henrikflindt3086
@henrikflindt3086 5 жыл бұрын
These 4 hours was better than 15 + lecturers
@anandkulkarni6992
@anandkulkarni6992 3 жыл бұрын
For those who are wondering where to run "psql" --> Run it in command prompt If it says 'psql' is not recognized as an internal or external command, operable program, or batch file. Set the path in an environment variable (kzbin.info/www/bejne/ZnalnImwfqehpcU) and run the command "psql -U postgres" in command prompt and enter your password
@yatskovych
@yatskovych 3 жыл бұрын
Thank you! I tried simply running the command "psql", without "-U postgres", but it didn't accept my password. Thanks to you, I now realize that one needs to state the user by using -U
@tejaltelang3558
@tejaltelang3558 2 жыл бұрын
Thank you very much!! I ran into the same problem and was looking for solution!
@venusbahrami2875
@venusbahrami2875 2 жыл бұрын
I am trying to get the data that Nelson is referring to in the "Adding Relationship Between Tables" chapter. Can anyone help me find it?
@windows99
@windows99 2 жыл бұрын
What exactly is environment variable? Description to me looks like a background app, not a variable.
@varshamane2374
@varshamane2374 Жыл бұрын
Thanks for your help .😊
@vandergaming8952
@vandergaming8952 2 жыл бұрын
There is a problem with the new Mockaroo options. You have to have a currency infront of the NUMERIC value, which creates a problem when importing the file into a terminal (at least in windows). you'd have to use Studio Code, Edit > Repalce > Find $ (whatever currency) and leave the replace with what as blank. Hold down enter until it replaced every line. Save and import.
@wOhtest
@wOhtest 2 жыл бұрын
Thanks. Same thing on MAC. You literally save my dawn studying. Lol
@mitchelldirt
@mitchelldirt 2 жыл бұрын
Alternatively you can change the data type to MONEY :) EDIT: You'll need to specify how you want to average your money type by doing AVG(price::numeric) NOTE: To output a factorial you'll need to use factorial(number) if using postgres >= 14
@samuelsunday9965
@samuelsunday9965 Жыл бұрын
thank so much. I was stuck here before i saw your comment.
@smooth6159
@smooth6159 2 жыл бұрын
by Learn with Aman ⭐ Contents ⭐ ⌨ (0:03:16) What is a Database ⌨ (0:05:17) What is SQL And Relational Database ⌨ (0:09:10) What is PostreSQL AKA Postrgres ⌨ (0:10:53) PostgreSQL Installation (Mac OS) ⌨ (0:14:21) PostgreSQL Installation (Windows) ⌨ (0:17:38) GUI Clients vs Terminal/CMD Clients ⌨ (0:21:39) Setup PSQL (MAC OS) ⌨ (0:25:22) Setup PSQL (Windows) ⌨ (0:30:15) How to Create Database ⌨ (0:33:35) How to Connect to Databases ⌨ (0:38:12) A Very Dangerous Command ⌨ (0:41:37) How To Create Tables ⌨ (0:45:46) Creating Tables Without Constraints ⌨ (0:49:12) Creating Tables with Constraints ⌨ (0:55:55) Insert Into ⌨ (0:59:14) Insert Into Example ⌨ (1:02:36) Generate 1000 Rows with Mockaroo ⌨ (1:12:28) Select From ⌨ (1:15:18) Order By ⌨ (1:19:53) Distinct ⌨ (1:21:59) Where Clause and AND ⌨ (1:25:29) Comparison Operators ⌨ (1:29:35) Limit, Offset & Fetch ⌨ (1:32:43) IN ⌨ (1:35:43) Between ⌨ (1:37:45) Like And iLike ⌨ (1:43:10) Group By ⌨ (1:46:41) Group By Having ⌨ (1:52:08) Adding New Table And Data Using Mockaroo ⌨ (1:55:40) Calculating Min, Max & Average ⌨ (1:59:48) Sum ⌨ (2:01:55) Basics of Arithmetic Operators ⌨ (2:05:59) Arithmetic Operators (ROUND) ⌨ (2:09:43) Alias ⌨ (2:12:32) Coalesce ⌨ (2:16:15) NULLIF ⌨ (2:20:21) Timestamps And Dates Course ⌨ (2:23:21) Adding And Subtracting With Dates ⌨ (2:25:58) Extracting Fields From Timestamp ⌨ (2:27:28) Age Function ⌨ (2:29:24) What Are Primary Keys ⌨ (2:31:23) Understanding Primary Keys ⌨ (2:36:26) Adding Primary Key ⌨ (2:40:55) Unique Constraints ⌨ (2:49:15) Check Constraints ⌨ (2:54:45) How to Delete Records ⌨ (3:01:36) How to Update Records ⌨ (3:05:55) On Conflict Do Nothing ⌨ (3:11:09) Upsert ⌨ (3:16:41) What Is A Relationship/Foreign Keys ⌨ (3:19:48) Adding Relationship Between Tables ⌨ (3:25:04) Updating Foreign Keys Columns ⌨ (3:29:30) Inner Joins ⌨ (3:35:17) Left Joins ⌨ (3:40:53) Deleting Records With Foreign Keys ⌨ (3:47:27) Exporting Query Results to CSV ⌨ (3:50:42) Serial & Sequences ⌨ (3:57:18) Extensions ⌨ (3:59:39) Understanding UUID Data Type ⌨ (4:05:54) UUID As Primary Keys ⌨ (4:16:30) Conclusion
@danielnadar75
@danielnadar75 2 жыл бұрын
This is one of the best SQL course out there for FREE!!! I can't praise enough of this course and the instructor, I always feared SQL until I took this course and I can now call myself a SQL pro! Thanks Nelson for this amazing course.
@Rajat-Sharma1
@Rajat-Sharma1 4 жыл бұрын
Hey, where do I have to start 30:15 on Windows? Please help. When I am starting on psql shell, its not working properly.
@67Diadem
@67Diadem 4 жыл бұрын
same problem here. If you got a solution then please help me my problem is I can't connect to the server by typing psql -h localhost -p 5432 -U postgres test
@vishnupanchal6215
@vishnupanchal6215 4 жыл бұрын
@@67Diadem if you find the solution please dm me on insta @FlatTech26
@adnanalmansoor4033
@adnanalmansoor4033 4 жыл бұрын
having the same problem too
@jackburch6897
@jackburch6897 4 жыл бұрын
same
@yepyepyep3
@yepyepyep3 4 жыл бұрын
@@jackburch6897 search for CMD, use psql -U postgres command to log in
@luisd1336
@luisd1336 3 жыл бұрын
at 33:40 I get lost because when I type the help command into the SQL shell after logging in the shell doesn't perform any function. It also does nothing when I type in the "psql -h localhost -p 5432 -U amigoscode test" command. Is this because I'm on a windows 10 computer and not a mac? Also I log into my SQL shell it isn't blank like yours is, mine has postgres=# at the beginning.
@krimmy8459
@krimmy8459 3 жыл бұрын
This is exactly what i am facing.
@justinlim709
@justinlim709 3 жыл бұрын
@@krimmy8459 me too!
@AYUSHMISHRA-zr4rc
@AYUSHMISHRA-zr4rc 3 жыл бұрын
Hey Luis, Did you solve the problem? I am facing it to. I think we have to add psql to the path and then use it from windows terminal. Can you please confirm this, if you have solved the problem.
@justinlim709
@justinlim709 3 жыл бұрын
@@AYUSHMISHRA-zr4rcin powershell try psql -U postgres -h localhost After which it will prompt you for password
@juka219
@juka219 3 жыл бұрын
​@@AYUSHMISHRA-zr4rc I have and yes you are right about adding path: you need to add path to bin folder in the environment variables
@JG-sg7yy
@JG-sg7yy 5 жыл бұрын
Thanks so much for this tutorial. I am trying to follow along and am having some trouble doing so in one specific area so far. I have Windows by the way. The area I am struggling with is on Connect to Database 33:40. Reason I am having trouble is because I open SQL Shell and it displays Server [localhost] and does not allow me to delete this so that I can write exactly what you wrote which is ~ psql --help. How do I go about doing this the right way? I have also tried entering ~ psql --help after login into the database and I am not able to do as you are showing on the tutorial.
@rolerasi1
@rolerasi1 5 жыл бұрын
same problem for me, can anyone please help?
@MordMaman
@MordMaman 5 жыл бұрын
@@rolerasi1 you need to add it to your path, but he offers a second option \c any luck i know this was 3 months ago!
@sleeksilk497
@sleeksilk497 4 жыл бұрын
Same problem. Someone should kindly come to our aid, please.
@shivangchaturvedi237
@shivangchaturvedi237 Жыл бұрын
This is pretty much everything you need to learn PostgreSQL. Just these 4 good hours and you're good to go!
@nasxmo
@nasxmo 2 жыл бұрын
Really great course with great pace! Finished more than 3 hours in one sitting. Thanks !
you need to learn SQL RIGHT NOW!! (SQL Tutorial for Beginners)
24:25
NetworkChuck
Рет қаралды 1,6 МЛН
Roadmap for Learning SQL
4:52
ByteByteGo
Рет қаралды 532 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 223 М.
Docker Crash Course for Absolute Beginners [NEW]
1:07:39
TechWorld with Nana
Рет қаралды 1,9 МЛН
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 898 М.
Вся база SQL для начинающих за 1 час
1:19:48
Vlad Mishustin
Рет қаралды 360 М.
7 Database Paradigms
9:53
Fireship
Рет қаралды 1,6 МЛН
PostgreSQL vs MySQL
6:33
IBM Technology
Рет қаралды 364 М.
Docker Для Начинающих за 1 Час | Docker с Нуля
52:43
choosing a game engine is easy, actually
15:08
samyam
Рет қаралды 658 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.