MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which command is used to select only one copy of each set of duplicate rows.
A
Select distinct
B
Select Unique
C
Select different
D
All of the above
Explanation: 

Detailed explanation-1: -In SQL, which command is used to SELECT only one copy of each set of duplicable rows. Answer : SELECT DISTINCT.

Detailed explanation-2: -The SELECT DISTINCT statement is used to return only distinct (different) values. Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.

Detailed explanation-3: -Answer: Distinct command is used to select only one copy of each set of duplicable rows .

Detailed explanation-4: -To select duplicate values, you need to create groups of rows with the same values and then select the groups with counts greater than one. You can achieve that by using GROUP BY and a HAVING clause.

There is 1 question to complete.