You are on page 1of 5

1. Which Oracle access method is the fastest way for Oracle to retrieve a single row?

A) Primary key access


B) Access via unique index
C) Table access by ROWID
D) Full table scan

2. Which character function can be used to return a specified portion of a character


string?
A) INSTR
B) SUBSTRING
C) SUBSTR
D) POS

3. Which character is used to continue a statement in SQL*Plus?


A) *
B) /
C) –
D) @
E) =

4. Assuming today is Monday, 10 July 2000, what is returned by this statement:


SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual;
A) 17-JUL-00
B) 10-JUL-00
C) 12-JUL-00
D) 11-JUL-00

5. The _____ states that a foreign key must either match a primary key value in another
relation or it must be null.

(a) entity integrity rule

(b) referential integrity constraint

(c) action assertion

(d) composite attribute

6. Three SQL, DDL, CREATE commands are__.

a) Schema, Base and Table

(b) Base, Table and Schema

(c) Key, Base and Table


(d) Schema, Table and View

7.What built-in package should be used to create tables dynamically?

(A) DBMS_SQL
(b) DBMS_DDL
(c) DBMS_PIPE
(d) DBMS_JOB

8. What does SQL stand for?


(a) Structured Question Language
(b) Structured Query Language
(c) Strong Question Language
(d) none of these

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


(a) GET
(b) OPEN
(c) SELECT
(d) EXTRACT

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


(A) MODIFY
(B) SAVE AS
(c) UPDATE
(D) SAVE

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


(A) DELETE
(B) REMOVE
(C) COLLAPSE
(D) none of these

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


(A) INSERT INTO
(B) ADD NEW
(C) ADD RECORD
(D) INSERT NEW

13. With SQL, how do you select a column named "FirstName" from a table named
"Persons"?
(A) EXTRACT FirstName FROM Persons
(B) SELECT Persons.FirstName
(c) SELECT FirstName FROM Persons
(D) none of these

14. With SQL, how do you select all the columns from a table named "Persons"?
(A) SELECT [all] FROM Persons
(B) SELECT Persons
(C) SELECT * FROM Persons
(D) SELECT *.Persons

15. With SQL, how do you select all the records from a table named "Persons" where the
value of the column "FirstName" is "Peter"?
(A) SELECT * FROM Persons WHERE FirstName<>'Peter'
(B) SELECT [all] FROM Persons WHERE FirstName='Peter'
(C) SELECT * FROM Persons WHERE FirstName='Peter'
(D) SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
16. 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"?
(A) SELECT * FROM Persons WHERE FirstName='Peter'
(B) SELECT * FROM Persons WHERE FirstName LIKE 'a%'
(C) SELECT * FROM Persons WHERE FirstName LIKE '%a'
(D) SELECT * FROM Persons WHERE FirstName='a'

17. 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
(A) True
(B) False
(C)
(D)

18. With SQL, how do you select all the records from a table named "Persons" where the
"FirstName" is "Peter" and the "LastName" is "Jackson"?
(A) SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
(B) SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
(C) SELECT FirstName='Peter', LastName='Jackson' FROM Persons
(D) none of these

19. 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"?
(A) SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Persons
(B) SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
(c) SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName<'Pettersen'
(D)none of these

20. Which SQL statement is used to return only different values?


(A) SELECT DIFFERENT
(B) SELECT DISTINCT
(C) SELECT UNIQUE
(D)none of these

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


(A) ORDER
(B) SORT
(C) ORDER BY
(D) SORT BY

22. With SQL, how can you return all the records from a table named "Persons" sorted
descending by "FirstName"?
(A) SELECT * FROM Persons ORDER BY FirstName DESC
(B) SELECT * FROM Persons SORT BY 'FirstName' DESC
(C) SELECT * FROM Persons ORDER FirstName DESC
(D) SELECT * FROM Persons SORT 'FirstName' DESC

23. With SQL, how can you insert a new record into the "Persons" table?
(A) INSERT ('Jimmy', 'Jackson') INTO Persons
(B) INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
(C) INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
(D) none of these

24. With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?
(A) INSERT INTO Persons ('Olsen') INTO LastName
(B) INSERT INTO Persons (LastName) VALUES ('Olsen')
(C) INSERT ('Olsen') INTO Persons (LastName)
(D) none of these

25. How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons
table?
(A) MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
(B) MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen
(C) UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
(D) UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'

26. With SQL, how can you delete the records where the "FirstName" is "Peter" in the
Persons Table?
(A) DELETE ROW FirstName='Peter' FROM Persons
(B) DELETE FirstName='Peter' FROM Persons
(C) DELETE FROM Persons WHERE FirstName = 'Peter'
(D) none of these

27. With SQL, how can you return the number of records in the "Persons" table?
(A) SELECT COUNT(*) FROM Persons
(B) SELECT COLUMNS() FROM Persons
(C) SELECT COLUMNS(*) FROM Persons
(D) SELECT COUNT() FROM Persons

28. SQL is a language for


(A) developing system programs
(B) relational database management system
(C) business applications only
(D) both A. and B

ANSWERS
1. C
2. C
3. C
4. A
5. B
6. D
7. ###
8. B
9. C
10. C
11. A
12. A
13. C
14. C
15. C
16. B
17. A
18. B
19. B
20. ####
21. C
22. A
23. C
24. B
25. C
26. C
27. A
28. B

You might also like