Module 3
Assignment
There are two parts to this assignment, part A and B. Make sure to complete all of them.
Part A: Normalization
- Brieflyexplainwhatthe1st,2nd,and3rdnormalformsare,andidentifyeachofthesenormalformsinthe dependency diagram shown in the followingfigure:
- Use the above dependency diagram as an example; draw the dependency diagram for the following student table:
Use Microsoft Word for this part (Part A)of the assignment. When you are done, submit this document to the Module 3 Dropbox as part of the Module 3Assignment.
Part B: Write SQL command tocreate tables and make queries
Note: You are required to use Oracle Live SQL to accomplish the following tasks: 1) Copy a snippet of the result of your query and paste it in the Word document. 2) Copy your work to a notepad file, and save it as mod3Truck.sql.Submit both the Word document and the SQL file to the Module 3 Dropbox.
Three tables are related to this part of the assignment: Base, Type, Truck table. The structure of each table and associated attributes are listed below:
Table name: BASE
Primary key: BASENUM
| Attribute (Field) Name | Data Declaration |
| BASENUM | CHAR(3) |
| BASECITY | VARCHAR2(20) |
| BASESTATE | CHAR(2) |
| BASEPHON | VARCHAR2(10) |
| BASEMGR | VARCHAR2(10) |
Table name: TYPE
Primary key: TYPENUM
| Attribute (Field) Name | Data Declaration |
| TYPENUM | CHAR(1) |
| TYPEDESC | VARCHAR2(30) |
Table name: TRUCK
Primary key: TNUM
Foreign key: BASENUM, TYPENUM
| Attribute (Field) Name | Data Declaration |
| TNUM | CHAR(4) |
| BASENUM | CHAR(3) |
| TYPENUM | CHAR(1) |
| TMILES | NUMBER(7,1) |
| TBOUGHT | DATE |
| TSERIAL | VARCHAR2(20) |
1) Create these three tables with appropriate primary and foreign key declaration. The order in which these three tables are created matters in this assignment. Pay special attention to referential integrity among the tables. Create the BASE table first, then the TYPE table, and finally the TRUCK table (since the TRUCK table is the one that has foreign keys). Debug your code till it is bug free.
- Populate these three tables with the following data.
- Write SQL commands to accomplish the following tasks:
- Display truck number; buy date, mileage, and serial number of all trucks.
- Display truck number, buy date, and mileage of all trucks with Dallas as their base.
- DisplaytrucknumberandbuydateofalltruckswithDallasastheirbaseandwithmileagelowerthan30,000miles.


0 comments