Question: 2. 3. Use the create table statement to create a table named dogs with the following columns and data types name age weight owner_name

2. 3. Use the create table statement to create a table named dogs with the following columns and data types 

2. 3. Use the create table statement to create a table named dogs with the following columns and data types name age weight owner_name varchar(20) int int varchar (50) Add the following check constraints to the dogs table: the age must be greater than 0 the weight must be greater than 0 Create a table named owners with the following columns and data types. owner_name varchar (50) yrs_owned int 4. Create a primary key constraint on the owner column in the owners table and make the owner_name column the primary key. This must be done before a foreign key constraint can be created on the dogs table. 5. Create a foreign key constraint on the dogs table. The dogs table will reference the owners table through the owner_name column (a foreign key/exported key for the owner_name column in the dogs table.) 6. Test your foreign key constraint by adding a row to the owners table and then add a row to the dogs table with the same owner_name value.

Step by Step Solution

3.43 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 Create the dogs table sql CREATE TABLE dogs name VARCHAR20 age INT CHECK age 0 weight INT CHECK we... View full answer

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!