Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
fgf
create table tm(id serial primary key,name varchar(25) not null,surname varchar(25) not null,desig varchar(25) not null,place varchar(25) not null,pay money not null ); insert into tm(name,surname,desig,place,pay) values ('flintoff','andrew','tree','hyd',1000), ('lara','brian','tree','hyd',2000), ('johnson','mitchel','tree','hyd',60000), ('bravo','darren','tree','vizag',40000); select * from tm; select id,sum(pay) from tm group by id having pay<>cast(2000 as money) order by pay desc; create table sathi(id serial primary key,name varchar(25) not null,doj timestamp not null); insert into sathi(name,doj) values ('ram','2018-AUG-02'), ('ravi','2018-03-03'), ('renu','02-02-2017'); select * from sathi; select id,name,surname from tm union select id,name,cast(doj as varchar) from sathi ; select id from tm where pay>cast(2000 as money) intersect select id from sathi; select id from tm where pay>cast(0 as money) except select id from sathi;
run
|
edit
|
history
|
help
0
FInale 38474297439
yordan
SQL2_CLASS
1225. Report Contiguous Dates
Tic tac toe
Postgres Practice
Ecommerce Website Analysis by SQL
Dashes in numbers
distinct on vs row_number
Leet Code 185