Skip to main content
Home
  • Tutorials
    • Quality Assurance
    • Software Development
    • Machine Learning
    • Data Science
  • About Us
  • Contact
programsbuzz facebook programsbuzz twitter programsbuzz linkedin
  • Log in

Main navigation

  • Tutorials
    • Quality Assurance
    • Software Development
    • Machine Learning
    • Data Science
  • About Us
  • Contact

Candidate key and Alternate key in DBMS

Profile picture for user akshita.goel
Written by akshita.goel on 11/29/2021 - 08:52

Let's consider the topics with a basic example. Suppose we have a student table, that contains data for name, class, the section of students. Now, if we want to check data for students with a name, there might be the same names carried by two different students, or to make it more complex, there might be the case where 2 different students with the same name, class, and section exist. 

How can those two entries be uniquely identified? 

It can be done by introducing a new column into a table, that contains unique values. For students, the unique values can be considered as:

  1. Roll No.
  2. Adhar Number
  3. admission Number
  4. Student_ID
  5. Pan number
  6. Email ID

and a few more. Now, the above-mentioned list is nothing but a bucket of Candidate keys. Therefore it can be said that:

'Candidate Keys are nothing but a set of columns that has the capability to uniquely identify tuples or rows in a table.'

Now as we have a set of candidate keys, we choose one key that satisfies most with the situation, as a Primary key. Therefore, the keys that are in the bucket of candidate keys but not selected as a Primary Key are considered as Alternative Keys. For instance, you consider Roll No as a Primary key from the set of candidate keys the other ones that are Adhar Number, admission Number, Student_ID, Pan Number and  Email ID are Alternate Keys.

Related Content
Database Fundamentals Tutorial
Database Schema and Instances
Implicit Properties of Database
  • Log in or register to post comments

Choose Your Technology

  1. Agile
  2. Apache Groovy
  3. Apache Hadoop
  4. Apache HBase
  5. Apache Spark
  6. Appium
  7. AutoIt
  8. AWS
  9. Behat
  10. Cucumber Java
  11. Cypress
  12. DBMS
  13. Drupal
  14. GitHub
  15. GitLab
  16. GoLang
  17. Gradle
  18. HTML
  19. ISTQB Foundation
  20. Java
  21. JavaScript
  22. JMeter
  23. JUnit
  24. Karate
  25. Kotlin
  26. LoadRunner
  27. matplotlib
  28. MongoDB
  29. MS SQL Server
  30. MySQL
  31. Nightwatch JS
  32. PactumJS
  33. PHP
  34. Playwright
  35. Playwright Java
  36. Playwright Python
  37. Postman
  38. Project Management
  39. Protractor
  40. PyDev
  41. Python
  42. Python NumPy
  43. Python Pandas
  44. Python Seaborn
  45. R Language
  46. REST Assured
  47. Ruby
  48. Selenide
© Copyright By iVagus Services Pvt. Ltd. 2023. All Rights Reserved.

Footer

  • Cookie Policy
  • Privacy Policy
  • Terms of Use