Populate these tables of this schema with sample data Write

Populate these tables of this schema with sample data

Write & execute SQL statements to obtain the following information from the database

1.Get details of employees whose salary is greater than or equal to Rs. 30 lakhs

2.Get details of employees working in ‘Research’ department.

3.For all employees, get their SSN, their name and name of the project they are working on

4.For all employees, get their SSN, their name and the name of their manager (supervisor)

Database schema EMPLOYEE MINIT LNAMESSN BDATEADDRESS SEXSALARY SUPERSSN DNO FNAME DEPARTMENT DNAME DNUMBER MGRSSNMGRSTARTDATE DEPT LOCATIONS PROJECT PNAME PNUMBER P PLOCATION DNUM WORKS ON ESSN PNO HOURS DEPENDENT ESSN DEPENDENT NAME SEX SEX BDATE RELATIONSHI

Solution

Please find below the SQL quries corresponding to the given statements :

1) Select * from EMPLOYEE where salary>= 3000000.

2) Select E.* from EMPLOYEE E, DEPARTMENT D where E.dno = D.dnumber and D.dname = \'Research\'.

3) Select E.SSN, E.fname, P.pname from EMPLOYEE E, PROJECT P, WORKS_ON W where E.SSN = W.ESSN and W.pno = P.pnumber

4) Select E.SSN, E.fname, M.fname from EMPLOYEE E, EMPLOYEE M, DEPARTMENT D where E.dno = D.dnumber and D.mgrssn = M.SSN

Populate these tables of this schema with sample data Write & execute SQL statements to obtain the following information from the database 1.Get details of

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site