Informatics Practices
Assertion (A): DISTINCT clause must be used in an SQL statement to eliminate duplicate rows.
Reasoning (R): DISTINCT only works with numeric data type only.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Relational Database
2 Likes
Answer
A is true but R is false.
Explanation
The DISTINCT clause is used to remove duplicate rows from the results of a SELECT statement. It retrieves only unique values for a column in the table. The DISTINCT keyword in SQL can be used with any data type.
Answered By
3 Likes
Related Questions
Assertion (A): SQL has efficient mechanisms to retrieve data stored in multiple tables in a MySQL database.
Reasoning (R): The SQL statement CREATE is used to retrieve data from the tables in a database and is also called query statement.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Assertion (A): The SQL keyword Like is used with wildcards only.
Reasoning (R): '_' underscore and "%" per cent are the two wildcard characters used with LIKE clause.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Assertion (A): FLOAT and DOUBLE are data types.
Reasoning (R): Both can hold any number up to 23 digits.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Kunal has entered the following SQL command in the table 'STUDENT' that has TotalMarks as one of the columns:
SELECT * FROM Student; #Statement-1
The total number of rows displayed is 20.
Then Kunal enters the following command:
SELECT * FROM STUDENT WHERE TotalMarks < 100; #Statement-2
The number of rows displayed is 15.
Kunal then enters the following command:
SELECT * FROM STUDENT WHERE TotalMarks >= 100; #Statement-3
He predicts the output of the above query as 5. Do you agree with Kunal? Give reasons for your answer.