Database Modeling and Design MCQs with Answers
Practice important Database Modeling and Design MCQs with answers and explanations.
Multiple Choice Questions
Q261: Which SQL clause is used to sort the result set?
- A: ORDER BY
- B: WHERE
- C: GROUP BY
- D: HAVING
View Answer
A
Q262: What does the LIKE operator do in SQL?
- A: Searches for a specified pattern in a column
- B: Filters records based on exact match
- C: Returns unique values from a column
- D: Orders the result set
View Answer
A
Q263: What is the purpose of the IN operator in SQL?
- A: Searches for values from a given list
- B: Filters records based on a condition
- C: Groups rows together
- D: Returns the average of a column
View Answer
A
Q264: How do you find employees with 'E' in their name or names ending with 'G'?
- A: SELECT * FROM emp WHERE ename LIKE '%E%' OR ename LIKE '%-G'
- B: SELECT * FROM emp WHERE ename LIKE '%E%' AND ename LIKE '%-G'
- C: SELECT * FROM emp WHERE ename LIKE '%E%' OR ename LIKE '%G'
- D: SELECT * FROM emp WHERE ename LIKE '%E%' OR ename LIKE '%G%'
View Answer
A
Q265: What does the ROUND() function do in SQL?
- A: Rounds a numeric value to a specified number of decimal places
- B: Returns the number of rows in a table
- C: Returns the length of a string
- D: Returns the maximum value in a column
View Answer
A
Q266: What does a Cartesian product involve in SQL?
- A: Joining every row of the first table with every row of the second table
- B: Filtering rows based on conditions
- C: Combining rows from multiple tables with matching keys
- D: None of the above
View Answer
A
Q267: In a Cartesian product of two sets with 3 and 2 elements respectively, what is the total number of pairs?
- A: 3
- B: 6
- C: 9
- D: 12
View Answer
B
Q268: What is the main problem with Cartesian product in relational databases?
- A: Data duplication and loss of data integrity
- B: Incorrect join conditions
- C: Unmatched rows in the result set
- D: Slow query performance
View Answer
A
Q269: Which SQL join operation combines rows based on a common key in both tables?
- A: Cartesian Join
- B: Inner Join
- C: Outer Join
- D: Self Join
View Answer
B
Q270: How do you write a basic Inner Join query in SQL?
- A: SELECT * FROM table1, table2 WHERE table1.key = table2.key
- B: SELECT * FROM table1, table2
- C: SELECT * FROM table1 JOIN table2 ON table1.key = table2.key
- D: SELECT * FROM table1 LEFT JOIN table2 ON table1.key = table2.key
View Answer
A