For a multi-million row analytics database, which data type is most storage-efficient for storing yes/no values?
AVARCHAR(5)
BCHAR(1)
CBOOLEAN/BIT
DINT
Correct Answer:
C. BOOLEAN/BIT
EXPLANATION
BOOLEAN/BIT uses minimal storage (1 byte or bit). CHAR(1) uses 1 byte. VARCHAR(5) uses more. INT uses 4 bytes. For large datasets, storage matters significantly.
Which anomaly in unnormalized database allows insertion of duplicate partial information without main entity?
AUpdate anomaly
BInsertion anomaly
CDeletion anomaly
DReferential anomaly
Correct Answer:
B. Insertion anomaly
EXPLANATION
Insertion anomaly occurs when you cannot insert data without complete information. Update anomaly = data inconsistency on updates. Deletion anomaly = loss of data when deleting.
In a bank database with accounts table, which query correctly identifies dormant accounts (no transactions in 2 years)?
ASELECT * FROM accounts WHERE last_transaction_date > DATE_SUB(NOW(), INTERVAL 2 YEAR)
BSELECT * FROM accounts WHERE last_transaction_date < DATE_SUB(NOW(), INTERVAL 2 YEAR)
CSELECT * FROM accounts WHERE last_transaction_date = DATE_SUB(NOW(), INTERVAL 2 YEAR)
DSELECT * FROM accounts WHERE DATEDIFF(NOW(), last_transaction_date) = 730
Correct Answer:
B. SELECT * FROM accounts WHERE last_transaction_date < DATE_SUB(NOW(), INTERVAL 2 YEAR)
EXPLANATION
Dormant accounts have last_transaction_date LESS THAN 2 years ago (older). Option A finds active accounts. Option D is too strict with exact day matching.
Which of the following is a valid correlated subquery for finding employees earning more than their department average?
ASELECT * FROM emp e WHERE salary > (SELECT AVG(salary) FROM emp)
BSELECT * FROM emp e WHERE salary > (SELECT AVG(salary) FROM emp e2 WHERE e2.dept_id = e.dept_id)
CSELECT * FROM emp WHERE salary > ALL (SELECT AVG(salary) FROM emp GROUP BY dept_id)
DBoth B and C
Correct Answer:
D. Both B and C
EXPLANATION
Both B and C are valid. B is a correlated subquery (references outer query). C uses ALL operator with aggregated subquery. A is incorrect as it compares to global average.
iGET offers 26+ free Database MCQ questions covering all important topics. Each question is prepared by subject experts and comes with detailed explanations to help you understand concepts deeply, not just memorize answers.
Why prepare with iGET?
100% free access, timed mock tests, instant results with detailed analysis, topic-wise progress tracking, and bookmark feature for revision. Trusted by thousands of aspirants preparing for UPSC, SSC, Bank, Railway, NEET, JEE and other competitive exams across India.
How to use this page effectively
Start by selecting a difficulty level (Easy / Medium / Hard) or pick a specific topic from the topics strip. Attempt questions, check your answer instantly, read the explanation carefully, and bookmark tricky ones for later revision. For full exam-style practice, take a Mock Test from the right sidebar.
IGET AI
Online · Exam prep assistant
Hi! 👋 I'm your iget AI assistant.
Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯