The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+23 votes

Which of the following is/are correct?

  1. An SQL query automatically eliminates duplicates
  2. An SQL query will not work if there are no indexes on the relations
  3. SQL permits attribute names to be repeated in the same relation
  4. None of the above
asked in Databases by Veteran (59.5k points)
edited by | 2.3k views

1 Answer

+27 votes
Best answer

SQL wont remove duplicates like relational algebra projection, we have to remove it explicilty by distinct.

If there are no indexes on the relation SQL will either chose one/more on its own or simply work without any index. No index would just slow the query but it will surely work.

SQL does not permit 2 attributes to have same name in a relation.
answered by Active (3.3k points)
selected by
It say no indexes are present on relation I think !
Someone explain Option B
sql query will definitely work even without creating any indexes on any columns. Only it might be slow.

A. Sql doesn't eliminate duplicate rows like relational eliminate duplicate row we need to use DISTINCT keyword with SELECT in SQL

B. Every table requires a primary key for performance. If you don’t have a primary key in any table, your tables don’t follow standard SQL requirements and performance suffers. Primary keys are automatically set as clustered indexes, which speeds up queries. They are always unique, so you can use an auto-incremented numeric value if you have no other column in the table that meets the unique requirement.

C. SQL not permits attributes names to be repeatedin the same relation

Therefore option D is correct.

Answer will be C.

Relational model does not permit but SQL is permit to have duplicate attribute name.

Refer : 

Under this heading 

  • SQL and the relational model
  1. Duplicate column names
@Anu007 it is mentioned in the wiki tht you provided is that only few database servers allow column to be same names,and it is very uncommon

It must be false because standard SQL servers don't allow column name to be same.
0 both contradict , verify pls

Even if one DBMS is not allowing attributes names not to be repeated, u can not say that option C is true.

Only option D is correct...


what contradiction u r facing??

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

38,017 questions
45,508 answers
48,733 users