Check this document and write mysql code to create final versions of these three tasks
Task 1.
The original table “books”:
title_id title_name retail_price location_1 location_2 location_3
T02 200 Years of German Humor 19.95 New York San Francisco	 
T03 Ask Your System Administrator 39.95 Chicago	 	 
T04 But I Did It Unconsciously 12.99 Miami London New York

1NF:
The storage locations are divided into separate attributes (location_1, location_2, location_3), and we have repeating groups. Let's bring the table to 1NF:
title_id title_name retail_price location
102 200 Years of German Humor 19.95 New York
102 200 Years of German Humor 19.95 San Francisco
103 Ask Your System Administrator 39.95 Chicago
104 But I Did It Unconsciously 12.99 Miami
104 But I Did It Unconsciously 12.99 London
104 But I Did It Unconsciously 12.99 New York

2NF:
We have a table mapped to 1NF with a potential key (title_id, location). Let's look at the functional dependencies:
- title_id → title_name, retail_price (the value of title_id allows you to uniquely determine the title_name and retail_price).
- (title_id, location) → title_name, retail_price, location (the combination of title_id and location defines the entire tuple)
Let's convert the table to 2NF:
books
title_id title_name retail_price
102 200 Years of German Humor 19.95
103 Ask Your System Administrator 39.95
104 But I Did It Unconsciously 12.99

books_locations
title_id location
102 New York
102 San Francisco
103 Chicago
104 Miami
104 London
104 New York

3NF:
Identical to 2, the relationship is in 2NF and there are no transitive dependencies.

Task 2.
The original table book_author:
title_id au_id royalty_share au_phone charitable_contribution
TO2 A01 1 212-123-4567 0.01
TO3 A05 1 901-456-1234 0.01
TO7 A04 0.5 899-123-4567 0.005
TO7 A02 0.5 213-654-4567 0.005

The table is already in 1NF and has a potential key (title_id, au_id). To bring it to the 2NF, let's consider the functional dependencies:
- title_id, au_id → royalty_share, charitable_contribution: (the combination of title_id and au_id uniquely determines royalty_share and, potentially, charitable_contribution)
- au_id → au_phone (the author's phone number depends on the author (au_id), not on a particular book)
Here is the table for 2NF:
book_author
title_id au_id royalty_share charitable_contribution
TO2 A01 1 0.01
TO3 A05 1 0.01
TO7 A04 0.5 0.005
TO7 A02 0.5 0.005

author_phone
au_id au_phone
A01 <PRESIDIO_ANONYMIZED_PHONE_NUMBER>
A05 901-456-1234
A04 899-123-4567
A02 213-654-4567
3NF:
Identical to 2, the relationship is in 2NF and there are no transitive dependencies.

3 tasks.
The original table book_publisher:
title_id title_name pub_name pubdate pub_phone
T02 200 Years of German Humor Schadenfreude Press 01-04-98 112-123-9567
T03 Ask Your System Administrator Core Dump Books 01-09-00 801-457-1234
T04 But I Did It Unconsciously Abatis Publishers 31-05-99 799-523-4567

3NF.
The table is already in 1NF and 2NF. Let's look at the functional dependencies:
- title_id → title_name, pub_name, pubdate, pub_phone (title_id uniquely defines title_name, pub_name, pubdate, and pub_phone)
- pub_name → pub_phone (the phone number of the publisher depends on the name of the publisher, not on a particular book).
We have a transitive dependency title_id → pub_name → pub_phone, and we bring the table to 3NF
book_publisher
title_id title_name pub_name pubdate
T02 200 Years of German Humor Schadenfreude Press 01-04-98
T03 Ask Your System Administrator Core Dump Books 01-09-00
T04 But I Did It Unconsciously Abatis Publishers 31-05-99

publisher_phone
pub_name pub_phone
Schadenfreude Press 112-123-9567
Core Dump Books 801-457-1234
Abatis Publishers 799-523-4567