Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started