Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Postgres Trigger
drop table if exists table1; drop table if exists table2; create table table1( id integer NOT NULL,name character varying); create table table2(id integer NOT NULL,name character varying); create or replace function function_copy() returns trigger language plpgsql as $$ begin insert into table2(id,name) values(new.id,new.name); return new; end $$; create trigger trig_copy before insert or update on table1 for each row execute procedure function_copy(); insert into table1 (id, name) values (1, 'John'); insert into table1 (id, name) values (2, 'John2'); select * from table1; select * from table2; delete from table1 where id=1; select * from table1; select * from table2;
run
|
edit
|
history
|
help
0
Game Play Analysis (511,512,534,550)
Persy_Jackson
Select the latest id from last week from each different contact without repeating barcodes.....
FInale 38474297439
Select all countries that can be found by recursively adding all neighbouring countries (PostgreSQL)
a
SQL Practice Sample: Movie Database
Atividade 2
Cilinica_X
Christmas Tree Generator