⭐️ 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
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.
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.
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).
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
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.
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.
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!!
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!
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! 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.
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!
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! 🙏
⭐ 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
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! ⭐⭐⭐⭐⭐
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.
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
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.
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.
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 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!
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.
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.
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
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.
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.
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.
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!
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!
@@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.
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!!!!!
I cant believe the quality of content and explanation in this video. Brilliant course explaining PostgreSQL. Very easy to follow - Highly recommend it!
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 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.
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.
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
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.
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 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...
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.
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)
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.
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.
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! ❤❤
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.
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 ;)
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.
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 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!
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
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
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.
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
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 (th-cam.com/video/0EBkVzIBnoc/w-d-xo.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
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.
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.
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?
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.
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)
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;
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
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
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 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.
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.
⭐️ 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?
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 :)
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
Thanks
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
@@LooseFlannel 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
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
Postgresql Interview Questions And Answers:
th-cam.com/play/PLqGLh1jt697xtgiGwGUTFpOctT82ANdJZ.html&si=MdIpypaVnxU13_XK
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.
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!!
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!
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
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!
From being scared to run sql command from command line to liking it. Thanks for this awesome video
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.
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! 🙏
⭐ 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
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! ⭐⭐⭐⭐⭐
The best PostgresQL tutorial I've seen so far.
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 th-cam.com/video/0EBkVzIBnoc/w-d-xo.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
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
00:00 to 17:40 is setting up Postgres and installation.
Start watching from 17:40 if you want to know how to Use GUI vs command line.
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?
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.
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.
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
it did not work for me
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.
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.
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
:))
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.
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
MashAllah brother such an amazing course, May Allah give you jannah !
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.
What a timing! Just in time when I want to learn it. Appreciate it a lot guys!
The teacher's pace is just awesome!! He is the best teacher in the world.
Thank you so much for congratulating me by the end of this video for finishing this course. I learned a lot! 💯 💯 💯
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!
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...
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.
Boi this is excellent, it's really hard to believe this is free
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,
I cant believe the quality of content and explanation in this video. Brilliant course explaining PostgreSQL. Very easy to follow - Highly recommend it!
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 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.
1:21:60 should be 1:21:59 in the description. Thanks for the course.
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.
The best and complete PostgreSQL Course out there.
Working as an oracle dba, even non IT employees could use this db.
This is really help me to learn postgres, respect sir!!!
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)
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
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.
This video is one of the best SQL and PostgreSQL intro videos that I have come across. Thanks.
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 🤘🙏
Finished this in 3 days! Thank you good sir
Came back in this video to practice, thanks again!
@@BigSmoke-r9wNice one
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
Thanks from Russia. Great tutorial!
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 ?
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.
or invert the slashes
Pls I dint get this.....what should be in my name, amd what's the user's??
Thanks!
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!
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.
To those on Windows, to clear the screen, run "\! clear" or "\! cls". Hope this helps.
Awesome. Thanks a lot
Thanks a lot.
But how does he do it that the result of the query gets cleared, leaving only the queries (codes) behind.
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! ❤❤
The best tutorial I've ever seen for PostgreSQL!
I'm only in the 20th minute but I liked this tutorial soo much, Thanks man !
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
Amazing explanation man!!! you just made my lockdown fruitful....thanks a lot.
great
It is not the first PostgreSQL tutorial I watch, but this one is the best. Thank you)))))
Dude, be proud, this is an awesome video for getting started with Postgres.
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.
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
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.
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.
Definitely the best psql tutorial for beginners i have ever seen ! Thank you sir.
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 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!
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
wonderful course. I'm ditching nosql dbs for postgres permanently after this. thank you
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
My applause to the speaker! Enough deep and straightforward material at the same time!
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.
These 4 hours was better than 15 + lecturers
This tutorial is simply magnificent. Thank you for creating such a wonderful resource.
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 (th-cam.com/video/0EBkVzIBnoc/w-d-xo.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 .😊
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
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.
This is exactly what i am facing.
@@krimmy8459 me too!
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.
@@AYUSHMISHRA-zr4rcin powershell try
psql -U postgres -h localhost
After which it will prompt you for password
@@AYUSHMISHRA-zr4rc I have and yes you are right about adding path: you need to add path to bin folder in the environment variables
Great vid as always from FCC! Many thanks!
Great Tutorial. Loved it. Brushed up my SQL and learned new things. Recommended. PSQL Command Line is awesome. Didnt know about that.
Thank you so much! Such a great job you've did. Wish you all the best and inspiration to learning people. Thank you again!
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.
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
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)
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
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
@@rgraptor2542 Many thanks for your comment. Deleting the dollar sign worked for me.
Hey, where do I have to start 30:15 on Windows? Please help. When I am starting on psql shell, its not working properly.
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
@@67Diadem if you find the solution please dm me on insta @FlatTech26
having the same problem too
same
@@jackburch6897 search for CMD, use psql -U postgres command to log in
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.
Thank you very much! Excellent course, great didactics, easy-to-understand english and well-explained content!
Really great course with great pace! Finished more than 3 hours in one sitting. Thanks !
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.