Learn PostgreSQL Tutorial - Full Course for Beginners
Вставка
- Опубліковано 26 сер 2024
- Learn how to use PostgreSQL in this full course. PostgreSQL is a general purpose and object-relational database management system. It is the most advanced open source database system widely used to build back-end systems.
⭐️ 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
✏️ Course from Amigoscode.
🔗 Subscribe to Amigoscode UA-cam channel | bit.ly/2HpF5V8
🔗 Visit Amigoscode.com for more courses | bit.ly/2JgGW0w
🔗 Full Playlist Available Here | bit.ly/2ClGPdY
🔗 Follow Amigoscode on Instagram | bit.ly/2TSkA9w
🔗 Join Amigoscode Closed Facebook Group | bit.ly/2FbuIkx
--
Learn to code for free and get a developer job: www.freecodeca...
Read hundreds of articles on programming: medium.freecod...
And subscribe for new videos on technology: ua-cam.com/users/su...
Somebody give that man a medal!!
I will !
@@zbigniewbrzezinski8869 😅😂😅😂
big agree
wrr
i only have a cookie
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.
**proceeds to call an asterisk a star**
@@elco7956 I've been a web developer for 7 years and I still do that.
@@elco7956 asterisk AS star 😮
@@elco7956 @IceEN Holy mother of GOD!!!!
@@elco7956 imagine being overly critical because someone didnt say asterisk XD
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.
I believe they were not free in the beginning. We can just appreciate they are free eventually after just 4 years :)
Note for beginners:
34:50
Here, he is using a command prompt, not postgres shell. If " psql - -help" does not work on your terminal, you need to add an environment variable. This video explains how to add one. ua-cam.com/video/0EBkVzIBnoc/v-deo.html
35:44
If your password does not work, use 'postgres' for the username. Your code should look like this " psql -h localhost -p 5432 -U postgres test"
This is simply because you have not created a user account called 'user'
thank you so much
Thank you! I was wondering what I was missing
I was wondering why that part doesn't work on my end. Thank you so much for this!
Thanks, man. How can they miss this from the video? freecodecamp tutorials used to be proficient...
Oh my god. I was so confused why it doesn't work on my part. Thank you so much.
Thank You for using easy English. I understand a lot of.
Respect from Russia with 41 peoples.
41+1
+1
just fyi this guy's English is terrible, but hey at least it's simple
@nabil libre just racist up there
@@WeirdAlSuperFan How so? He is speaking slowly and clearly and obviously has a good grasp of the concepts.
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.
Also train and make project before you forget
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).
just so you know you can also change the data Mockaroo gives, you can set it to only be male and female
@@TheBenTonks Thanks for the information , brother.
In ubuntu when I try to import the person.sql it denies me the permission.
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
@@Technomic-o I used i\ 'C:/Users/:myuser/Downloads/person.sql' on windows and it worked, you have to put the path in quotes
For anyone who needs the resource link for 3:19:48 (Adding Relationship Between Tables): drive.google.com/drive/folders/1v0I19Ed2his8otHRLm5i6W7feD9sIMc6
thanks a lot bro
You saved my ass. Thank you.
Thank you bro
Cheers
Thanks a lot dawg
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
thanks Capt.
thanks this really worked for me
Thanks a lot man!
Thank you 🫡
Thank you brotherrr
:))
From being scared to run sql command from command line to liking it. Thanks for this awesome video
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! 🙏
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!
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!
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!!
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! ⭐⭐⭐⭐⭐
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.
thanks Johan
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.
OMG, Thank you
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.
Thanks man
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.
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.
@Niyazi Yildirim
can u explain in detail....since many of us have the same problem
@@divakarsiva623 Maybe it's already late, but here is a video how to do that ua-cam.com/video/0EBkVzIBnoc/v-deo.html&ab_channel=jinujawadm
@@mergenberdiyev8438 Nope , its never late . Thanks !
@@mergenberdiyev8438 This tutorial doesn't work with version 14. There is no "bin" folder with the psql.exe file. Anyone have another fix?
@@billyssk666 worked just fine for me (version 14.1). Maybe you didn't see bin folder of psql.exe file
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.
thank you man.
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?
I figured it out, you have to type:
psql -U 'userName'
@@afunnykorean or "psql -U postgres". I actually don't know the cause of that bug, but its at least easy to fix :)
this should be top comment.
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.
Can we maybe have the notes? pretty please?
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!
thanks! needed help with that exact part
Thanks a lot
Yeah, thanks a bunch
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=#")
thank u its really helpful
could u please tell me how to clear the terminal
@@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...
thanks so much! I was confused about switching to another DB, so I went to the comments. You rock
@@yatskovych I'm glad to se it is helpful 👍 Thank for feedback.
@@ugljesavojvodic3384 Man, thank you soooooo much! I ended up stuck with that yesterday and you made my day this morning 🤘🙏
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.
Finished this in 3 days! Thank you good sir
Came back in this video to practice, thanks again!
@@user-kn4oi9oh4iNice one
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.
The best PostgresQL tutorial I've seen so far.
To those on Windows, to clear the screen, run "\! clear" or "\! cls". Hope this helps.
Awesome. Thanks a lot
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
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.
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 ;)
G.O.A.T.
atill i cant open the .sql file in terminal
I got permission denied error help me out
@@Dineshsharma-ec6ys Try to use single quote 'path' for the file path.
Thanks a lot for this. Just saved me from fraustration
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
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
⭐️ 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
THANKS
Thanks!
awesome man...Thanks a bunch.....
GREAT! THANKS MEHN
Thanks, can you send the link that he talks about it at 1:54?
The teacher's pace is just awesome!! He is the best teacher in the world.
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.
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
I am stuck with "No such file or directory".
@@olamideadigun9206 \i 'C:/wherever_you_downloaded_it/person.sql' ......Don't forget the single apostrophe...
@@Adivasi7777 thank you bro
thank you for the information
thanks a lot I was stuck here for so long
Great work man. Thank you from Barcelona. I like your voice, it's very clear to understand to non English-speaking like me.
Really clear accent! Easy to understand. Thank u, bro.
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.
good suggestion Soni !
you know any tutorials regarding these ?
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.
I am from Pakistan yesterday I downloaded this video and watched it offline. After watching then I open youtube and search your video just for saying thank you for such a clear , simple and educated tutorial. Now I subscribed to your channel and will explore this channel. Keep it up sir
Thank you so much for congratulating me by the end of this video for finishing this course. I learned a lot! 💯 💯 💯
1:21:60 should be 1:21:59 in the description. Thanks for the course.
I must admit, this is way more better than some Udemy courses.
there is also good course about postgreSQL there in udemy from Jose Portilla if iam not mistaken
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.
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.
Nice. Thank you!
Boi this is excellent, it's really hard to believe this is free
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.
Thanks. Same thing on MAC. You literally save my dawn studying. Lol
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
thank so much. I was stuck here before i saw your comment.
Working as an oracle dba, even non IT employees could use this db.
This is really help me to learn postgres, respect sir!!!
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!!!!!
Legend has it Mr. Terrible-Attention-Span still hasn't finished the video,
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
Literally beating my head for 1hr. Bro .. you saved me ! Tq
thank you tons friend.
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! ❤❤
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
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.
@@harlanreece2348 you should have asked the doubt directly in the comment
you are great, I wish your tutorial was there when I started my SQL journey 15 years ago.
does it mean that after 15 years of experience , you're still looking for tutorials ? , omg what scary future do we juniors have 😅
@@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.
What a timing! Just in time when I want to learn it. Appreciate it a lot guys!
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.
LOL
@@johnwick-m4m at least
you (one person)
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.
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 (ua-cam.com/video/0EBkVzIBnoc/v-deo.html)
and run the command "psql -U postgres" in command prompt and enter your password
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
Thank you very much!! I ran into the same problem and was looking for solution!
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?
What exactly is environment variable? Description to me looks like a background app, not a variable.
Thanks for your help .😊
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!
NOT all HEROES wear CAPES, but this guys in not hero, he is a legend, A LEGEND, thanks man !
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.
I can not thank you enough. you explain the subject way better than my lecturer
Lmao that seems to be a really recurrent event in cs matters
@@diegopiscoya4318 its true, surprisingly or unsurprisingly
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!
indeed! what a great teacher and lecture! i feel like i can do whatever i want now with Postgres...
wonderful course. I'm ditching nosql dbs for postgres permanently after this. thank you
It's 2023 the course still holds strong, one thing that I would like to mention is to also refer to the official postgres documentation side by side. Most of the things that you would need to run query on a database are listed in the video, but variety of some things is not covered, which you can learn on your own (read documentation). I would highly recommend watching this as your first beginner video as the explanation is really good. Some things you can only learn after working on projects, so don't worry about them.
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.
Idk why, but commands: "psql --help" doesn't work on windows 10 in SQL Shell (psql), it only works in CMD. So it's not exact the same on windows as on mac.
That is the way it is supposed to be. It's not clear in the video but he is running everything from the mac terminal (CMD shell is the equivalent in windows). He is calling psql from the terminal so if you were to type psql --help into the SQL Shell (psql) it won't work because you are already in psql
@@mconn86 I tried running psql - - help in the cmd but I get an error, " is not recognized as an internal or external command operable program or batch file" . What am I doing wrong? The tutorial is so confusing because the commands don't work the same in windows.
@@thuyvuong9874 you only need to add the directory of psql to the path variable
@@thuyvuong9874 You are not alone!! I found myself difficult to follow this command on windows.
@@thuyvuong9874 Even i tried to do same failed miserably even i added the environment to path. Did everything that can be possible but nothing worked out. So just stick to the pysql shell.
I cant believe the quality of content and explanation in this video. Brilliant course explaining PostgreSQL. Very easy to follow - Highly recommend it!
MashAllah brother such an amazing course, May Allah give you jannah !
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;
can you say where we should use it?
Thanks, it worked.
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
50:35
Isn't a PRIMARY KEY attribute automatically also NOT NULL?
Correct! Primary key columns cannot have NULL values, so it's pointless to define it there
Actually , Not Null is unuseful command for primary
Yes, primary key is not null and unique
thanks bro even I had this doubt
I really appreciate everything in this course
It was perfect course for me
very nicely explained
Thank You !
If you can provide the link for the advanced postgresql course , that would be great!
So I learned mySQL and Oracle in faculty, but I didn't remembered one thing and this course really gave me the courage to apply to a job. Thanks
Thanks from Russia. Great tutorial!
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")
This video is one of the best SQL and PostgreSQL intro videos that I have come across. Thanks.
The best and complete PostgreSQL Course out there.
These 4 hours was better than 15 + lecturers
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)
I was stuck here, thanks a lot :)
Thanks a lot, i was this close to give up but you saved me.
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)
All i can say is wow.. just from the very beginning, i added more learnings prior to what i have. Thanks a lot🙏and more power...👌
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?
do 'ALTER TABLE person ALTER COUMN name SET VARCHAR(30) NOT NULL;' this might help
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.
Amazing explanation man!!! you just made my lockdown fruitful....thanks a lot.
great
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.
great tutorial nelson! very intuitive and well structured
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
I'm only in the 20th minute but I liked this tutorial soo much, Thanks man !
End to End Postgres. Starting with SELECT * to JOINS in the same methodical explanation. Best vid to learn and practice postgres.
This is pretty much everything you need to learn PostgreSQL. Just these 4 good hours and you're good to go!
Hint about loading data from an SQL-file (1h 2m-1h-12m): Since the Video has been shot, Mockaroo seems to have changed their policy for representing gender. When I tried to import the sql file I ran into the error ERROR: value too long for type character varying(7). This happens, because Mockaroo not only outputs Male and Female but also several other genders like 'Genderfluid', 'Non-binary', etc. To fix this change the size of the gender-colum to 25 in the CREATE TABLE command:
create table person (
id BIGSERIAL NOT NULL PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
email VARCHAR(150),
gender VARCHAR(25) NOT NULL,
date_of_birth DATE NOT NULL,
country_of_birth VARCHAR(50) NOT NULL
);
Thank you.
My applause to the speaker! Enough deep and straightforward material at the same time!
It is not the first PostgreSQL tutorial I watch, but this one is the best. Thank you)))))
8:41 A relational database doesn't necessarily require relationships between tables to be considered relational. A 'relation' in this context is simply a table, which is a set of tuples (rows) with attributes (columns) drawn from different domains. This concept is fundamental to relational algebra.
As for window user this is really confusing when you switch back and forth with shell batch since window SQL shell doesn't have it.
Open the Windows Store
Install Ubuntu
Start Ubuntu
Get cracking.
@@David-2501 It is by no means that simple. I've implemented Ubuntu using the recent Windows 10 Windows System for Linux feature. When I started this course, I considered using Postgres in Linux. None of the material addresses using Linux or WSL. At the very least, learners would need a link to Windows 10 WSL start up guide, then the Ubuntu Linux guides.
Build a VM with Linux OR use docker
@@BruceNorikane I agree. I always recommend learning Bash CLI. for those that want to learn goto netacad dot com and create a free account and do linux essentials. its free. and its not expert level stuff but you will get the basics.
@@BruceNorikane I know I'm late but if you're serious about programming get a mac or atleast use linux. It's for your own sanity.
Thank you so much! Such a great job you've did. Wish you all the best and inspiration to learning people. Thank you again!
Thank you very much! Excellent course, great didactics, easy-to-understand english and well-explained content!
Definitely the best psql tutorial for beginners i have ever seen ! Thank you sir.
Since PostgreSQL is mostly used on Linux systems, they should be dominant and not missing in the installation part of this video.
linux omegalul
@@PatrickMcMunn The installation part is almost the same, whether you use Linux or a BSD system.
Linux users are supposed to know how to do it.
@@pauloTx Even among Linux users are some beginners. There are new Linux users every day.
@@HolgerJakobs this is why it's so hard to get into linux. if you ask a question on stack overflow or something everyone assumes you are an expert and know what every command means...
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!
This is the best tutorial for beginners! Thank you so much..!
Just finished; took a few days (I like to let info settle in) but worth every minute!
Thank you!