0

databases Online Quiz - 217

Description: databases Online Quiz - 217
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0

The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true

  1. True

  2. False


Correct Option: B

With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?

  1. SELECT * FROM Persons SORT BY 'FirstName' DESC

  2. SELECT * FROM Persons SORT 'FirstName' DESC

  3. SELECT * FROM Persons ORDER BY FirstName DESC

  4. SELECT * FROM Persons ORDER FirstName DESC


Correct Option: C

Which SQL statement is used to extract data from a database?

  1. OPEN

  2. EXTRACT

  3. SELECT

  4. GET


Correct Option: C

Which SQL statement is used to update data in a database?

  1. UPDATE

  2. MODIFY

  3. SAVE

  4. SAVE AS


Correct Option: A

Which SQL statement is used to insert new data in a database?

  1. ADD NEW

  2. INSERT INTO

  3. ADD RECORD

  4. INSERT NEW


Correct Option: B

What does SQL stand for?

  1. Strong Question Language

  2. Structured Query Language

  3. Structured Question Language

  4. Strong Query Language


Correct Option: B

With SQL, how do you select all the columns from a table named "Persons"?

  1. SELECT * FROM Persons

  2. SELECT [all] FROM Persons

  3. SELECT Persons

  4. SELECT FROM Persons


Correct Option: A

Which SQL statement is used to return only different values?

  1. SELECT DIFFERENT

  2. SELECT UNIQUE

  3. SELECT DISTINCT

  4. SELECT EXACT


Correct Option: C

With SQL, how can you insert a new record into the "Persons" table?

  1. INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

  2. INSERT VALUES ('Jimmy', 'Jackson') INTO Persons

  3. INSERT ('Jimmy', 'Jackson') INTO Persons

  4. INSERT VALUES ('Jimmy', 'Jackson')


Correct Option: A

With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?

  1. INSERT INTO Persons (LastName) VALUES ('Olsen')

  2. INSERT ('Olsen') INTO Persons (LastName)

  3. INSERT INTO Persons ('Olsen') INTO LastName

  4. INSERT INTO Persons ('Olsen')


Correct Option: A

With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?

  1. DELETE ROW FirstName='Peter' FROM Persons

  2. DELETE FROM Persons WHERE FirstName = 'Peter'

  3. DELETE FirstName='Peter' FROM Persons

  4. REMOVE FROM Persons WHERE FirstName = 'Peter'


Correct Option: B

Which SQL statement is used to delete data from a database?

  1. DELETE

  2. COLLAPSE

  3. REMOVE

  4. ERASE


Correct Option: A

With SQL, how do you select a column named "FirstName" from a table named "Persons"?

  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

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"?

  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

Which SQL keyword is used to sort the result-set?

  1. SORT BY

  2. SORT

  3. ORDER

  4. ORDER BY


Correct Option: D

How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?

  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

With SQL, how can you return the number of records in the "Persons" table?

  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

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"?

  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
- Hide questions