Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10-3) Please help answer a) and b) below. Test1 CREATE TABLE Test1 (name VARCHAR(20), ssn CHAR(9), dept_number INTEGER, acct_balance NUMERIC(9,2)); -- insert values into table

10-3) Please help answer a) and b) below.

Test1

CREATE TABLE Test1 (name VARCHAR(20), ssn CHAR(9), dept_number INTEGER, acct_balance NUMERIC(9,2));

-- insert values into table Insert into Test1 values('xx','yy',2,5); Insert into Test1 values('xx','yyy',2000000000,5); Insert into Test1 values('xx','yyyy',2,1234567.89);

a) Recreate Test1, which does not specify a primary key.

Populate the table with at least one duplicate ssn. Then, try to impose the PRIMARY KEY

constraint with an ALTER TABLE command. What happens? failed.

b) Recreate the Test1 table, but this time add a primary key of ssn. If you still have

the Test1 table from Exercise a0 above, you may be able to delete offending rows and add the PRIMARY

KEY constraint. Enter two more rows to your table - one containing a new ssn and one with a

duplicate ssn. What happens?

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

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago