Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --PostgreSQL 9.6
- --'\\' is a delimiter
- select version() as postgresql_version;
- DROP TABLE EGZAMINAS;
- BEGIN TRANSACTION;
- /* Create a table called NAMES */
- CREATE TABLE EGZAMINAS(Dalyvis integer PRIMARY KEY, Vardas text, "PavardÄ—" character(15), Taskai float, data DATE);
- /* Create few records in this table */
- INSERT INTO EGZAMINAS VALUES(1,'Tom','Andrec',0.12,'2018-04-15');
- INSERT INTO EGZAMINAS VALUES(2,'Lucy','Bellyj',0.98,'2018-04-15');
- INSERT INTO EGZAMINAS VALUES(3,'Frank','Stopovic',0.17,'2018-04-15');
- INSERT INTO EGZAMINAS VALUES(4,'Jane','Spjecek',0.45,'2018-04-15');
- INSERT INTO EGZAMINAS VALUES(5,'Robert','Bagu',0.34,'2018-04-15');
- COMMIT;
- /* Display all the records from the table */
- SELECT EXTRACT(YEAR FROM data) AS ct FROM EGZAMINAS;
- DROP TABLE EGZAMINAS;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement