MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which keyword allows us to find the unique values in the database?
A
DIFF
B
UNIQUE
C
FIND
D
DISTINCT
Explanation: 

Detailed explanation-1: -The DISTINCT keyword in SQL is used to fetch unique records and eliminates the duplicate records in the table.

Detailed explanation-2: -The SQL DISTINCT keyword is used in conjunction with the SELECT statement to eliminate all the duplicate records and fetching only unique records.

Detailed explanation-3: -The distinct keyword is used in conjunction with select keyword. It is helpful when there is a need of avoiding duplicate values present in any specific columns/table. When we use distinct keyword only the unique values are fetched. Syntax : SELECT DISTINCT column1, column2 FROM table name.

Detailed explanation-4: -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-5: -DISTINCT keyword in SQL eliminates all duplicate records from the result returned by the SQL query. The DISTINCT keyword is used in combination with the SELECT statement. Only unique records are returned when the DISTINCT keyword is used while fetching records from a table having multiple duplicate records.

There is 1 question to complete.