30 likes | 186 Views
Download sql script file sailors.txt Create and populate those tables Try the following queries: Q1, Q12, Q21, Q26, Q31, Q32 . stime. ename. dname. eid. salary. Employee. workin. Lab Exercise 1. Employee int, varchar2(20), decimal(10,2) 22,'Dustin',10000.0 23,'Bob',15000.0
E N D
Download sql script file sailors.txt • Create and populate those tables • Try the following queries: • Q1, Q12, Q21, Q26, Q31, Q32
stime ename dname eid salary Employee workin Lab Exercise 1 Employee int, varchar2(20), decimal(10,2) 22,'Dustin',10000.0 23,'Bob',15000.0 24, 'Dustin',20000.0 Department 101,'cs','keenedy‘ 102,'ee','smith‘ Workin int, int, date 22,101,'10-OCT-98‘ 22,102, '10-JAN-99‘ 23,102,'15-OCT-98’ 24,101, '10-OCT-01‘ did daddress Department • Map ER to relation tables • Populate table • Q1 “find the name of employees who work at cs dept” • Q2 “find the name of emplyees who have not worked at dept 101”
Lab 2 Please insert more tuples Q3 “find the average salary of employees” Q4 “find the average salary of employees for each dept.” Q5 ”Find the average salary of employes for each department that has at least 3 SUCH employees” Q6 “find the average salary of employees whose salary is above 9000” for each department that has at least three SUCH employees. Employee 3,‘Alice',8000.0 4,‘Mike',7000.0 5, ‘Alex',10000.0 6,’David’,20000.0 Department 103,‘sis',‘carc‘ Workin 3,103,'10-OCT-00‘ 4,103, '10-JAN-00‘ 5,103,'15-OCT-00’ 6,102, '10-OCT-01‘