On this page
The database unit is often taught as a list of SQL commands, but the one-mark questions that open it test vocabulary: what is a domain, what does cardinality count, which column is the foreign key? These are easy marks if the ideas are clear and easy to lose if the words blur together. This post builds one small database and uses it to explain every term in the syllabus, then covers the common mistakes.
What does the syllabus cover in database concepts?
The CBSE Computer Science curriculum for Class XII (2026-27) gives Unit 3, Database Management, 20 of the 70 theory marks. It begins with "introduction to database concepts and its need" and the relational data model: relation, attribute, tuple, domain, degree, cardinality, and keys (candidate, primary, alternate and foreign). The NCERT chapter is Database Concepts, which comes before the SQL chapter.
Why use a database instead of files?
NCERT starts with a school that keeps attendance in separate files and lists the problems this causes. The same guardian's phone number stored in several files is redundancy. When it is updated in one file but not another, the data become inconsistent. A database management system keeps the data in one place, applies rules to it, and answers queries.
The model behind almost every such system today is the relational model, set out by E. F. Codd in A relational model of data for large shared data banks (1970). His aim was that users and programs should not need to know how data are stored inside the machine.
What are relation, tuple, attribute and domain?
Here is a small school library database with three tables.
MEMBER(MemberID, Name, Phone, Class)
BOOK(BookID, Title, ISBN, Author)
ISSUE(BookID, MemberID, IssueDate)
In the relational model:
Relation: a table, such as MEMBER.
Attribute: a column, such as Name.
Tuple: a row, one member's details.
Domain: the set of values an attribute may take. NCERT's example is that RollNumber takes integer values. Here, Class might take only the values IX, X, XI and XII. The 2026-27 CBSE sample question paper asks for exactly this word.
Degree: the number of attributes. MEMBER has degree 4.
Cardinality: the number of tuples. If MEMBER has 3 rows, its cardinality is 3.
Adding a member changes cardinality but not degree. Adding a column changes degree but not cardinality. A sample paper question asks which of these stays the same when a record is inserted.
What rules does every relation follow?
NCERT lists three properties:
Each attribute has a unique name, and the order of attributes does not matter.
Each tuple is distinct, and the order of tuples does not matter.
All values in a column come from the same domain, each value is atomic (one phone number, not two in one cell), and NULL marks a value that is unknown or does not apply.
How do candidate, primary, alternate and foreign keys differ?
Candidate key: any attribute that identifies every row uniquely. In BOOK, both BookID and ISBN are unique, so both are candidate keys. In MEMBER, MemberID is one. Phone is not, if some members have no phone recorded, because a key cannot be NULL.
Primary key: the candidate key the designer chooses. Choose BookID for BOOK.
Alternate key: a candidate key that was not chosen. Here, ISBN.
Composite primary key: a key made of two or more attributes. In ISSUE, neither BookID nor IssueDate is unique alone, since a book is issued many times and many books are issued each day. Together, (BookID, IssueDate) identifies a row, if a book cannot go out twice on one day.
Foreign key: an attribute that refers to the primary key of another table. In ISSUE, MemberID refers to MEMBER and BookID refers to BOOK.
A foreign key stops nonsense entries. We built these tables in MySQL 8.4 and tried to record an issue for MemberID 999, which does not exist. MySQL refused with "a foreign key constraint fails". Inserting a second member with MemberID 101 failed with a duplicate entry error, and a member with no name failed because Name was declared NOT NULL.
How do degree and cardinality work in a cartesian product?
The NCERT chapter on SQL explains that the cartesian product of two tables pairs every row of one with every row of the other. Its degree is the sum of the two degrees and its cardinality is the product. With MEMBER at degree 4 and 3 rows, and BOOK at degree 4 and 4 rows, the product has degree 4 + 4 = 8 and cardinality 3 × 4 = 12. We ran the query and got 8 columns and 12 rows.
What mistakes cost marks?
Swapping degree and cardinality.
Calling any unique column the primary key. It is only a candidate until chosen.
Choosing a column that can be NULL as a key.
Putting the foreign key in the wrong table. It sits in the table that refers, here ISSUE, and points to the primary key of the table referred to.
Defining domain as "data type". A data type is usually how a domain is specified, but the domain is the set of allowed values.
A practice routine for this unit
Testing yourself beats rereading definitions: a review of study methods by Dunlosky and colleagues rated practice testing as high in usefulness and rereading as low.
Day 1: Close the book and write a one-line definition for each of the ten terms in the syllabus. Check against NCERT.
Day 2: Design three tables for a context you know, such as a cricket club or a school canteen. Mark every candidate, primary, alternate and foreign key.
Day 4: Create the tables in MySQL and try to break each rule: a duplicate key, a NULL key, a foreign key with no match.
Day 7: Do the database questions from a sample paper under time.
For the next step, our guide to SQL for CBSE writes the queries on tables like these, and connecting Python to MySQL uses them from a program. If a term still will not stick, the Fermi Concept Library covers every concept in computing, each with its own lesson.
Today, draw the three library tables on paper and label each key without looking back at this post.



