Free · 42 Topics · No Signup
PostgreSQL Notes
Advanced SQL database — tables, joins, constraints and query syntax — written by CodingNow 2.0's mentors. Free to read, structured to actually help you learn.
PostgreSQL notes by CodingNow 2.0 cover 42 topics — from postgresql home to postgresql case — each explained with short definitions, syntax and runnable code examples. They are 100% free, need no signup, and work as quick revision for college exams, PostgreSQL interviews and CodingNow 2.0's mentor-led PostgreSQL course in Pitampura, Delhi.
No notes found. Try a different search term, or browse all PostgreSQL notes.
PostgreSQL Tutorial
5 of 5 topics publishedPostgreSQL Home
PostgreSQL is an advanced, free, and open-source relational database system.
PostgreSQL Intro
PostgreSQL is a free open-source database system that supports both relational (SQL) and non-relational (JSON) queries.
PostgreSQL Install
To install PostgreSQL locally on your computer, visit the installer by EDB, and download the newest version compatible with your operating system.
PostgreSQL Get Started
If you have followed the steps from the Install PostgreSQL page, you now have a PostgreSQL database on you computer.
PostgreSQL pgAdmin 4
In the previous chapter we learned how to connect to the database using the SQL Shell (psql) application, which is a command-based application that allows us to
Database
10 of 10 topics publishedPostgreSQL CREATE TABLE
To create a new database table using the SQL Shell, make sure you are connected to the database. If not, follow the steps in the Get Started chapter of this tut
PostgreSQL INSERT INTO
To insert data into a table in PostgreSQL, we use the INSERT INTO statement.
PostgreSQL Fetch Data
To retrieve data from a data base, we use the SELECT statement.
PostgreSQL ADD COLUMN
To add a column to an existing table, we have to use the ALTER TABLE statement.
PostgreSQL UPDATE
The UPDATE statement is used to modify the value(s) in existing records in a table.
PostgreSQL ALTER COLUMN
To change the data type, or the size of a table column we have to use the ALTER TABLE statement.
PostgreSQL DROP COLUMN
To remove a column from a table, we have to use the ALTER TABLE statement.
PostgreSQL DELETE
The DELETE statement is used to delete existing records in a table.
PostgreSQL DROP TABLE
The DROP TABLE statement is used to drop an existing table in a database.
Create Demo Database
Up until now in this tutorial we have worked with a very small and simple table in our PostgreSQL database.
PostgreSQL Syntax
27 of 27 topics publishedPostgreSQL Operators
We can operate with different operators in the WHERE clause:
PostgreSQL SELECT
To retrieve data from a database, we use the SELECT statement.
PostgreSQL SELECT DISTINCT
The SELECT DISTINCT statement is used to return only distinct (different) values.
PostgreSQL WHERE
The WHERE clause is used to filter records.
PostgreSQL ORDER BY
The ORDER BY keyword is used to sort the result in ascending or descending order.
PostgreSQL LIMIT
The LIMIT clause is used to limit the maximum number of records to return.
PostgreSQL MIN and MAX
The MIN() function returns the smallest value of the selected column.
PostgreSQL COUNT
The COUNT() function returns the number of rows that matches a specified criterion.
PostgreSQL SUM
The SUM() function returns the total sum of a numeric column.
PostgreSQL AVG
The AVG() function returns the average value of a numeric column.
PostgreSQL LIKE
The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.
PostgreSQL IN
The IN operator allows you to specify a list of possible values in the WHERE clause.
PostgreSQL BETWEEN
The BETWEEN operator selects values within a given range. The values can be numbers, text, or dates.
PostgreSQL AS
SQL aliases are used to give a table, or a column in a table, a temporary name.
PostgreSQL Joins
A JOIN clause is used to combine rows from two or more tables, based on a related column between them.
PostgreSQL INNER JOIN
The INNER JOIN keyword selects records that have matching values in both tables.
PostgreSQL LEFT JOIN
The LEFT JOIN keyword selects ALL records from the "left" table, and the matching records from the "right" table. The result is 0 records from the right side
PostgreSQL RIGHT JOIN
The RIGHT JOIN keyword selects ALL records from the "right" table, and the matching records from the "left" table. The result is 0 records from the left side
PostgreSQL FULL JOIN
The FULL JOIN keyword selects ALL records from both tables, even if there is not a match. For rows with a match the values from both tables are available, if
PostgreSQL CROSS JOIN
The CROSS JOIN keyword returns the Cartesian product of two or more tables (combines every row from the first table with every row from the second table).
PostgreSQL UNION
The UNION operator is used to combine the result-set of two or more queries.
PostgreSQL GROUP BY
The GROUP BY clause groups rows that have the same values into summary rows, like "find the number of customers in each country".
PostgreSQL HAVING
The HAVING clause was added to SQL because the WHERE clause cannot be used with aggregate functions.
PostgreSQL EXISTS
The EXISTS operator is used to test for the existence of any record in a sub query.
PostgreSQL ANY
The ANY operator allows you to perform a comparison between a single column value and a range of other values.
PostgreSQL ALL
- returns TRUE if ALL of the sub query values meet the condition
PostgreSQL CASE
The CASE expression goes through conditions and returns a value when the first condition is met (like an if-then-else statement).
Ready to go from notes to a real career?
Join CodingNow 2.0's PostgreSQL course — live mentorship, hands-on projects, and 100% placement support in Delhi NCR.
Enroll Now — Free Demo AvailablePostgreSQL Notes – FAQs
What students search before reading PostgreSQL notes.