![]() ![]() Let us understand this by example by taking 2 tables Student and Department. This is the last key in the article on Keys in DBMS. Foreign Key in DBMSįoreign Key in DBMS is different from all the Key in DBMS which is being discussed till now, as Foreign key is applicable on 2 tables. Salary cannot be a super key as the same salary for more than 1 employee is possible, and Phone can also not be a super key as the employee may have a phone number or not, possible to have null values.Īlso, the combination of the super keys is possible in this table the possible super key is: In the above table, ID is a super key as it will be always unique because the employee ID for every employee is different and unique, Name cannot be a super key as the same name is possible for 2 different people. ![]() Super Key may contain extraneous attributes. This is the first key in the article Keys in DBMS. Super Key will not be NULL and will always be unique. It is used to uniquely identify the tuple. Super Key is like a superset, from which another key can be derived. ![]() Let’s understand each of the Keys in DBMS one by one, Super Key in DBMS There are different types of Keys in DBMS available and they are: In short, Keys in DBMS are required to identify the tuples uniquely. You can query like increment the salary of a person by 10% whose ID is 1004. The query can be written easily with the help of Keys in DBMS. the ID column in the Employee table is the key which will be unique for every single entry getting created in the database. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |