Question: I need help for SQL DDL statements. Please do not use CHATGPT. Thank you in advance Question 1 . Consider the following schema given in

I need help for SQL DDL statements. Please do not use CHATGPT. Thank you in advance
Question 1. Consider the following schema given in Figure 1 where the underlined attributes are primary keys and the arrows between relations depict the foreign key-primary key relationships. Also consider the following information about relations and give the appropriate DDL statements to create each relation.
Note: A straightforward solution would not allow you to insert tuples into EMPLOYEE and/or DEPARTMENT after creation. So, you need to be careful how you create these tables and modify them after an insertion. If you can figure out how to do this, there is a bonus of points.
1. In EMPLOYEE, Fname and Lname can vary in length with a maximum of 15 characters; Minit is a single character; SIN consist of 9 characters; Address is variable length up to 30 characters; Sex is identified as M or F; Salary is a decimal number with 10 digits and 2 digits after the decimal point; Super Id has the same specification as SIN; Dno is an integer; Bdate is of type date. For each tuple, Fname, Lname, SIN, have to be specified, and each employee has to be assigned to a department.
2. In DEPARTMENT, Dname is variable length character string with a maximum length of 15; Mgr SIN is a fixed length string of 9; Dnumber is an integer; and Mgr start date is a date. Dname and Mgr SIN have to be specified, and every department has to have a manager.
3. In DEPT LOC, Dnumber is the same as what it is in DEPARTMENT, and Dlo cation is a variable length character string of at most 15 characters. Both of these have to be specified for any tuple.
4. In PROJECT, Pname and Plocation are maximum 15-character strings; Pnumber and Dnum are integers. Pname, Pnumber and Dnum have to be specified for each tuple.
5. In WORKS ON, E SIN is a 9-character string; Pno is an integer; and Hours is a 3-digit decimal number with one digit after the decimal point. All of these have to be specified for each tuple.
6. In DEPENDENT, E SIN is the same as it is in WORKS ON; Dependent name is a character string of up to 15 characters; Sex is identified as M or F; Bdate is a date; and Relationship is a character string of up to 8 characters.
EMPLOYEE
 I need help for SQL DDL statements. Please do not use

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create the given schema in SQL using DDL statements you can follow the steps below Step 1 Create ... View full answer

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!