Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
employee table
create table employee ( e_id int not null, e_name varchar(20), e_salary int, e_age int, e_gender varchar(20), e_dept varchar(20), primary key (e_id)); insert into employee values(1, 'sam' , 95000 , 45 , 'male' , 'operations' ); insert into employee values (2, 'bob' , 80000 , 21 , 'male' , 'support' ); insert into employee values(3, 'anne' , 125000 , 25 , 'female' , 'analytics' ); insert into employee values(4, 'julia' , 73000 , 30 , 'female' , 'analytics' ); insert into employee values(5, 'matt' , 159000 , 33 , 'male' , 'sales' ); insert into employee values(6,'jeff' , 112000 , 27 , 'male' , 'operations' ); select * from employee; select e_name from employee; select e_gender from employee; select distinct(e_gender) from employee; select * from employee where( e_age<30 and e_gender = 'male' ); select * from employee where (e_dept = 'operations' and e_salary>100000); select * from employee where (e_salary>100000 or e_age>30); select * from employee where not (e_gender = 'female'); select * from employee where (e_gender<>'female'); select * from employee where (e_gender != 'female'); select * from employee where not (e_age < 30); select * from employee where (e_name) like 'j%'; select * from employee where e_age like '3_' ; select * from employee where (e_age) between 35 and 45; select * from employee where (e_salary) between 90000 and 120000; select min(e_age) from employee; select max(e_salary) from employee; select count(*) from employee where (e_gender = 'male' ); select count(*) from employee where (e_gender = 'female' ); select sum(e_salary) from employee; select avg(e_age) from employee; select ' akshat'; select ltrim(' akshat'); select 'akshat is a gud boy'; select upper('akshat is a gud boy'); select reverse('akshat is a gud boy'); select substring('akshat is a gud boy',12,4); select ' AKSHAT ROCKS '; select lower(' AKSHAT ROCKS '); select * from employee order by e_salary; select * from employee order by e_salary desc ; select * from employee order by e_salary asc ;
run
|
edit
|
history
|
help
0
Task2_Final
Task_6_Final
sql6
03_A_Group_by_having
Turn comma-separated numbers in string into rows
Checking SQL Job run status
2 лаба
#Temp table Collation fixed
Branch
SQL for beginners( defined with errors while enforcing constraints)