MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
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”?
A
SELECT * FROM Persons WHERE FirstName=’a’
B
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
C
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
D
SELECT * FROM Persons WHERE FirstName=’%a%’
Explanation: 

Detailed explanation-1: -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. 3.

Detailed explanation-2: -With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” is “Peter"? SELECT * FROM Persons WHERE FirstName=’Peter’; With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” starts with an “a"?

Detailed explanation-3: -Hi dear, Answer:-SELECT * FROM Persons WHERE FirstName=’Peter’ AND LastName=’Jackson’ This query selects all the records from a table named “Person…

There is 1 question to complete.