Posted in Information Technology & Systems, Total Reads: 412
Definition: Primary Key
In RDBMS (relational database management system) every row in a table is uniquely identified by one key or a set of keys named as primary key. Any row that enters into the table need to have primary key or composite primary key. Each table have got just one primary key and compulsorily it should be not null.
For example in above table prof_ID is the primary key. Suppose a new professor joins the institute then compulsorily he/she will be given unique identity number by which he/she will be identified.
Quantity in Kg.
Here as same product is available on different shops and a shop can have more than one products, so it’s difficult to store items using a single primary key. In such case a set of Product_Id and Shop_Id can uniquely determine a row and hence these two create a composite primary key.