← RGPV CS-502 DBMS June 2026 solved question paper
← RGPV CS-502 DBMS December 2025 solved question paper
← RGPV CS-502 DBMS May 2024 solved question paper
← RGPV CS-502 DBMS November 2019 solved question paper
RGPV CS-502 (GS) | June 2026 | Q3(a) | 7 marks (inferred)
Question (restated): Explain relational database schemas, keys and referential integrity.
Answer

A relation is a set of tuples over named attributes with specified domains. A relation schema describes its name, attributes and constraints; an instance is its current data. For example Department(DeptID, DeptName) and Student(StudentID, Name, DeptID) are schemas. The number of attributes is degree and the number of tuples is cardinality.
A superkey uniquely identifies tuples; a candidate key is a minimal superkey. A primary key is the selected candidate key and alternate keys are the remaining candidates. A composite key contains multiple attributes. A foreign key references a candidate or unique key of another relation (or the same relation). Entity integrity prohibits null primary key components. Domain integrity restricts permitted values.
Referential integrity requires each non-null foreign key value to match a referenced key, subject to SQL composite-key null rules. If Department contains (10, CSE) and (20, ECE), Student(1, Asha, 10) is valid, but a student referencing department 99 is rejected unless that department exists. Deletion policies include RESTRICT, CASCADE and SET NULL when nullable.
CREATE TABLE Department (DeptID INT PRIMARY KEY, DeptName VARCHAR(50));CREATE TABLE Student (StudentID INT PRIMARY KEY, Name VARCHAR(50), DeptID INT NOT NULL REFERENCES Department(DeptID));
These constraints prevent orphan records and make joins meaningful. Keys should be selected according to stable identity, not accidental uniqueness in sample data. A schema may contain both natural and surrogate keys.
December 2025 – Q3(a)
Question (restated): Explain relations, attributes, tuples, domains and keys.
A relation is a set of tuples defined over named attributes and their domains. A tuple represents one fact or record. An attribute is a named column, and its domain specifies permitted values, such as integers between 0 and 100 for Marks. The degree of a relation is its number of attributes; cardinality is its number of tuples.
| RollNo | Name | Marks |
|---|---|---|
| 101 | Asha | 75 |
| 102 | Ravi | 58 |
The example has degree three and cardinality two. A superkey uniquely identifies tuples; a candidate key is a minimal superkey. One candidate key is selected as the primary key; remaining candidate keys are alternate keys. A composite key contains multiple attributes. A foreign key references a candidate key in another or the same relation.
Entity integrity requires primary key values to be non-null. Referential integrity prevents a non-null foreign key from referencing a nonexistent parent. Domain constraints restrict permitted values. Mathematical relations are unordered sets without duplicate tuples, whereas SQL tables may contain duplicates unless constraints or DISTINCT eliminate them.
May 2024 — Q2(b)
Question (restated): Explain integrity constraints with suitable examples.
Answer
Integrity constraints restrict legal database states. Domain constraints restrict values to their permitted types or ranges, such as Marks between 0 and 100. Entity integrity requires primary key values to be unique and non-null. Key constraints prevent duplicate candidate key values. Referential integrity requires a non-null foreign key to match an existing referenced key. A NOT NULL constraint requires a value; CHECK expresses a row predicate. Business rules spanning multiple rows may require transactions, triggers or other database-supported mechanisms. SQL CHECK alone does not reject NULL when the predicate evaluates to unknown, so combine it with NOT NULL when required. For example, a student must reference an existing department, and deletion of that department may be restricted or cascaded according to the chosen policy. Constraints are enforced on writes and protect data even when multiple applications share the database.
CREATE TABLE Department (DeptID INTEGER PRIMARY KEY); CREATE TABLE Student (RollNo INTEGER PRIMARY KEY, DeptID INTEGER REFERENCES Department(DeptID), Marks INTEGER NOT NULL CHECK (Marks BETWEEN 0 AND 100));

November 2019 – Question 2(b)
Question (restated): Explain primary keys, foreign keys and integrity constraints.
Answer
A primary key uniquely identifies each tuple and cannot be null. A foreign key references a candidate key declared unique in another or the same table; non-null references must match an existing referenced value. Domain constraints restrict values, entity integrity protects primary keys, and referential integrity prevents orphan references.
CREATE TABLE Department (id INT PRIMARY KEY); CREATE TABLE Employee (id INT PRIMARY KEY, dept INT REFERENCES Department(id), salary DECIMAL(12,2) CHECK (salary >= 0));
Inserting an employee with a nonexistent department violates referential integrity. A nullable foreign key can represent an optional relationship.
← RGPV CS-502 DBMS June 2026 solved question paper
← RGPV CS-502 DBMS December 2025 solved question paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion