Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
CS 122A: Introduction to Data Management
Homework 2: E/R and Relational Translation (100 Points)
Submission
ER Schema Design [100 pts]
If you see any opportunities to avoid creating excess relations that stem from relationships, avoid them so as to make the relations simpler. Clearly list all of the relations and their attributes (including their types), primary keys and foreign keys (including referenced target relations) by creating a SQL DDL statement for each table. As a result, your design shouldcapture the information and constraints of the ER diagram as faithfully as possible. For types, use one of the following types for each column.
Category |
Type |
Remark |
NUMBER |
INTEGER |
A number type for integer values |
DECIMAL(x,y) |
A number type for real values where x is the maximum number of digits and y is the number of digits to the right of the decimal point. |
|
STRING |
CHAR(n) |
A fixedlength string type where n represents the column length. |
VARCHAR(n) |
A variablelength string type where n represents the maximum column length. |
|
DATETIME |
DATE |
A type that is used for values with a date part but no time part. The format is '00000000'. |
TIME |
A type that is used for values with time part. The format is '00:00:00'. |
|
DATETIME |
A type that is used for values that contain both date and time parts. The format is '00000000 00:00:00'. |
(a) [50pts] List the tables and columns in your design.
(b) [25pts] For each table, identify its primary key column(s).