Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PostgresInsertIfNotExists
--PostgreSQL 9.6 --'\\' is a delimiter select version() as postgresql_version; CREATE TABLE Films ( code char(5) CONSTRAINT firstkey PRIMARY KEY, title varchar(40) NOT NULL, did integer NOT NULL, date_prod date, kind varchar(10), len interval hour to minute ); insert into Films (code, title, did, date_prod, kind) VALUES ('B6717', 'Tampopo', 110, '1985-02-10', 'Comedy'), ('HG120', 'The Dinner Game', 140, DEFAULT, 'Comedy'); INSERT INTO films (code, title, did, date_prod, kind) VALUES ('T_601', 'Yojimbo', 106, '1961-06-16', 'Drama'); select * from Films; INSERT INTO Films (code, title, did, date_prod, kind) --VALUES ('V9857', 'Visit', 1, '1985-02-10', 'Comedy'); SELECT 'V9857', 'Visit', 1, '1985-02-10', 'Comedy' FROM Films WHERE did in (110,140) AND NOT EXISTS (SELECT * FROM Films WHERE did = 100); ; select count(*) from Films; select * from Films;
run
|
edit
|
history
|
help
0
prueb final
enrj
MovieRating SQL
SQL Movie-Rating Query Exercises
SQL hierarchical query. branch of responses.
Ultima Clase
1097. Game Play Analysis V
LeetCode 178
Select the latest id from last week from each different contact without repeating barcodes .....
postgresql