Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

What qualities do you see as necessary for your line of work?

Answered: 1 week ago