Skip to main content

Database Modeling and Design MCQs with Answers

Practice important Database Modeling and Design MCQs with answers and explanations.

Multiple Choice Questions

Q271: What does a Self-Join allow you to do?
  • A: Join a table with itself to compare values
  • B: Join two different tables based on a common key
  • C: Join tables and include all rows regardless of matching keys
  • D: None of the above
View Answer
A

Q272: Which SQL statement represents a Self-Join on the Customer table?
  • A: SELECT a.ID, b.NAME FROM CUSTOMER a, CUSTOMER b WHERE a.SALARY < b.SALARY
  • B: SELECT a.ID, b.NAME FROM CUSTOMER a, CUSTOMER b WHERE a.ID = b.ID
  • C: SELECT a.ID, b.SALARY FROM CUSTOMER a, CUSTOMER b WHERE a.NAME = b.NAME
  • D: SELECT a.ID, b.AGE FROM CUSTOMER a, CUSTOMER b WHERE a.SALARY = b.SALARY
View Answer
A

Q273: An Outer Join in SQL ensures that:
  • A: Only matching rows are returned
  • B: All rows from both tables are returned, including non-matching rows
  • C: Only rows with NULL values are returned
  • D: Only rows with matching keys are returned
View Answer
B

Q274: In a Left Outer Join, which rows are included in the result?
  • A: All rows from the right table, even if there is no match
  • B: All rows from the left table, including those with no match in the right table
  • C: Only rows with matching keys in both tables
  • D: Only rows from the right table with non-NULL values
View Answer
B

Q275: What is the primary difference between Left Outer Join and Right Outer Join?
  • A: The table from which all rows are included is different in each join
  • B: The type of rows returned is different
  • C: The join condition is different
  • D: The result set is different
View Answer
A

Q276: When using a Right Outer Join, what happens if there are no matching rows in the left table?
  • A: NULL values appear for the columns from the left table
  • B: All rows from the left table are included
  • C: Only matching rows are included
  • D: No rows are returned
View Answer
A

Q277: What is the purpose of a subquery in SQL?
  • A: To join tables based on a common key
  • B: To select data rows for criteria developed during query execution
  • C: To combine rows from multiple tables with matching keys
  • D: To filter rows based on specific conditions
View Answer
B

Q278: How is a subquery typically used in a SQL statement?
  • A: In the FROM clause
  • B: As part of the JOIN operation
  • C: In the WHERE clause
  • D: As part of the SELECT clause
View Answer
C

Q279: The Cartesian Product of two sets, A and B, where A has 4 elements and B has 5 elements, will have how many pairs?
  • A: 9
  • B: 20
  • C: 15
  • D: 25
View Answer
B

Q280: Which join operation is used when you need to include all rows from one table and matching rows from another table, even if some rows in the second table do not match?
  • A: Inner Join
  • B: Outer Join
  • C: Self Join
  • D: Cross Join
View Answer
B

Test Your Knowledge

Take a timed quiz on Database Modeling and Design

🚀 Start Quiz Now