Tag: technology

Questions Related to technology

  1. EXTRACT FirstName FROM Persons

  2. SELECT FirstName FROM Persons

  3. SELECT Persons.FirstName

  4. SELECT * FROM Persons


Correct Option: B

With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?

  1. SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

  2. SELECT FirstName='Peter', LastName='Jackson' FROM Persons

  3. SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'

  4. SELECT * FROM Persons WHERE FirstName='Jackson' AND LastName='Peter'


Correct Option: A

AI Explanation

To select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson", you would use the SQL query:

A. SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

Explanation: Option A) SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson' - This option is correct because it uses the "SELECT" statement to retrieve all columns ("*") from the "Persons" table where the "FirstName" is equal to "Peter" and the "LastName" is equal to "Jackson".

Option B) SELECT FirstName='Peter', LastName='Jackson' FROM Persons - This option is incorrect because it uses the "SELECT" statement incorrectly. The column names should be specified after the "SELECT" keyword, not the values.

Option C) SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson' - This option is incorrect because it uses the "NOT EQUAL TO" operator "<>" instead of the "EQUAL TO" operator "=" to filter the records by "FirstName" and "LastName".

Option D) SELECT * FROM Persons WHERE FirstName='Jackson' AND LastName='Peter' - This option is incorrect because it swaps the values for "FirstName" and "LastName" in the query. The correct query should be "FirstName='Peter' AND LastName='Jackson'".

Therefore, the correct answer is A) SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'.

  1. SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName

  2. SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'

  3. SELECT LastName>'Hansen' AND LastName

  4. SELECT LastName<>'Hansen' AND LastName<>'Pettersen' FROM Persons


Correct Option: B
  1. ' (Single Quote)

  2. /*

  3. //

  4. REM


Correct Option: A,D
  1. MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'

  2. MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen

  3. UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'

  4. UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'


Correct Option: D
  1. SELECT COUNT(*) FROM Persons

  2. SELECT COLUMNS(*) FROM Persons

  3. SELECT COLUMNS() FROM Persons

  4. SELECT COUNT() FROM Persons


Correct Option: A

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?

  1. SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'

  2. SELECT * FROM Persons WHERE FirstName<>'Peter'

  3. SELECT [all] FROM Persons WHERE FirstName='Peter'

  4. SELECT * FROM Persons WHERE FirstName='Peter'


Correct Option: D
  1. SELECT * FROM Persons WHERE FirstName LIKE '%a'

  2. SELECT * FROM Persons WHERE FirstName='%a%'

  3. SELECT * FROM Persons WHERE FirstName='a'

  4. SELECT * FROM Persons WHERE FirstName LIKE 'a%'


Correct Option: D