Tag Archives: PostgreSQL

PostgreSQL tutorial for Beginners – PostgreSQL – LIMIT Clause

PostgreSQL – LIMIT Clause   The PostgreSQL LIMIT clause is used to limit the data amount returned by the SELECT statement. Syntax The basic syntax of SELECT statement with LIMIT clause is as follows − SELECT column1, column2, columnN FROM table_name LIMIT [no of rows] The following is the syntax of LIMIT clause when it is used …

PostgreSQL tutorial for Beginners – PostgreSQL – LIKE Clause

PostgreSQL – LIKE Clause   The PostgreSQL LIKE operator is used to match text values against a pattern using wildcards. If the search expression can be matched to the pattern expression, the LIKE operator will return true, which is 1. There are two wildcards used in conjunction with the LIKE operator − The percent sign (%) The underscore …

PostgreSQL tutorial for Beginners – PostgreSQL – DELETE Query

PostgreSQL – DELETE Query   The PostgreSQL DELETE Query is used to delete the existing records from a table. You can use WHERE clause with DELETE query to delete the selected rows. Otherwise, all the records would be deleted. Syntax The basic syntax of DELETE query with WHERE clause is as follows − DELETE FROM table_name WHERE …

PostgreSQL tutorial for Beginners – AND and OR Conjunctive Operators

AND and OR Conjunctive Operators   The PostgreSQL AND and OR operators are used to combine multiple conditions to narrow down selected data in a PostgreSQL statement. These two operators are called conjunctive operators. These operators provide a means to make multiple comparisons with different operators in the same PostgreSQL statement. The AND Operator The AND operator allows the existence of …

PostgreSQL tutorial for Beginners – PostgreSQL – Operators

PostgreSQL – Operators   What is an Operator in PostgreSQL? An operator is a reserved word or a character used primarily in a PostgreSQL statement’s WHERE clause to perform operation(s), such as comparisons and arithmetic operations. Operators are used to specify conditions in a PostgreSQL statement and to serve as conjunctions for multiple conditions in …

PostgreSQL tutorial for Beginners – PostgreSQL – SELECT Query

PostgreSQL – SELECT Query   PostgreSQL SELECT statement is used to fetch the data from a database table, which returns data in the form of result table. These result tables are called result-sets. Syntax The basic syntax of SELECT statement is as follows − SELECT column1, column2, columnN FROM table_name; Here, column1, column2…are the fields of a …

PostgreSQL tutorial for Beginners – PostgreSQL – INSERT Query

PostgreSQL – INSERT Query   The PostgreSQL INSERT INTO statement allows one to insert new rows into a table. One can insert a single row at a time or several rows as a result of a query. Syntax Basic syntax of INSERT INTO statement is as follows − INSERT INTO TABLE_NAME (column1, column2, column3,…columnN) VALUES (value1, value2, …

PostgreSQL tutorial for Beginners – PostgreSQL – Schema

PostgreSQL – Schema   A schema is a named collection of tables. A schema can also contain views, indexes, sequences, data types, operators, and functions. Schemas are analogous to directories at the operating system level, except that schemas cannot be nested. PostgreSQL statement CREATE SCHEMA creates a schema. Syntax The basic syntax of CREATE SCHEMA is as …