Friday , 22 November 2024

CS403 Assignments # 2 Solution Spring 2012

Assignment:

 (a). Find out the Cartesian product (D1 × D2 × D3) of the given pair of sets.                                      Marks: 5

D1 => Set of first two Vowels                  =     D=  {A, E}

D2 => Set of three country codes            =     D2 =  {213,54, 994}

D3 => Set of first three odd numbers       =     D3 =  {1, 3, 5}

(b). Keeping in view the previous assignment scenario lets suppose there is a simple database for some entities in CMS  might contain relations for Student, Class, Faculty and Enrollment. The relation schema would be written as:

Student (Stu_Id, LastName, FirstName, Major, Credits)

Faculty (Fac_Id, department, rank, name)


Class (Class_No, Fac_Id, Schedule, room)

Enrollment (Stu_Id, Class_No, Grade)

Using this sample relational schema, identify foreign key in Class relation and Composite primary key in Enrollment relation.                                                                                                                                     Marks: 5

 /****************** Assignment No. 2 : Solution **********************\

(a). Solution: D1 × D2 × D3 = 2 × 3 × 3 = 18 Subsets

Where 2 represent the number of elements in set D1,3 for D2 and again 3 for D3.

D1 × D2 × D3 = (A,213,1),(A,213,3),(A,213,5)(A,54,1), (A,54,3),( A,54,5),(A,994,1),(A,994,3),( A,994,5),

(E,213,1),(E,213,3), (E,213,5),(E,54,1),(E,54,3),(E,54,5),(E,994,1),( E,994,3),(E,994,5)

(b). Solution: 1. Keeping in mind the definition of foreign key, here Fac_Id would behave as a foreign key in Class relation as it is used as primary key in the Faculty relation. This attribute will also be used to join these two relations (Faculty and Class).

 2. Stu_Id and Class_No will jointly behave as composite primary key in Enrollment relation.

 /****************** DOWNLOAD SOLUTION FILE FROM HERE **********************\

 


Spring 2012_CS403_2

 

Check Also

CS403 Mega Collection Solved files for midterm papers by Muhammad Ishfaq

VUassignments.com is going to upload the CS403 Mega Collection files for midterm papers by Muhammad …

Leave a Reply

Your email address will not be published. Required fields are marked *

*