Question: 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



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 first two records into Department table as shown in above figure.
c. Display a list that presents the data contained in Department table sorted by Department Name in descending order.
d. Display all of the data from both tables for Production department.
e. How many employees belong to either Information Systems or Legal department?
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: DepartmentName BudgetCode Office Number Phone Administration BC-100-10 BLDG01-300 360-285-8100 Legal BC-200-10 BLDG01-200 360-285-8200 Accounting BC-300-10 BLDG01-100 360-285-8300 Finance BC-400-10 BLDG01-140 360-285-8400 Human Resources BC-500-10 BLDG01-180 360-285-8500 Production BC-600-10 BLDG02-100 360-287-8600 Marketing BC-700-10 BLDG02-200 360-287-8700 InfoSystems BC-800-10 BLDG02-270 360-287-8800 Employee Table: EmployeeNumber FirstName LastName Department Phone (AutoNumber] Mary Jacobs Administration 360-285-8110 (AutoNumber] Rosalie Jackson Administration 360-285-8120 [AutoNumber] Richard Bandalone Legal 360-285-8210 (AutoNumber] Tom Caruthers Accounting 360-285-8310 (AutoNumber) Heather Jones Accounting 360-285-8320 [AutoNumber] Mary Abernathy Finance 360-285-8410 [AutoNumber] George Smith Human Resources | 360-285-8510 [AutoNumber] Tom Jackson Production 360-287-8610 (AutoNumber] George Jones Production 360-287-8620 [AutoNumber] Ken Numoto Marketing 360-287-8710 (AutoNumber] James Nestor InfoSystems (AutoNumber] Rick Brown InfoSystems 360-287-8820
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
