Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

- Consider the following relational schema - Write SQL statements for the follow

ID: 3705775 • Letter: #

Question

- Consider the following relational schema - Write SQL statements for the following queries. employee fname CHARACTER VARYING(15) minit CHARACTER VARYINGC1) Iname CHARACTER VARYING 15 essn CHARACTERC bdate DATE address CHARACTER VARYING(50) dependent works on CHARACTERD) esn CHARACTERD) dependent name CHARACTER VARYINGG15) pno NUMERIC / hours NUMERIC CHARACTER(1) DATE CHARACTER VARYING(B) CHARACTER1) dept locations relationship salary NUMERIC supar ssn CHARACTERC dno NUMERIC dlocation CHARACTER VARYINGC15) NUMERIC department dname CHARACTER VARYINGG) dno mgissnCHARACTERO) mgstartdate DATE project NUMERIC pname CHARACTER VARYING(S) pno plocation CHARACTER VARYING15) dno NUMERIC NUMERIC Retrieve the first names of employees who had worked more than two projects Retrieve the first names of employees who have the highest salary Retrieve the first names of employees whose working hours are less than 15 hours. Retrieve the first names of employees who have more than 2 dependents. Retrieve the first names of employees whose gender differs from their dependents.

Explanation / Answer

Select fname from employees where count(project)>2;

select fname from employees where sal=(select max(sal) from employees);

select fname from employess wheres hours < 15;

select fname from employees where dependents >2;