Each table in a relational database may or may not have a primary key. The primary key is a column, or set of columns, that allows each row in the table to be uniquely identified. No two rows may have the same value of a primary key.
You can select a primary key from all of the available columns. It is good practice to keep your primary key for each table as compact as possible. If possible, the primary key should be an unsigned integer data type, rather than char or varchar.
In the demo database, the SalesOrderItems table includes these columns:
An ID column that identifies the customer’s order.
A LineID column that provides an identification number for each item of the sales order.
A ProductID column that identifies the product that the customer ordered.
A Quantity column that shows how many items were ordered.
A ShipDate column that identifies the date the order shipped.
To identify a particular item, both the ID and the line LineID are required. The primary key is made up of both these columns.