Informatics Practices
Define the term Primary Key in a database. Explain how it is different from a Candidate Key.
Relational Database
2 Likes
Answer
A primary key is a set of one or more attributes/fields that can uniquely identify tuples/rows within the relation (table). It must contain unique values and cannot be null.
A candidate key, on the other hand, refers to all the attributes in a relation that are candidates or are capable of becoming a primary key. A table can have multiple candidate keys, but only one of them is chosen as the primary key.
Answered By
3 Likes
Related Questions
What is Internet and how does it differ from World Wide Web (WWW)?
Explain the concept of browser cookies and mention one advantage of using them.
Mention two health concerns associated with excessive use of Digital Devices.
Sneha is writing a Python program to create a DataFrame using a list of dictionaries. However, her code contains some mistakes. Identify the errors, rewrite the correct code, and underline the corrections made.
import Pandas as pd D1 = {'Name': 'Rakshit', 'Age': 25} D2 = {'Name': 'Paul', 'Age': 30} D3 = {'Name': 'Ayesha", 'Age': 28} data = [D1, D2, D3) df = pd.Dataframe(data) print(df)