Category: PostgreSQL

PostgreSQL Delete

PostgreSQL Delete The PostgreSQL DELETE statement is used to delete records from a table. Delete syntax --deletes the records that meet the conditions DELETE FROM table_name WHERE {conditions} -- delete all records from table DELETE FROM table_name Delete example DELETE FROM...

PostgreSQL Update

PostgreSQL Update The PostgreSQL UPDATE statement is used to modify values in a table. Update syntax UPDATE table_name SET column_n1 = new_value1, column_n2 = new_value2, column_n3 = new_value3, ... WHERE {condition} Update example UPDATE goods SET description = 'Car 2 description'...

PostgreSQL Insert

PostgreSQL Insert The INSERT statement is used to insert records into a table from a PostgreSQL database. Insert syntax INSERT INTO table_name ( column name1, column name2, column name3, ... ) VALUES ( value1, value2, value3, ... ); INSERT INTO table_name...

PostgreSQL Select

PostgreSQL Select The PostgreSQL SELECT statement is used to query records from a table. Select syntax -- select all records from table SELECT * FROM table_name -- select specific columns SELECT column_1, column_2 FROM table_name -- select the records that meet...

PostgreSQL Drop Table

PostgreSQL Drop Table The PostgreSQL DROP TABLE is used to delete a table from a database. Drop Table syntax DROP TABLE [ IF EXISTS ] table_name [ CASCADE | RESTRICT ]; Drop Table example CREATE TABLE my_goods ( ID INT, NAME...