Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN COMMAND PROMPT!!! WITH SQLITE3 Problem 1 -------------------------------------- Write a SQL script to: a) Create table A with 3 columns, one of which is a

IN COMMAND PROMPT!!! WITH SQLITE3

Problem 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. I'll be grading syntax like semicolons + proper sql statements and grading pretty strictly. Maybe -5 per syntax error and -10 for writing something that makes no sense. Your goal is to be able to write 10 or so SQL statements without making any mistakes. 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_2

Step: 3

blur-text-image_3

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

What characteristics constitute a good fraud risk assessment?

Answered: 1 week ago

Question

What are the two characteristics of a true experiment?

Answered: 1 week ago

Question

How many states do not have a sales tax?

Answered: 1 week ago