Question: Submission: Your answer document MUST show SQL statement for each question (No query results required). Copy and paste SQL statements Microsoft Word or PDF file

Submission: Your answer document MUST show SQL statement for each question (No query results required).

Copy and paste SQL statements Microsoft Word or PDF file and submit the Word or PDF file o Put question #, too.

Note: When you join tables, you may use old-style join

You can use any database software (MySQL, Oracle, SQL Server, etc.) to do this homework. I do not recommend any single-user DBMS (e.g., MS Access) because they are NOT 100% compliant to SQL standards.

Answer the following questions.

Use the operator and/or statement asked. Otherwise, you will have zero (0) point for the question.

1. Change the Salary column in the Employee table to reject nulls.

2. Change the length of the CITY column in the Employee table to 50 characters.

3. Change the department name in the Department table to Administration for the department name entitled Admin and Records.

4. Add a department in the Department table. You choose the data for the new department.

5. Delete the new department you added in #4.

6. Add foreign key constraints to Assignment table.

7. Change the column name Date_of_Birth to DOB in Dependent table.

8. Create a new table structure named dept_Locations with dept_no and location fields. You also have to put primary and foreign key constraints so that this table is connected to department table.

9. Drop the new table you created in #8.

10.Create a new table named employee_dependent table with a SELECT statement. The new table will contain the following data: employee SSN, employee first and last name, employee address, dependent name, the relationship to employee. Note: You have to use SELECT statement.

11.Create an index named LNAMEINDEX based on the field (attribute) LNAME in employee table.

12.Create a view which contains the following information: employee SSN, employee first and last name, and project name assigned to each employee. You have to use 3 tables to create this view.

13.Create a database named CBT.

Submission: Your answer document MUST show SQL statement for each question (No

query results required). Copy and paste SQL statements Microsoft Word or PDF

file and submit the Word or PDF file o Put question #,

too. Note: When you join tables, you may use old-style join You

CREATE TABLE department ( dpt_no name mgr ssn mgr start_date CHAR (2) NOT NULL PRIMARY KEY, CHAR (20) CHAR (9), DATE CREATE TABLE project ( pro_number pro_name location dpt_no CHAR (2) PRIMARY CHAR (25), CHAR (25), KEY, CHAR (2) CREATE TABLE employee ( CHAR (9) PRIMARY KEY, CHAR (25), CHAR (25) CHAR (25) CHAR (50), CHAR (25) CHAR (2), CHAR (9) DATE, decimal(7,2), CHAR (4) CHAR (1), CHAR (2), CHAR (9) emp s5n last name first name middle_name address city state date_of_birth salary parking space gender dpt_no super ssn CREATE TABLE assignment ( emp ssn pro_number work_hours PRIMARY KEY (emp ssn, pro_number) CHAR (9) NOT NULL, CHAR (2) NOT NULL , decimal(5,1), CREATE TABLE dependent( emp ssn dep name gender date_of_birth relationship CHAR(9) NOT NULL, CHAR (50) NOT NULL , CHAR (1), DATE, CHAR (10) PRIMARY KEY (emp ssn, dep_name)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!