119k views
2 votes
Which column or columns in each table should be defined as the primary key?

1 Answer

4 votes
The question is incomplete as there is no options given;
the complete question with options is;
Which column or columns in each table should be defined as the primary key?
a.Orders: OrderID; OrderLineItems: OrderID, OrderSequence, andProductID; Products: ProductID and ProductName

b.Orders: OrderID; OrderLineItems: OrderID and OrderSequence;Products: ProductID

c.Orders: OrderID and OrderDate; OrderLineItems: OrderID andOrderSequence; Products: ProductID

d.Orders: OrderID; OrderLineItems: OrderID; Products: ProductID


Answer:
the correct option from the given options is, "b",Orders: OrderID; OrderLineItems: OrderID and OrderSequence;Products: ProductID

when you are going to create a primary key, In Object Explorer, right-click the table to which you want to add a unique constraint, and then click Design. In Table Designer tab, click the row selector for the database column you want to define as the primary key.

User Moeed
by
7.6k points