About Me

My photo
Northglenn, Colorado, United States
I'm primarily a BI Developer on the Microsoft stack. I do sometimes touch upon other Microsoft stacks ( web development, application development, and sql server development).

Monday, September 25, 2006

MS ASP.Net Assessment Question: Comparing DataSet Tables

You are using the DataSet designer to create a DataSet. The DataSet contains two related tables. You create a table named Products. Products contains a VendorID column that is not unique. You also create a table named Vendors. Vendors contains a VendorID column that is the primary key.

You need to create a relationship between the two tables. Every value in the Product table's VendorID column must have a corresponding value in the Vendor table's VendorID column.

What should you do?

A)Drag a Relation object onto the designer. Set the parent table to Products. Set the child table to Vendors. Select VendorID as the column for both tables. Click Both Relation and Foreign Key Constraint.

B)Right-click the VendorID column on the Vendors table. Click Set Primary Key.

C)Drag a Relation object onto the designer. Set the parent table to Vendors. Set the child table to Products. Select VendorID as the column for both tables. Click Foreign Key Constraint Only.

D)Drag a Relation object onto the designer. Set the parent table to Products. Set the child table to Vendors. Select VendorID as the column for both tables. Click Foreign Key Constraint Only.

E)Drag a Relation object onto the designer. Set the parent table to Vendors. Set the child table to Products. Select VendorID as the column for both tables. Click Relation Only.

A) Product shouldn't be the parent table.
B) Won't solve the relationship problem.
C) Best answer, by setting the restraints, this could be used to enforced the relationship rules, so that it enforces rules about how updates and deletes to related tables are propagated.
D) Products shouldn't be the parent table.
E) There is no relation only contraint.

No comments: