Question: Using sqlite3 1) Write a SQL script to: a) Create table A with 3 columns, one of which is a primary key. b) Create table

Using sqlite3 1) Write a SQL script to: a) Create table A with 3 columns, one of which is a primary key. b) Create table B with 3 columns, one of which is a primary key and another of which is a foreign key referencing the primary key in table A. c) Insert 2 rows in table A d) Insert 2 rows into table B e) Criteria for (c) and (d): The tables should have "referential integrity"! I.e. The foreign keys in table B should have corresponding values in table A. What does that mean? If the primary keys are "1" and "2" in table A, then the corresponding foreign keys should be "1" and "2". f) Alter table B to add a NON NULL column to it, and provide a DEFAULT value for the column. g) Alter table A to rename it "C". h) Inner join table C and table B. Problem 2 -------------------------------------- a) Define first normal form, give an example of a small table that violates 1NF, and explain why it isn't in 1NF. b) Define second normal form, give an example of a small table that violates 2NF, and explain why it isn't in 2NF. c) Define third normal form, give an example of a small table that violates 3NF, and explain why it isn't in 3NF.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!