SQL Statements
The primary structure of a SQL query is its statement. Multiple statements are separated by semicolons. The following example contains four common SQL statements—CREATE TABLE, INSERT, SELECT, and COMMIT:
=> CREATE TABLE comments (id INT, comment VARCHAR); CREATE TABLE => INSERT INTO comments VALUES (1, 'Hello World'); OUTPUT -------- 1 (1 row) => SELECT * FROM comments; id | comment ----+------------- 1 | Hello World (1 row) => COMMIT; COMMIT =>