Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL-lab Download sql script file sailors.txt

Similar presentations


Presentation on theme: "SQL-lab Download sql script file sailors.txt"— Presentation transcript:

1 SQL-lab Download sql script file sailors.txt
Create and populate those tables Try the following queries: Q1, Q12, Q21, Q26, Q31, Q32

2 Lab Exercise 1 Map ER to relation tables Populate table
Employee int, varchar2(20), decimal(10,2) 22,'Dustin', 23,'Bob', 24, 'Dustin', 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‘ stime salary ename eid dname did daddress workin Employee 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” 6

3 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', 6,’David’, 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‘


Download ppt "SQL-lab Download sql script file sailors.txt"

Similar presentations


Ads by Google