Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A. Write the correct SQL codes according to the following specifications to implement three tables shown in the graph. a. Pick the appropriate data type

image text in transcribed

A. Write the correct SQL codes according to the following specifications to implement three tables shown in the graph.

a. Pick the appropriate data type for each column.

b. Implement the referential integrity.

c. Implement data integrity accoding the following requirments: 1. When EmployeeID has been changed, the EmployeeID in Certificate Table is set to null; 2. When CourseID has been changed in Course Table, the corresponding CourseID in Certificate Table will also change to match.

d. DBMS will automatically generate EmployeeID every time a new record is added to the Employee Table. The EmpoyeeID should start with 35, end at 100, increment by 2, and be a unique value.

e. The default value for DateCompleted column is the system date.

B. Write the correct SQL code to add your information into Employee Table. Use 159 as your Employee ID.

C. Write ONE correct SQL code to add your project group members into Employee Table and MIS 320 (CourseID)/Database Management Systems (CourseTitle) to Course Table. Feel free to pick EmployeeID for your group members.

D. Write the correct SQL code to add a new column DepartmentID to Employee Table with a default value of 002.

E. Wrote the correct SQL code to create a table Department with three columns DepartmentID, DepartmentName, and Branch. DepartmentName is required for each record. There are only three possible values for column Branch, i.e. Des Moines, Ames, and Iowa City, with a default value of Des Moines. However, not all departments belongs to a branch. There are one-to-many relationship between Department and Employee. One employee can only belong to one department while each department have many employees.

As a database analyst and designer, you are given the following logical schema. Based on the logical schema and requirements, write the correct SQL codes to implement the database. EMPLOYEE mployeelDEmployeNamepoeBirthDate CERTIFICATE EmployeelD CourslD DateCompleted COURSE CourselD CourseTitle

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions

Question

1. Which position would you take?

Answered: 1 week ago