Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
EXP 8 q2
create table emp(emp_no integer,emp_name varchar (30),salary integer); insert into emp values(1,'Jay',50000),(2,'ashish',15000),(3,'shreyas',30000),(4,'priya',45000),(5,'mona',35000); insert into emp values(6,'rahul',60000),(7,'aarya',25000); select * from emp; create table dept(dept_no integer,emp_no integer ,deptname varchar(30),location varchar(30)); insert into dept values(11,1,'it','mumbai'),(10,3,'marketing','thane'),(15,4,'abc','kalyan'),(10,2,'marketing','nashik'); insert into dept values(11,5,'it','mumbai'),(11,6,'it','mumbai'),(11,7,'it','mumbai'),(12,8,'accounting','pune'); select * from dept; Select dept_no,min(salary)from emp e,dept d where e.emp_no=d.emp_no group by dept_no; Select dept_no,sum(salary)from emp e,dept d where e.emp_no=d.emp_no group by dept_no; Select dept_no from dept group by dept_no having count(emp_no)>5; Select * from emp e,dept d where e.emp_no=d.emp_no order by emp_name; Select dept_no,sum(salary) from emp e,dept d where e.emp_no=d.emp_no group by dept_no; select emp_no,dept_no from dept group by dept_no,emp_no; Select dept_no,min(salary) from emp e,dept d where e.emp_no=d.emp_no group by dept_no; Select dept_no from dept order by deptname;
run
|
edit
|
history
|
help
0
Remove duplicates with in 10 min
Mywall
store2
yoo
Fatch data in xml format
03_A_Group_by_having
trigger
Select empID whose salary is greater than their managers
Mc170404738
consecutive_nums_2