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

MoreCompany company(govt_id, cname, hq_loc) employee(fname, minit, lname, ssn, b

ID: 3928134 • Letter: M

Question

MoreCompany

company(govt_id, cname, hq_loc)

employee(fname, minit, lname, ssn, bdate, supervisorssn, address, gender, salary, dno)

dept_locations(govt_id, dnumber, dlocation)

skillset(ssn, skill_no)

skills(skill_no, skill_desc)

NOTE: dno and dnumber both represent the department number.

Write SQL DML for More_Company

- Retrieve bdate and address of employee John S. Smith

- For each employee, retrieve full name of employee and full name of supervisor.

- For each department whose average salary is more than $50,000, retrieve the govt_id, department number and the number of employees working for that department.

- Create a view that has employee name, address and department number.

- Retrieve the name of each employee who has a manager whose social security number is 987654321. Make sure you use a nested query.

- Retrieve all skillsets and all skills matched on skill_no where possible.

Explanation / Answer

1)select bdate,address from employee fname + ' ' +lname="John S. Smith";
2)select supervisorssn,fname + ' ' +lname AS FullName from employee
3)select govt_id,dno, from dept_locations where dno=(select dnumber from employee where avg(salary)>50000
4)Create view emp_view(fname, lname,address,dno);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote