COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
SELECT NAME IN CUSTOMER WHERE STATE IN (’VA’);
|
|
SELECT NAME IN CUSTOMER WHERE STATE = ‘VA’;
|
|
SELECT NAME IN CUSTOMER WHERE STATE = ‘V’;
|
|
SELECT NAME FROM CUSTOMER WHERE STATE IN (’VA’);
|
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.