CS403 — Database Management Systems: Midterm & Finalterm Solved MCQs and Subjective
CS403 Database Management Systems covers integrity constraints, normalization, the relational model, ER modelling, data flow diagrams and database users, including entity integrity, 3NF, unary relationships and the role of the database administrator. This solved post gives you 30 verified items for Virtual University of Pakistan: 10 Midterm MCQs from Lectures 1-22, 10 Finalterm MCQs from Lectures 23-45, and 5 Midterm plus 5 Finalterm subjective questions, each with its correct answer and handout reference. Practice every question instantly in the quiz for this course. Take the CS403 quiz
1. Midterm Solved MCQs
Q1. Which of the following constraints enforces entity integrity?
A) PRIMARY KEY
B) FOREIGN KEY
C) CHECK
D) NOT NULL
Correct answer: A — PRIMARY KEY
Reference: VU handout, Lecture 6 — Integrity constraints; entity integrity.
Status: Verified
Q2. Which of the following is NOT a benefit of normalization?
A) Minimize insertion anomalies
B) Minimize deletion anomalies
C) Minimize updation anomalies
D) Maximize redundancy
Correct answer: D — Maximize redundancy
Reference: VU handout, Lecture 12 — Normalization; benefits.
Status: Verified
Q3. Which of the following is true about the NOT NULL constraint?
A) Enforces domain integrity
B) Limits the values that can be placed in a column
C) Prevents any actions that would destroy links between tables
D) Enforces the uniqueness of the values in a set of columns
Correct answer: A — Enforces domain integrity
Reference: VU handout, Lecture 6 — Integrity constraints; NOT NULL.
Status: Verified
Q4. Which of the following is true about a relational schema?
A) The sequence of columns is significant
B) The sequence of rows is significant
C) Contains only derived attributes
D) Values are atomic
Correct answer: D — Values are atomic
Reference: VU handout, Lecture 5 — Relational model.
Status: Verified
Q5. A ____ relationship exists when an association is maintained within a single entity.
A) Unary
B) Ternary
C) Binary
D) Weak
Correct answer: A — Unary
Reference: VU handout, Lecture 8 — ER model; relationship degrees.
Status: Verified
Q6. Who is responsible for authorizing access to the database, for coordinating and monitoring its use?
A) Database Designer
B) Database Administrator
C) End User
D) Application Programmer
Correct answer: B — Database Administrator
Reference: VU handout, Lecture 2 — Database users; DBA.
Status: Verified
Q7. Which of the following concepts is applicable with respect to 3NF?
A) Full functional dependency
B) Any kind of dependency
C) Transitive dependency
D) Partial functional dependency
Correct answer: C — Transitive dependency
Reference: VU handout, Lecture 12 — Normalization; 3NF.
Status: Verified
Q8. Which of the following is NOT a component of a DFD (Data Flow Diagram)?
A) Data flow
B) Data store
C) External entities
D) Relationship between external entities
Correct answer: D — Relationship between external entities
Reference: VU handout, Lecture 10 — Data Flow Diagrams.
Status: Verified
Q9. A collection of related data is called a:
A) Logical model
B) Database
C) Data
D) Relational model
Correct answer: B — Database
Reference: VU handout, Lecture 1 — What is a database?
Status: Verified
Q10. In which normal form are composite attributes converted into individual attributes?
A) 4NF
B) 3NF
C) 2NF
D) 1NF
Correct answer: D — 1NF
Reference: VU handout, Lecture 12 — Normalization; 1NF.
Status: Verified
2. Finalterm Solved MCQs
Q1. SQL stands for:
A) Structured Query Language
B) Standard Query Language
C) Status Query Language
D) Sequential Query Language
Correct answer: A — Structured Query Language
Reference: VU handout, Lecture 23 — Introduction to SQL.
Status: Verified
Q2. Data Manipulation Language (DML) is the set of commands used to:
A) Create and destroy databases
B) Maintain and query a database, including updating, inserting, modifying and retrieving data
C) Grant and revoke privileges
D) Define the database schema only
Correct answer: B — Maintain and query a database, including updating, inserting, modifying and retrieving data
Reference: VU handout, Lecture 23 — SQL classification; DML.
Status: Verified
Q3. Which of the following is true about TRUNCATE?
A) It can be rolled back
B) It activates triggers
C) It is a DML command
D) It resets the identity of the table
Correct answer: D — It resets the identity of the table
Reference: VU handout, Lecture 25 — TRUNCATE command.
Status: Verified
Q4. What happens if the WHERE clause is omitted from a DELETE statement?
A) All records from the table are deleted
B) No record from the table will be deleted
C) Only the first record will be deleted
D) The statement will not execute and will give a syntax error
Correct answer: A — All records from the table are deleted
Reference: VU handout, Lecture 25 — DELETE command.
Status: Verified
Q5. Which of the following clauses allows you to sort the records in a result set?
A) WHERE
B) ORDER BY
C) FROM
D) HAVING
Correct answer: B — ORDER BY
Reference: VU handout, Lecture 24 — SQL SELECT; ORDER BY.
Status: Verified
Q6. Which of the following is used with the INSERT command to insert values in a DB table?
A) VALUES
B) SET
C) INTO
D) ADD
Correct answer: A — VALUES
Reference: VU handout, Lecture 25 — INSERT command.
Status: Verified
Q7. Which of the following is NOT an aggregate function?
A) AVG
B) SUM
C) UPPER
D) MAX
Correct answer: C — UPPER
Reference: VU handout, Lecture 24 — Aggregate functions.
Status: Verified
Q8. REVOKE is a _____ statement.
A) DML
B) DDL
C) DCL
D) TCL
Correct answer: C — DCL
Reference: VU handout, Lecture 23 — SQL classification; DCL.
Status: Verified
Q9. Which of the following statements is true about views?
A) A view is always a complete set of all the tables in a database
B) A view cannot be used for retrieving data
C) The results of using a view are not permanently stored in the database
D) Rows cannot be updated or deleted in a view
Correct answer: C — The results of using a view are not permanently stored in the database
Reference: VU handout, Lecture 28 — Views.
Status: Verified
Q10. Which of the following is one of the purposes of using DDL commands?
A) Inserting records into databases
B) Updating records in databases
C) Manipulating databases
D) Creating and destroying databases
Correct answer: D — Creating and destroying databases
Reference: VU handout, Lecture 23 — SQL classification; DDL.
Status: Verified
3. Midterm Subjective
Q1. What is a database? Differentiate between a database system and a file system.
Answer: A database is a collection of related data. A database system (DBMS) stores data in a structured way with a data model, a data dictionary and controlled access; a traditional file system stores data in separate files owned by individual programs. Differences: (i) Redundancy — file systems duplicate the same data in many files; a DBMS stores each fact once and shares it. (ii) Consistency — duplicated files drift out of sync; a DBMS keeps one consistent copy. (iii) Access — in a file system every new query needs a new program; a DBMS answers ad-hoc queries with SQL. (iv) Security and integrity — a DBMS enforces constraints, authorisation and concurrent access control; a file system provides almost none. (v) Data independence — in a DBMS the application is insulated from changes in physical storage; in a file system it is not.
Reference: VU handout, Lecture 1 — Database vs file system.
Status: Verified
Q2. Explain the ANSI/SPARC three-level database architecture.
Answer: The architecture has three levels: (i) Internal (physical) level — how the data are actually stored (files, indexes, storage structures). (ii) Conceptual (logical) level — what data are stored and what relationships exist among them, for the whole database. (iii) External (view) level — how individual users or applications see a part of the database, through views. Two mappings connect the levels (external/conceptual and conceptual/internal). The separation gives data independence: the physical storage can change without changing the conceptual schema (physical data independence), and the conceptual schema can change without rewriting every user's view (logical data independence).
Reference: VU handout, Lecture 4 — Three-level architecture.
Status: Verified
Q3. What is an ER model? Explain entities, attributes and relationships with an example.
Answer: The Entity-Relationship (ER) model describes the data of an application as entities, attributes and relationships. An entity is a thing in the real world with an independent existence, e.g. an Employee or a Department. An attribute is a property of an entity, e.g. Employee has EmpNo, Name and Salary. A relationship associates two or more entities, e.g. Employee WORKS_FOR Department. Relationships have cardinality: one-to-one (1:1), one-to-many (1:N) and many-to-many (M:N). A unary (recursive) relationship relates an entity to itself, e.g. Employee SUPERVISES Employee. The ER diagram is the conceptual design that is later mapped to relational tables.
Reference: VU handout, Lectures 7–9 — ER model.
Status: Verified
Q4. What is normalization? Explain 1NF, 2NF and 3NF with the dependencies each removes.
Answer: Normalization is the process of organising data into tables to minimise redundancy and to remove insertion, deletion and update anomalies. 1NF (First Normal Form): all attribute values are atomic — composite and multivalued attributes are broken into individual attributes and repeating groups are removed. 2NF: the relation is in 1NF and every non-prime attribute is fully functionally dependent on the whole primary key — partial dependencies (a non-prime attribute depending on only part of a composite key) are removed. 3NF: the relation is in 2NF and there is no transitive dependency — no non-prime attribute depends on another non-prime attribute. A relation in 3NF still has one anomaly class left (addressed by BCNF, where every determinant must be a candidate key).
Reference: VU handout, Lecture 12 — Normalization; 1NF, 2NF, 3NF.
Status: Verified
Q5. What is a functional dependency? What are insertion, deletion and update anomalies?
Answer: A functional dependency X → Y holds on a relation if, for any two tuples, equal X values always imply equal Y values — X determines Y. Example: EmpNo → EmpName. Anomalies arise when a table is poorly designed (un-normalized): (i) Insertion anomaly — a fact cannot be inserted without other, unrelated data (e.g. a new department cannot be added until it has an employee). (ii) Deletion anomaly — deleting a tuple loses unrelated facts (e.g. deleting the last employee of a department loses the department's data). (iii) Update anomaly — the same fact stored in many rows must be changed in all of them, and a missed row leaves the database inconsistent. Normalization to 3NF removes these anomalies.
Reference: VU handout, Lecture 11 — Functional dependencies; anomalies.
Status: Verified
4. Finalterm Subjective
Q1. Differentiate between COMMIT and ROLLBACK.
Answer: COMMIT and ROLLBACK are transaction control (TCL) commands. COMMIT saves the changes made by the current transaction permanently in the database — after a COMMIT the changes cannot be undone. ROLLBACK undoes the changes made by the current transaction, restoring the database to its state at the start of the transaction (or to a savepoint). Example: after DELETE FROM emp WHERE id = 5;, COMMIT; makes the deletion permanent, while ROLLBACK; brings the row back. In the archive's solved file the same contrast is given for DELETE vs TRUNCATE: after DELETE you need COMMIT or ROLLBACK, while TRUNCATE cannot be rolled back.
Reference: VU handout, Lecture 33 — Transactions; COMMIT and ROLLBACK.
Status: Verified
Q2. Differentiate between the DELETE and TRUNCATE commands.
Answer: DELETE is a DML command that removes rows from a table, one row at a time, logging each deletion; it can have a WHERE clause, can be rolled back, fires triggers, and does not reset the identity counter. TRUNCATE is a DDL command that removes all rows from a table by deallocating the data pages: it is faster and uses fewer log resources, cannot be used with a WHERE clause, cannot be rolled back, does not fire triggers, cannot be used on a table referenced by a FOREIGN KEY, and resets the identity counter to its seed. Use DELETE when you need to remove selected rows or need rollback; use TRUNCATE to empty a whole table quickly.
Reference: VU handout, Lecture 25 — DELETE; TRUNCATE.
Status: Verified
Q3. Write three benefits of using VIEWS.
Answer: (i) Views focus, simplify and customise the perception each user has of the database — each user sees only the data relevant to their task, and unnecessary data can be left out. (ii) Views are a security mechanism — users can be given access to data through a view without being granted permission to access the underlying base tables directly. (iii) Views simplify queries — a complex join or aggregation can be defined once as a view and then queried as if it were a table. A view's results are not stored permanently; they are computed from the base tables when the view is queried.
Reference: VU handout, Lecture 28 — Views.
Status: Verified
Q4. What is a transaction? Explain the ACID properties.
Answer: A transaction is a logical unit of work — a sequence of database operations that must be executed as a whole (e.g. transferring money: debit one account and credit another). The ACID properties are: Atomicity — the transaction executes entirely or not at all (all or nothing); if it fails, its partial effects are rolled back. Consistency — a transaction takes the database from one consistent state to another, preserving integrity constraints. Isolation — concurrent transactions behave as if they ran one at a time; intermediate results of one transaction are invisible to others. Durability — once a transaction commits, its changes survive permanently, even after a system crash.
Reference: VU handout, Lecture 33 — Transactions; ACID properties.
Status: Verified
Q5. What is hashing? How does it provide fast access to records?
Answer: Hashing is a technique that maps a key value to a storage address using a hash function, so a record can be found directly without scanning an index or the file sequentially. Example: hash(EmpNo) = EmpNo mod 100 gives the bucket number; the record is stored in (or pointed to from) that bucket. It provides rapid, non-sequential, direct access to records — typically one disk access instead of a search. Its costs are collisions (two keys hashing to the same bucket, handled by chaining or open addressing) and the difficulty of range queries, which hashing does not support well.
Reference: VU handout, Lecture 30 — Indexing and hashing.
Status: Verified
Frequently asked questions
Is the Midterm from Lectures 1-22?
Yes — Midterm covers Lectures 1-22 and Finalterm covers Lectures 23-45.
Does the quiz work from this post?
Yes — use the 'Take the CS403 quiz' link above; the quiz is already live for this course.
Are the answers verified?
Yes — all 30 items are marked Verified, solved independently and cross-checked against at least two independent sources.
More Solved Papers
See the Solved MCQs page and the midterm and finalterm mega hubs for solved papers for every subject.

Comments
Post a Comment