Question
Consider the database for a company named Wedgewood Pacific Corporation (WPC) that contains data about company employees, department, projects, company assets, and other aspects of
Consider the database for a company named Wedgewood Pacific Corporation (WPC) that contains data about company employees, department, projects, company assets, and other aspects of company operations. For the following questions, two tables will be considered as provided below:
DEPARTMENT (DepartmentName, BudgetCode, OfficeNumber, Phone)
EMPLOYEE( EmployeeNumber, FirstName, LastName, Department, Phone, Email)
Dapartment Table:
Employee Table:
Using above tables, create SQL queries to answer the following questions: (10 marks)
a. Identify primary and foreign keys for both tables.
b. Write insert statements to enter last two records into Department table as shown in above figure.
c. Display details of all employees who work in Accounting department. Sort the results in descending order of employee last name.
d. Display BudgetCode and OfficeNumber of the department where the employee named Heather works.
e. How many employees work in Administration department?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started