mysql> DESC shows; +--------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(50) | YES | | NULL | | | network_id | int(11) | YES | | NULL | | | network_name | varchar(30) | YES | | NULL | | +--------------+-------------+------+-----+---------+----------------+ mysql> SELECT * FROM shows; +----+----------------+------------+--------------+ | id | name | network_id | network_name | +----+----------------+------------+--------------+ | 1 | Raven's Home | 10 | Disney | | 2 | Friends | 30 | NBC | | 3 | The Good Place | 30 | NBC | | 4 | Young Sheldon | 20 | CBS | +----+----------------+------------+--------------+
In MySQL using the table above, Assume each TV show is only associated with one network: the network that originally aired it (no syndication...). And each network has many different TV shows, of course.
Convert the table shows into an equivalent collection of tables in 3NF.
Use the following table representation in your answer, where primary keys are denoted by (pk) and foreign keys are denoted by (fk):
Table_name (attribute_name (pk), attribute_name, attribute_name, attribute_name (fk), …).
For example, the table of shows currently is represented as:
shows (id (pk), name, network_id, network_name)
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Normalization in database :
First Normal Form (1NF) :
Second Normal Form(2NF) :
below are tables in 2NF.
1.Table Name :Shows
Schema :shows(Id(pk),name)
FD:id==>name
Below is table data
id | name |
1 | Raven's Home |
2 | Friends |
3 | The Good Place |
4 | Young Sheldon |
2.Table Name :network
Schema :network(network_Id(pk),network_name)
FD:network_id==>network_name
Below is table data
network_id | network_name |
10 | Disney |
20 | CBS |
30 | NBC |
Third Normal Form (3NF):
Below are tables in 3NF.
1.Table Name :Shows
Schema :shows(Id(pk),name)
FD:id==>name
Below is table data
id | name |
1 | Raven's Home |
2 | Friends |
3 | The Good Place |
4 | Young Sheldon |
2.Table Name :network
Schema :network(network_Id(pk),network_name)
FD:network_id==>network_name
Below is table data
network_id | network_name |
10 | Disney |
20 | CBS |
30 | NBC |
3.Table Name :ShowsNetwork
Schema :ShowsNetwork(id(fk),network_Id(fk))
Below is table data
id | network_id |
1 | 10 |
2 | 30 |
3 | 30 |
4 | 20 |
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
mysql> DESC shows; +--------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra...
11. Consider the following simple database with one table with the following schema: Field | Type Null key | Default | Extra auto_increment ! - I tid | int(4) NO | name varchar(30) | YES | | subji | int(2) | YES | subj2 | int(2) | YES I 1 subj3 | int(2) | YES | total | int(3) | YES PRI NULL | NULL NULL NULL NULL NULL - Transactions INSERT a tuple for a new student with the...