Question: This exercise is based on the data sets associated with Figure 2.25 in Chapter 2. a. Use the SQL Data Definition Language to create a
a. Use the SQL Data Definition Language to create a relational schema that consists of the following three relations:
COMPANY (Co_name, Co_size, Co_headquarters)
STUDENT (St_name, St_major, St_status)
INTERNSHIP (In_co_name, In_st_name, In_year, In_qtr, In_location, In_stipend)
When you create a table for each relation, in addition to defining its primary key, define all the appropriate referential integrity constraints. Assume that Co_name is a character data type of size 5, Co_size is an integer data type of size 4, Co_headquarters is a character data type of size 10, St_name is a Varchar data type of size 10, St_major is a character data type of size 20, St_status is a character data type of size 2, In_co_name is a character data type of size 5, In_st_name is a Varchar data type of size 10, In_year is an integer data type of size 4, In_qtr is a character data type of size 10, In_location is a character data type of size 15, and In_stipend is an integer data type of size 4. In_stipend represents the monthly stipend associated with the internship.
b. Use the SQL Insert statement to populate the three tables with the following data:
-1.png)
-2.png)
-3.png)
Co name Co size Co headquarters 1000 Boston 500 Chicago 1000 Boston 400 Houston St name St major St status SR JR Michelle Communications Chris Chemistry Andy Finance SO Anna Communications SR Amy Communications FR In co name In st name In _year 2014 2014 2014 2014 2014 In qtr Fall Fall In location In stipend Chris 1000 Anna Concord 1000 Chris Fall Concord 600 Fall South Bend 900 Andy Spring Spring Spring South Bend 1000 Chris 2013 1200 Anna 2014
Step by Step Solution
3.45 Rating (158 Votes )
There are 3 Steps involved in it
St echo on Set feedback on Drop table company cascade constraints Drop table student cascade constra... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
887-CS-DB (2218).docx
120 KBs Word File
