erdplus modeling and sql database

1 answer below »
erdplus modeling and sql database
Answered Same DayAug 15, 2021

Answer To: erdplus modeling and sql database

Neha answered on Aug 28 2021
139 Votes
Student Name:
Student Id:
Part-A
Second normal Form
Table Train
    Train_Id
    Route
    Time
    Day
    Train_Type
    1001
    Flinders St-Frankston
    13:00-14:20
    Weekday
    Comeng
    1001
    Flinde
rs St- Frankston
    13:00-14:20
    Weekday
    Comeng
    1001
    Frankston - Flinders St
    14:30:15:50
    Weekday
    Comeng
    1002
    Flinders St-Pakenham
    13:00-14:10
    Weekend
    HCMT
    1002
    Flinders St- Pakenham
    13:00-14:10
    Weekend
    HCMT
    1002
    Pakenham-Southern Cross
    14:15-15:30
    Weekday
    HCMT
Table Driver
    Driver_Id
    Driver Name
    Skill
    Hours Per Week
    1415
    Davis
    Novice
    40
    6464
    Smith
    Experienced
    35
    3233
    Patel
    Intermediate
    30
    3155
    Wang
    Experienced
    16
    5223
    Porter
    Experienced
    16
    5642
    Gleeson
    Novice
    40
Table Trip
    Trip_Id
    Train_Id
    Driver_Id
    001
    1001
    1415
    001
    1001
    6464
    002
    1001
    3233
    003
    1002
    3155
    003
    1002
    5223
    004
    1002
    5642
Justification:
For a database to be in Second Normal Form it need be to in first normal form and it should not have a non-prime attribute dependent on any candidate key. I have converted the single table into 3 different tables. The table was already in 1NF. Earlier there were non-prime attribute present in the table which were functionally dependent on the candidate key. Those attributes are separated. The relation can have candidate key but not the dependency of non-prime attributes on them. Trip table contains Trip_Id which is a primary key and Train_Id and Driver_Id as foreign keys. Table driver contains information about the driver with a unique Driver_Id which is a primary key also. Table train contains data about trains and a primary key Train_is.
ER Diagram
Relational Schema Diagram
Part – B
    
    Question
    Answer
    Code
    1
    How many users contributed tags?
    3683
     select count(1) FROM movielens_tags where tag is NOT NULL;
    
    How many movies had exactly 3 genres...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here