Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Consider the following schema given in Figure where the underlined attributes are primary keys and the arrows between relations depict the foreign keyprimary 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 andor 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.
In EMPLOYEE, Fname and Lname can vary in length with a maximum of characters; Minit is a single character; SIN consist of characters; Address is variable length up to characters; Sex is identified as M or F; Salary is a decimal number with digits and 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.
In DEPARTMENT, Dname is variable length character string with a maximum length of ; Mgr SIN is a fixed length string of ; 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.
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 characters. Both of these have to be specified for any tuple.
In PROJECT, Pname and Plocation are maximum character strings; Pnumber and Dnum are integers. Pname, Pnumber and Dnum have to be specified for each tuple.
In WORKS ON E SIN is a character string; Pno is an integer; and Hours is a digit decimal number with one digit after the decimal point. All of these have to be specified for each tuple.
In DEPENDENT, E SIN is the same as it is in WORKS ON; Dependent name is a character string of up to characters; Sex is identified as M or F; Bdate is a date; and Relationship is a character string of up to characters.
EMPLOYEE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started