Académique Documents
Professionnel Documents
Culture Documents
a. where clause
b. subqueries
c. joins
d. logical operators
3. When you use wild card character (%) with any other character to
search for a string
a. the result will display all records that contain a single or multiple
occurrence of the character specified with the wild card.
b. the result will display the details of all records having the
character prefixed or suffixed in the database.
c. the result will display the character with the second character
irrespective of the character in the first place
d. There would be multiple occurrence of the character.
What type of function is performed in this query? Choose all that apply.
a. character function
b. multiple-row function
c. single-row function
d. upper
5. Dual table is used to return only one value. One of the options below is not true about
a dual table.
a. you can use dual table to perform calculations on the select statement
b. you can specify a column name with a function when you are using a dual table
c. you can use the dual table only when you do not require retrieving details from a
table in the database
d. you can perform a character functions in a dual table
6. Select ____________ (‘good’, ‘day’) from dual;
Output
------------------------------
Goodday
a. product
b. instr
c. concat
d. length
a. floor
b. trunk
c. power
d. ceil
e. substr
a. 2 – 200
b. 1 – 27
c. 1 – 100
d. 1 – 38
a. 1
b. 0
c. null
d. 2
10. A function that replaces the value with some other value specified as
the argument is called
a. nvl function
b. null
c. coalesce function
d. substitution
11. in oracle, you can use an expression instead of the if…then…else clause to execute
statements based on a condition.
What is the expression?
a. Boolean_ expression
b. Conditional clause
c. Case…when….else…then
d. Sql_ statement
12. When a join is implemented, a primary key is validated against the foreign key
a. true
b. false
13. If the column names in the select list are replaced by an asterisk(*) in an equijoin query
14. The rule for joining tables is that if there are number of tables being
joined, the query should include
a. join conditions
b. table aliases
c. select statement
d. avoid ambiguity
a. natural join
b. equijoin
c. non equijoin
d. outer join
a. table name
b. table alias
c. column name
d. character strings
Choose all that apply.
17. You can join two tables by using one or more columns that have the same name in
a. natural join
b. equijoin
c. self join
d. none
18. Select vFirstname, cName from Accountant, Recruiter
where Accountant . cRecruitercode = Recruiter . cRecruitercode(+);
a. outer join
b. right outer join
c. left outer join
d. full join
19. What other operator is used with the plus(+) operator when implementing a full outer
join in sql query?
a. join on
b. full outer join
c. union
d. outer join
20. A join operator can not be combined with another condition when using logical
operators like
a. and
b. or
c. not
d. in
e. between….and
Choose all that apply.
21. in self join, because the same table is used twice for comparison, an alias name
differentiates the two copies of the table.
a. true
b. false
22. All but one of these functions does not ignore a null value
a. count(*)
b. sum
c. avg
d. min
e. max
23. select cCity, vFirstname, vLastname from Candidate group by cCity, vLastname;
an error message “not a group by expression” was displayed after the query was
executed. Why?
a. all columns specified in the select list are not specified in the group
by clause
b. cCity column does not exist in the table
c. group by clauses are not allowed in a select statement
d. none of the above
The above query displayed an error after being executed. The error occurred at
28. in a where clause, the level of subqueries that are possible are
a. 2
b. 255
c. 100
d. 4
e. 10
29. in the execution of queries, the direction is in one direction starting from the
a. where clause
b. outermost queries
c. innermost queries
d. select statement
1.Based on the following conditions, which of the following will make a true condition?
A. MADNESS
B. Man
C. MARY
D. mary
E. Mandy
Ans:B,E
2.What will happen if you call a SQL function with an argument of a datatype other than
the datatype expected by a SQL function?
Ans:D
Ans:D
4.What condition can you use for testing that involves pattern matching?
Ans:LIKE
5.Which of the following queries can you use to search for employees with the pattern A_B
in their names?
A. SELECT last_name
FROM employees
WHERE last_name LIKE %A_B% ESCAPE ;
B. SELECT last_name
FROM employees
WHERE last_name LIKE A_B% ESCAPE %;
C. SELECT last_name
FROM employees
WHERE last_name LIKE %A\_B% ESCAPE \;
D. SELECT last_name
FROM employees
WHERE last_name LIKE %A\_B% ESCAPE \\;
Ans:C
6.Which of the following SQL statements can calculate and return the absolute value of
-33?
Ans:C
7.What condition can you use to test for the existence of rows in a subquery:
Ans:EXISTS
A. it calculates, for each employee in the employees table, the average salary of the
employees reporting to his/her respective manager
B. it calculates, for each employee in the employees table, the average salary of the
employees reporting to the same manager who were hired in the range just before through
just after the employee
D. it calculates, for each employee in the employees table, the average salary of the
employees reporting to his/her respective manager who were hired just after the employee
E. it calculates, for each employee in the employees table, the average salary of the
employees reporting to his/her respective manager who were hired just before the
employee
Ans:B
Ans:B
10.Which of the following are the valid ordering sequences of an order by clause?
A. ASEC
B. DESC
C. REVERT
D. RANDOM
E. ASC
Ans:B,E
1.A condition in the WHERE clause of which of the following statements is NOT valid?
A. HAVING
B. START WITH
C. DELETE
D. SELECT
E. UPDATE
Ans:A,B
2.A condition in which of the following clauses of the SELECT statement is NOT valid?
A. WHERE
C. START WITH
D. HAVING
E. CONNECT BY
Ans:B
3.Which of the following has been achieved by the following SQL codes?
B. only those hired after 1999 and earning more than $3500 a month are returned
C. only those hired before 1999 and earning more than $3500 a month are returned
D. runtime error
E. only those hired before 1999 and earning less than $3500 a month are returned
Ans:C
4.Which of the following has been achieved by the following SQL codes?
A. it returns employees who have a 50% commission rate or a salary greater than
$23,000:
C. runtime error
D. invalid syntax
E. it returns employees who have a 50% commission rate and a salary greater than
$23,000:
Ans:A
A. OR … BETWEEN
B. AND … BETWEEN
C. BETWEEN … AND
D. IN … BETWEEN
E. BETWEEN … OR
Ans:C
B. UNION ALL - returns all rows selected by either query, including all duplicates.
C. INTERSECT - returns all distinct rows selected by both queries.
D. MINUS - returns all distinct rows selected by the first query but not the second.
Ans:A,B,C,D
7.A scalar subquery expression can be placed in which of the following places?
B. GROUP BY clause
C. HAVING clause
E. CHECK constraints
Ans:A,B,C,D,E
C. CREATE OPERATOR
D. CREATE USER-OPER
E. CREATE OPER
Ans:C
10.You can have a user-defined function expression to specify a call to which of the
following ?
A. A user-defined function.
C. A user-defined operator.
Ans:A,B,C,D
1.A condition in the WHERE clause of which of the following statements is NOT valid?
A. HAVING
B. START WITH
C. DELETE
D. SELECT
E. UPDATE
Ans:A,B
2.A condition in which of the following clauses of the SELECT statement is NOT valid?
A. WHERE
C. START WITH
D. HAVING
E. CONNECT BY
Ans:B
3.Which of the following has been achieved by the following SQL codes?
B. only those hired after 1999 and earning more than $3500 a month are returned
C. only those hired before 1999 and earning more than $3500 a month are returned
D. runtime error
E. only those hired before 1999 and earning less than $3500 a month are returned
Ans:C
4.Which of the following has been achieved by the following SQL codes?
A. it returns employees who have a 50% commission rate or a salary greater than
$23,000:
C. runtime error
D. invalid syntax
E. it returns employees who have a 50% commission rate and a salary greater than
$23,000:
Ans:A
A. OR … BETWEEN
B. AND … BETWEEN
C. BETWEEN … AND
D. IN … BETWEEN
E. BETWEEN … OR
Ans:C
B. UNION ALL - returns all rows selected by either query, including all duplicates.
D. MINUS - returns all distinct rows selected by the first query but not the second.
Ans:A,B,C,D
7.A scalar subquery expression can be placed in which of the following places?
B. GROUP BY clause
C. HAVING clause
E. CHECK constraints
Ans:A,B,C,D,E
C. CREATE OPERATOR
D. CREATE USER-OPER
E. CREATE OPER
Ans:C
Ans:A,B,C,D,E,F,G
10.You can have a user-defined function expression to specify a call to which of the
following ?
A. A user-defined function.
C. A user-defined operator.
Ans:A,B,C,D
USER_CONSTRAINTS CONTRAINT_TYPE column will list the first character of the first
word that best describes each type of constraint.
ALL_CONSTRAINTS CONTRAINT_TYPE column will list the first character of the first
word that best describes each type of constraint.
USER_OBJECTS Can be used to verify the validity status of all user database objects.
ALL_OBJECTS Can be used to verify the validity status of all database objects.
USER_IND_COLUMNS Contains the index name, the table name, and the column name.