Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
samplequery
create table testing (name varchar(20),age int,martial_status varchar(15),location varchar(12)) insert into testing(name,age,martial_status,location) values('arvind','21','unmarried','chennai') insert into testing(name,age,martial_status,location) values('arun','23','unmarried','bangalore') insert into testing(name,age,martial_status,location) values('saravana kumar','29','unmarried','USA') insert into testing(name,age,martial_status,location) values('venkat','25','unmarried','chennai') insert into testing(name,age,martial_status,location) values('surya parakash','31','married','bangalore') insert into testing(name,age,martial_status,location) values('suniitha','28','married','chennai') select * from testing select * from testing where age>30 and martial_status='married' select * from testing select count( distinct location) from testing select * from testing where location='bangalore' or age>25 select * from testing order by location desc select name,age,location from testing where location is null update testing set location='bangalore' where name='arvind' select * from testing insert into testing(name,age,martial_status,location) values('kavin','31','married','bangalore') select * from testing delete from testing where name='kavin' select * from testing select top 3 * from testing select * from testing where age<30 and age>=29 select sum(age) as avg_age from testing select * from testing where name like 'a%' and age>22 select * from testing where name like '[a-c]%' select * from testing where location in ('bangalore','usa') select * from testing where age between 20 and 28 select age as maturity from testing create table table2(name varchar(20),familyid int,phoneno int ) insert into table2 (name,familyid,phoneno) values('arvind','1001','1234567') insert into table2 (name,familyid,phoneno) values('arun','1002','1234565') insert into table2 (name,familyid,phoneno) values('saravana kumar','1003','1239567') insert into table2 (name,familyid,phoneno) values('venkat','1004','1534567') insert into table2 (name,familyid,phoneno) values('surya parakash','1005','1734567') insert into table2 (name,familyid,phoneno) values('sunitha','1006','1239867') select * from table2 select testing.name,table2.familyid,testing.location,table2.phoneno from testing inner join table2 on testing.name=table2.name select testing.name,table2.familyid from testing full outer join table2 on testing.name=table2.name order by age select * from testing order by age select age,location from testing union select phoneno,name from table2
run
|
edit
|
history
|
help
0
№3
Q2_60min
new
Caronas
Sql Queries
BTVN_QLDT_TUAN 8
repert
P1
Select empID whose salary is greater than their managers
Veterinary 1