COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
SELECT * FROM Persons WHERE FirstName<>’Peter’ AND LastName<>’Jackson’
|
|
SELECT FirstName=’Peter’, LastName=’Jackson’ FROM Persons
|
|
SELECT * FROM Persons WHERE FirstName=’Peter’ AND LastName=’Jackson’
|
|
None of the above
|
Detailed explanation-1: -Hi dear, Answer:-SELECT * FROM Persons WHERE FirstName=’Peter’ AND LastName=’Jackson’ This query selects all the records from a table named “Person…
Detailed explanation-2: -With SQL, how do you select all the records from a table named “Persons” where the “FirstName” is “Peter” and the “LastName” is “Jackson"? SELECT * FROM Persons WHERE FirstName=’Peter’ AND LastName=’Jackson’;
Detailed explanation-3: -2. 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 statements An SQL SELECT statement retrieves records from a database table according to clauses (for example, FROM and WHERE ) that specify criteria. The syntax is: SELECT column1, column2 FROM table1, table2 WHERE column2=’value’;
Detailed explanation-5: -With SQL, how can you delete the records where the “FirstName” is “Peter” in the Persons Table? The DELETE statement is used to delete existing records in a table.