Which of the following is/are correct?
1999
Which of the following is/are correct?
- A.
An SQL query automatically eliminates duplicates
- B.
An SQL query will not work if there are no indexes on the relations
- C.
SQL permits attributes names to be repeated in the same relation
- D.
None of these
Attempted by 1400 students.
Show answer & explanation
Correct answer: D
Answer: None of these.
Explanation:
The statement that an SQL query automatically eliminates duplicates is false. SQL by default returns duplicates (it treats results as a multiset). To remove duplicates explicitly use SELECT DISTINCT, GROUP BY, or appropriate aggregation.
The statement that an SQL query will not work if there are no indexes on the relations is false. Indexes are performance aids; queries can execute without indexes (the database may do full table scans), but they may run slower.
The statement that SQL permits attribute names to be repeated in the same relation is false. Column names within a single table must be unique. Repeated names can occur across different tables or in query results (for example after joins), but those must be qualified with table names or given aliases to avoid ambiguity.
Therefore, all three given statements are incorrect, so the correct choice is None of these.
A video solution is available for this question — log in and enroll to watch it.