Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

1. What is a database?

a) Organized collection of information that cannot be accessed, updated, and managed


b) Collection of data or information without organizing
c) Organized collection of data or information that can be accessed, updated, and
managed
d) Organized collection of data that cannot be updated

2. Which type of data can be stored in the database?


a) Image oriented data
b) Text, files containing data
c) Data in the form of audio or video
d) All of the above

3. In which of the following formats data is stored in the database management system?
a) Image
b) Text
c) Table
d) Graph
4. Which of the following is not an example of DBMS?
a) MySQL
b) Microsoft Access
c) IBM DB2
d) Google

5. SQL is an acronym for


(A) Sorted Query Language
(B) Structured Quick Launch
(C) Structured Quick Language
(D) Structured Query Language

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


GET
OPEN
SELECT
EXTRACT
8. With SQL, how do you select all the records from a table named "Persons" where the value of the column
"FirstName" is "Peter"?
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
SELECT [all] FROM Persons WHERE FirstName='Peter'
SELECT * FROM Persons WHERE FirstName='Peter'
SELECT * FROM Persons WHERE FirstName<>'Peter'

9. 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
TRUE
FALSE

10. 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'
SELECT FirstName='Peter', LastName='Jackson' FROM Persons
SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
11. Which SQL keyword is used to sort the result set?
SORT BY
ORDER
ORDER BY
SORT

12. Which of the following is not a valid aggregate function?


COUNT
COMPUTE
17. If we have not specified ASC or DESC after a SQL ORDER BY clause, the following is
SUM
used by default
DESC
ASC
There is no default value
None of the mentioned

18. Which of the following is the correct order of a SQL statement?


SELECT, FROM, DESC, WHERE, ORDER BY
SELECT, DESC, WHERE, ORDER BY, FROM
SELECT, FROM, WHERE, ORDER BY, DESC
SELECT, WHERE, ORDER BY, FROM, DESC
12. With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?

SELECT * FROM Persons ORDER BY FirstName DESC


SELECT * FROM Persons ORDER FirstName DESC
SELECT * FROM Persons SORT 'FirstName' DESC
SELECT * FROM Persons SORT BY 'FirstName' DESC

13. With SQL, how can you return the number of records in the "Persons" table?
SELECT COUNT(*) FROM Persons
SELECT NO(*) FROM Persons
SELECT LEN(*) FROM Persons
SELECT COLUMNS(*) FROM Persons

14. With SQL, how do you select a column named "FirstName" from a table named "Persons"?
SELECT FirstName FROM Persons
SELECT * FROM Persons
SELECT Persons. FirstName
Extract FirstName FROM Persons
19. We can have more than one primary key in a table
TRUE
FALSE

20. The COUNT function in SQL returns the number of ______________


Values
Primary key
Integers

You might also like