COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
select * from member where last ____ name="M%";
|
|
select * from member where last ____ name="M-”
|
|
Select * from member where last ____ name="M”
|
|
select * from member where last ____ name like “M%”
|
Detailed explanation-1: -With SQL, how do you select all the records from a table named “Persons” where the “LastName” is alphabetically between (and including) “Hansen” and “Pettersen"? SELECT * FROM Persons WHERE LastName BETWEEN ‘Hansen’ AND ‘Pettersen’;
Detailed explanation-2: -SELECT left(NAME, charindex(’ ‘, NAME)-1) AS ‘FirstName’, REVERSE(SUBSTRING(REVERSE(NAME), 1, CHARINDEX(’ ‘, REVERSE(NAME))-1)) AS ‘LastName’ FROM TABLE Error: Invalid length parameter passed to the LEFT or SUBSTRING function.
Detailed explanation-3: -With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”? Explanation: The SQL LIKE clause is used to compare a value to similar values using wildcard operators.
Detailed explanation-4: -SELECT * FROM <TableName>; This SQL query will select all columns and all rows from the table. For example: SELECT * FROM [Person].