MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Find the SQL statement below that is equal to the following:SELECT NAME FROM CUSTOMER WHERE STATE = ‘VA’;
A
SELECT NAME IN CUSTOMER WHERE STATE IN (’VA’);
B
SELECT NAME IN CUSTOMER WHERE STATE = ‘VA’;
C
SELECT NAME IN CUSTOMER WHERE STATE = ‘V’;
D
SELECT NAME FROM CUSTOMER WHERE STATE IN (’VA’);
Explanation: 

Detailed explanation-1: -Detailed Solution. Select operation is equivalent to the projection operation in relational algebra, except that select in SQL retains duplicates and on the contrary projection removes the duplicates.

Detailed explanation-2: -The correct answer to the question “Which of the SQL statements is correct” is option (b). SELECT Username, Password FROM Users. And all the other options are incorrect.

Detailed explanation-3: -Description. The SQL SELECT statement is used to retrieve records from one or more tables in your SQL database.

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.

There is 1 question to complete.