2023 Exam Questions 📝
1. Which of the following is not a key property of a database?
- (i) Redundancy
- (ii) Consistency
- (iii) Integrity
- (iv) Security
Answer: (i) Redundancy
Explanation: Redundancy (unnecessary data duplication) is a problem that databases aim to minimize. Consistency, integrity, and security are all desirable properties of a well-managed database.
2. Which SQL command is used to retrieve data from a database?
- (i) FETCH
- (ii) EXTRACT
- (iii) SELECT
- (iv) SEARCH
Answer: (iii) SELECT
Explanation: The SELECT statement is the standard SQL command used to query a database and retrieve data that matches the specified criteria.
3. What is a view in a database?
- (i) A virtual table based on the result of a SQL query
- (ii) A physical table containing data
- (iii) A table created temporarily during database operations
- (iv) A table that stores metadata information
Answer: (i) A virtual table based on the result of a SQL query
Explanation: A view is a stored query that acts like a table but doesn’t physically store the data itself. It’s a way to present data from one or more tables in a specific way.
4. Which SQL command is used to retrieve data from multiple tables?
- (i) JOIN
- (ii) MERGE
- (iii) COMBINE
- (iv) LINK
Answer: (i) JOIN
Explanation: The JOIN clause is used in SQL to combine rows from two or more tables based on a related column between them.
5. What is a foreign key in a relational database?
- (i) A key that uniquely identifies each row in a table
- (ii) A key that references the primary key of another table
- (iii) A key that is composed of multiple columns
- (iv) A key that is used for encryption
Answer: (ii) A key that references the primary key of another table
Explanation: A foreign key establishes a link between tables and enforces referential integrity by ensuring values in one table match values in another.
6. Which of the following SQL statements is used to add a new column to an existing table?
- (i) MODIFY TABLE
- (ii) ALTER TABLE
- (iii) ADD COLUMN
- (iv) UPDATE TABLE
Answer: (ii) ALTER TABLE
Explanation: The ALTER TABLE command is the correct DDL statement used to add, delete, or modify columns in an existing table.
7. What is the purpose of indexing in a database?
- (i) To ensure data integrity
- (ii) To reduce redundancy
- (iii) To improve query performance
- (iv) To enforce referential integrity
Answer: (iii) To improve query performance
Explanation: Indexes create special lookup tables that the database search engine can use to speed up data retrieval, much like an index in a book.
8. Which normalization form is based on the transitive dependency?
- (i) First Normal Form (1NF)
- (ii) Second Normal Form (2NF)
- (iii) Third Normal Form (3NF)
- (iv) BCNF
Answer: (iii) Third Normal Form (3NF)
Explanation: A table is in 3NF if it is in 2NF and has no transitive dependencies, which means no non-key attribute is dependent on another non-key attribute.
9. Which SQL command removes (or deletes) a relation from the database?
- (i) DELETE
- (ii) REMOVE
- (iii) DROP
- (iv) ROLLBACK
Answer: (iii) DROP
Explanation: The DROP command is used to delete entire database objects like tables (relations), whereas DELETE is used to remove rows within a table.
10. In an ER diagram, what does a double diamond represent?
- (i) A mandatory relationship
- (ii) A weak relationship
- (iii) A derived attribute
- (iv) A strong relationship
Answer: (ii) A weak relationship
Explanation: A double diamond represents an identifying relationship, which is the relationship that connects a weak entity set to its owner entity.
2022 Exam Questions 🧑💻
1. Four DML commands are:
- (i) create, update, delete, select
- (ii) insert, update, drop, select
- (iii) create, alter, delete, select
- (iv) insert, modify, delete, select
Answer: (iv) insert, modify, delete, select
Explanation: DML (Data Manipulation Language) commands handle data manipulation. CREATE, DROP, and ALTER are DDL (Data Definition Language) commands, which makes the other options incorrect.
2. View is a:
- (i) temporary table
- (ii) virtual table
- (iii) dynamic table
- (iv) permanent table
Answer: (ii) virtual table
Explanation: A view is essentially a stored query that is presented as a table. It does not contain any physical data itself.
3. The different levels of data abstraction are:
- (i) Physical level
- (ii) Logical level
- (iii) View level
- (iv) all of the above
Answer: (iv) all of the above
Explanation: The three standard levels are the Physical level (how data is stored), the Logical level (what data is stored), and the View level (what users see).
4. Which of the following is true?
- (i) a super-key is always a candidate key.
- (ii) every 3NF schema is also a BCNF.
- (iii) generalization is bottom-up approach.
- (iv) none of these.
Answer: (iii) generalization is bottom-up approach.
Explanation: Generalization is a bottom-up process where lower-level entities are combined to form a more general, higher-level entity. The reverse process, specialization, is top-down.
5. What is the purpose of project operation:
- (i) It selects certain columns.
- (ii) It selects certain rows.
- (iii) It selects certain strings.
- (iv) It selects certain integers.
Answer: (i) It selects certain columns.
Explanation: The project operation (Π) in relational algebra is used to select a subset of columns (attributes) from a table. The selection operation (σ) selects rows.
6. The weak entity set does not have sufficient attributes to form.
- (i) Primary key
- (ii) Candidate key
- (iii) Both (i) and (ii)
- (iv) Super key
Answer: (i) Primary key
Explanation: By definition, a weak entity set lacks sufficient attributes to form its own primary key and relies on its relationship with an owner entity for identification.
7. Which normal form is considered adequate for normal relational database design?
- (i) 2 NF
- (ii) 5 NF
- (iii) 4 NF
- (iv) 3 NF
Answer: (iv) 3 NF
Explanation: Third Normal Form (3NF) is generally considered the standard goal for relational database design because it eliminates most data redundancy and anomalies.
8. Which of the following is not a super key in R(V, W, X, Y, Z) with primary key VY?
- (i) VXYZ
- (ii) VWXZ
- (iii) VWXY
- (iv) VWXYZ
Answer: (ii) VWXZ
Explanation: A superkey must contain the entire primary key (VY). The set VWXZ is missing the attribute Y, so it cannot be a superkey.
9. Consider R (A, B, C, D, E) with following FDs:- A->B, A->C, CD->E, B->D E->A which of the following FDs is not implied by above set?
- (i) CD->AC
- (ii) BD->CD
- (iii) BC->CD
- (iv) AC->BC
Answer: (ii) BD->CD
Explanation: To check if BD implies C, you find the closure of BD, which is {B,D}. Since C is not in the closure of {B,D}, the dependency BD->C is not implied.
10. Which of the following is a concurrency control protocol.
- (i) Strict 2-phase locking protocol
- (ii) Timestap based protocol
- (iii) Graph based protocol
- (iv) All of the above
Answer: (iv) All of the above
Explanation: All of the options listed are valid and recognized protocols used in database systems to manage concurrent access to data.
2021 Exam Questions 💾
1. The relational model feature is that there
- (i) is no need for primary key data
- (ii) is much more data independence than some other database models
- (iii) are explicit relationships among records
- (iv) are tables with many dimensions
Answer: (ii) is much more data independence than some other database models
Explanation: The relational model separates the logical data structure from its physical storage, providing a high degree of independence from how data is physically stored and accessed.
2. Which of the following operations is used if we are interested in only certain columns of a table?
- (i) PROJECTION
- (ii) SELECTION
- (iii) UNION
- (iv) JOIN
Answer: (i) PROJECTION
Explanation: The Projection operation selects specific columns (attributes) from a table, while the Selection operation selects specific rows (tuples).
3. Which of the following is the original purpose of SQL?
- (i) To specify the syntax and semantics of SQL data definition language
- (ii) To specify the syntax and semantics of SQL manipulation language
- (iii) To define the data structures
- (iv) All of the above
Answer: (iv) All of the above
Explanation: SQL was designed as a comprehensive language for defining data (DDL), manipulating data (DML), and querying data in a relational database.
4. Which of the following is true?
- (i) B+ tree allows only the rapid random access
- (ii) B+ tree allows only the rapid sequential access
- (iii) B+ tree allows rapid random access as well as rapid sequential access
- (iv) B+ tree allows rapid random access and slower sequential access
Answer: (iii) B+ tree allows rapid random access as well as rapid sequential access
Explanation: B+ trees support fast random access via tree traversal and fast sequential access because all leaf nodes are linked together in a sequential list.
5. Transaction processing is associated with everything below, except
- (i) conforming an action or triggering a response
- (ii) producing detailed summary or exception report
- (iii) recording a business activity
- (iv) maintaining a data
Answer: (ii) producing detailed summary or exception report
Explanation: Producing summary reports is a function of analytical processing (OLAP), whereas transaction processing (OLTP) is concerned with recording and managing individual business activities.
6. Which of the following is used at the end of the view to reject the tuples which do not satisfy the condition in where clause?
- (i) With
- (ii) Check
- (iii) With check
- (iv) All of the above
Answer: (iii) With check
Explanation: The WITH CHECK OPTION clause in a CREATE VIEW statement enforces that any INSERT or UPDATE through the view must satisfy the view’s WHERE clause conditions.
7. Many applications use ____ where two independent factors are used to identify a user.
- (i) Two-factor authentication
- (ii) Cross-site request forgery
- (iii) Cross-site scripting
- (iv) Cross-site scoring scripting
Answer: (i) Two-factor authentication
Explanation: This is the definition of two-factor authentication (2FA), a security process that requires two different authentication factors to verify a user’s identity.
8. ____ allows a system administrator to associate a function with a relation; the function returns a predicate that must be added to any query that uses the relation.
- (i) OpenID
- (ii) Single-site system
- (iii) Security Assertion Markup Language (SAML)
- (iv) Virtual Private Database (VPD)
Answer: (iv) Virtual Private Database (VPD)
Explanation: This describes a feature known as Virtual Private Database (VPD), notably in Oracle, which attaches security policies to database objects to control data access dynamically.
9. The Object Query Language is which of the following?
- (i) Similar to SQL and uses a select-from-where structure
- (ii) Similar to SQL and uses a select-where structure
- (iii) Similar to SQL and uses a from-where structure
- (iv) Not similar to SQL
Answer: (i) Similar to SQL and uses a select-from-where structure
Explanation: The Object Query Language (OQL) was designed to be very similar to SQL, using the familiar SELECT…FROM…WHERE structure for querying object-oriented databases.
10. Which join refers to join records from the right table that have no matching key in the left table and are included in the result set?
- (i) Left outer join
- (ii) Right outer join
- (iii) Full outer join
- (iv) Half outer join
Answer: (ii) Right outer join
Explanation: A RIGHT OUTER JOIN returns all records from the right table and matched records from the left table. If there is no match, the left side will contain null values.
2020 Exam Questions 🏛️
1. The way a particular application views the data from the database that the application uses is a
- (i) module
- (ii) relational model
- (iii) schema
- (iv) subschema
Answer: (iv) subschema
Explanation: A schema represents the entire database structure, while a subschema (or view) defines the portion of the database that a specific application or user is interested in.
2. A relational database developer refers to a record as
- (i) a criterion
- (ii) a relation
- (iii) a tuple
- (iv) an attribute
Answer: (iii) a tuple
Explanation: In the formal relational model, a row is called a tuple, a table is a relation, and a column is an attribute.
3. Key to represent relationship between tables is called
- (i) primary key
- (ii) secondary key
- (iii) foreign key
- (iv) None of the above
Answer: (iii) foreign key
Explanation: A foreign key is a column (or set of columns) in one table that refers to the primary key in another table, thereby linking the two tables.
4. It is better to use files than a DBMS when there are
- (i) stringent real-time requirements
- (ii) multiple users wish to access the data
- (iii) complex relationships among data
- (iv) All of the above
Answer: (i) stringent real-time requirements
Explanation: The overhead associated with a DBMS (for security, concurrency, etc.) can introduce unpredictable delays, making simple file systems a better choice for hard real-time systems.
5. Which of the following are the five built-in functions provided by SQL?
- (i) COUNT, SUM, AVG, MAX, MIN
- (ii) SUM, AVG, MIN, MAX, MULT
- (iii) SUM, AVG, MULT, DIV, MIN
- (iv) SUM, AVG, MIN, MAX, NAME
Answer: (i) COUNT, SUM, AVG, MAX, MIN
Explanation: These are the five standard aggregate functions defined in SQL to perform calculations on a set of values and return a single summary value.
6. A B-tree of order 4 and of height 3 will have a maximum of ____ keys.
- (i) 255
- (ii) 63
- (iii) 127
- (iv) 188
Answer: (ii) 63
Explanation: The formula for the maximum number of keys in a B-tree is m^h – 1, where ‘m’ is the order and ‘h’ is the height (number of levels). Thus, 4³ – 1 = 64 – 1 = 63.
7. …What does rollback do?
- (i) Undoes the transactions before commit
- (ii) Clears all transactions
- (iii) Redoes the transactions before commit
- (iv) No action
Answer: (i) Undoes the transactions before commit
Explanation: The ROLLBACK command is used to undo all modifications made from the start of a transaction to the point of the rollback, restoring the database to its previous state.
8. Which of the following is used to get back all the transactions back after rollback?
- (i) Commit
- (ii) Rollback
- (iii) Flashback
- (iv) Redo
Answer: (iii) Flashback
Explanation: This is a tricky question as standard SQL has no direct “undo a rollback” command. However, “Flashback” is a specific feature in Oracle databases that can revert database objects to a previous point in time, effectively reversing changes, including those that were rolled back.
9. ____ is an attack which forces an end user to execute unwanted actions on a Web application in which he/she is currently authenticated.
- (i) Two-factor authentication
- (ii) Cross-site request forgery
- (iii) Cross-site scripting
- (iv) Cross-site scoring scripting
Answer: (ii) Cross-site request forgery
Explanation: This is the definition of Cross-Site Request Forgery (CSRF), an attack that tricks an authenticated user’s browser into performing an unwanted action on a trusted site.
10. ____ allows a system administrator to associate a function with a relation; the function returns a predicate that must be added to any query that uses the relation.
- (i) OpenID
- (ii) Single-site System
- (iii) Security Assertion Markup Language (SAML)
- (iv) Virtual Private Database (VPD)
Answer: (iv) Virtual Private Database (VPD)
Explanation: This again describes the Virtual Private Database (VPD) feature, which dynamically appends a WHERE clause to SQL statements to enforce fine-grained access control.