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

The database will be named WPC and will contain the following four tables: DEPAR

ID: 3835983 • Letter: T

Question

The database will be named WPC and will contain the following four tables: DEPARTMENT (DepartmentName. BudgetCode. OfficeNumber. Phone) 1. Write a CREATE TABLE statement for the DEPARTMENT table. 2. Write an AL TER statement to add the column AreaCode to EMPLOYEE Assume that AreaCode is not required. 3. Write an AL TER statement to make Phone an alternate key in EMPLOYEE. 4. Write an UPDATE statement to change the phone number of employee with EmployeeNumber 11 to 360-287-8810. 5. Write an UPDATE statement to change the department of employee with EmployeeNumber 5 to Finance. 6. Write an SQL statement to create a view named EmployeePhoneView that shows the values of EMPLOYEE.LastName as EmployeeLastName, EMPLOYEE.FirstName as EmployeeFirstName, and EMPLOYEE. Phone as EmployeePhone. Write one DELETE statement that will delete alt data for project "2013 Q3 Product Plan" and all of its rows in ASSIGNMENT.

Explanation / Answer

1. CREATE TABLE DEPARTMENT;

2. ALTER TABLE EMPLOYEE ADD AreaCode Char(3) NULL;

3. ALTER TABLE EMPLOYEE ADD CONSTRAINT EMPLOYEE_AK2 UNIQUE(Phone);

4. UPDATE EMPLOYEE SET Department = 'Marketing', Phone = '360-287-8810' WHERE EmployeeNumber = 11;

5.UPDATE EMPLOYEE SET Department = 'Finance' WHERE EmployeeNumber = 5;

6. CREATE VIEW EmployeePhoneView AS SELECT LastName AS EmployeeLastName , LastName AS EmployeeFirstName , Phone AS EmployeePhone FROM EMPLOYEE ;

DELETE FROM PROJECT WHERE ProjectName = '2013 Q3 Product Plan';

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