PostgreSQL is an open-source object-relational database management system (ORDBMS) with an emphasis on extensibility and standards compliance. As a database server, its primary function is to store data securely, supporting best practices, and to allow for retrieval at the request of other software applications. It can handle workloads ranging from small single-machine applications to large Internet-facing applications with many concurrent users.
A database schema is a way to logically group objects such as tables, views, stored procedures, etc. Think of a schema as a container of objects. You can assign a user login permissions to a single schema so that the user can only access the objects they are authorized to access.
A primary key is a column or a set of columns that uniquely identifies each row in the table. A table can have only one primary key that consists of single or multiple columns. When multiple columns are used as a primary key, they are called a composite key.
A foreign key is a column or a set of columns in a table that references to the primary key columns in another table. The table that the foreign key points to is called the referenced table or parent table. A table can have multiple foreign keys depending on its relationships with other tables.
The VARCHAR and CHAR are the character data types. The VARCHAR data type is used to store variable-length character strings. The CHAR data type is used to store fixed-length character strings.
The WHERE clause is used to filter records. The WHERE clause is used to extract only those records that fulfill a specified condition.
The LIMIT clause is used to limit the number of rows returned in a query result. The OFFSET clause is used to offset the starting point returned by the LIMIT clause.
The UPDATE statement is used to modify the existing records in a table. The WHERE clause is used to specify the conditions that identify which rows to modify.
The JOIN operation is used to combine rows from two or more tables based on a related column between them. The JOIN operation is performed whenever two or more tables are joined in a SQL statement.
The GROUP BY clause is used to group the result set based on one or more columns. The GROUP BY clause is often used with aggregate functions such as SUM, AVG, MAX, MIN, and COUNT.
The aggregate functions are used to perform calculations on a set of values and return a single value. The aggregate functions are COUNT, SUM, AVG, MAX, and MIN.
An index is a database structure that is used to speed up the retrieval of rows from the table or view. An index contains keys built from one or more columns in the table or view. These keys are stored in a structure (B-tree) that enables SQL Server to find the row or rows associated with the key values quickly and efficiently.
A view is a virtual table that consists of a subset of data contained in a table. A view can contain all rows of a table or select rows from one or more tables. A view can be created from one or many tables which depends on the written PostgreSQL query to create a view. Views, which are kind of virtual tables, allow users to do the following: