119k views
3 votes
Rob creates a Course_Details table that has four columns: Course_ID, Course_Name, Semester and Credits. A course may have 0.5 credit if it is for 1 semester and 1 credit if it is for 2 semesters. Which field should Rob assign as a primary key in the table?

Rob should assign the field as the primary key in this table.

User Allison A
by
8.0k points

2 Answers

2 votes
should assign to a full credit 
User NerdyNick
by
8.7k points
5 votes

Answer:

Course_ID should be the primary key

Step-by-step explanation:

In databases, the primary key of a table must be a field that identifies uniquely every record possible in that table. Most common way is to assign a number starting from 1 and incrementing every new record is added to the table.

Since primary keys cannot be duplicated, the fields Course_Name, Semester and Credits, are not good choices.

The syntax for adding a primary key is:

ALTER TABLE Course_Details ADD PRIMARY KEY (Course_ID);

User Sean Landsman
by
8.3k points