Question: Using SQL statements. Given the following table descriptions, write a sql statement that will generate a foreign key constraint on the sales bid attribute that

Given the following table descriptions, write a sql statement that will generate a foreign key constraint on  Using SQL statements.

Given the following table descriptions, write a sql statement that will generate a foreign key constraint on the sales bid attribute that references the books bid attribute. MariaDB [ugc1201]> desc books; Field | Type | Null | Key | Default | Extra | | int(10) | YES 1 bid title | varchar (10) | YES | author | varchar(15) | YES subject | varchar(10) | YES 4 rows in set (0.006 sec) MariaDB [ugc1201]> desc sales; Field | Type sid | int (10) | YES | bid | int(10) | YES price | int (10) int (10) | YES 3 rows in set (0.006 sec) NULL NULL NULL NULL Null | Key | Default | Extra | NULL NULL NULL

Step by Step Solution

3.32 Rating (143 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Syntax ALTER TABLE ADD CONSTRAIN... 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!