AmbifulWorksheets
Cheat sheet
CBSE · Class 12 · Computer Science

Database Concepts

Why a DBMS is better than a file system, and the relational model: relation, attribute, tuple, domain, degree and cardinality, and candidate, primary, alternate and foreign keys.

Key ideas

Remember

Degree and cardinalitya table of 6 columns and 20 rows: degree 6, cardinality 20
Adding to a tablea new row adds 1 to the cardinality; a new column adds 1 to the degree
Key testunique in every row and never NULL: Marks or City, which repeat, cannot be keys
Alternate keysthe candidate keys minus the one chosen as the primary key
Foreign keySTUDENT(RollNo, Name, ClassID): ClassID refers to the primary key of CLASS
Schemathe design of a database: its relations, attributes and constraints

Watch out

Worked example

In a relation STUDENT, the attributes AdmNo, RollNo, Email each have unique values for every student and are never NULL. AdmNo is chosen as the primary key. Name (a) the candidate keys (b) the alternate keys.

Working: every attribute that can identify a tuple is a candidate key; those not chosen are alternate keys

Answer: (a) AdmNo, RollNo, Email; (b) RollNo, Email