java 2
java 2
A. Three
B..One
C.1Two
Select one:
8.. 4
C. 2
. 8
3. Given the following descriptions of the employees and jobs tables, which of the following scripts will
display each employee minimum and maximum salaries based on their job title?
EMPLOYEES Table
Name Null? Type
JOBS Table:
A. SELECT first name, last name, job_id, min_salary, max_salary FROM employees e FULL JOIN Jjobs
job id):
B. SELECT e.first name, e.last_name, e.job_id, j.min_salary, j.max_salary FROM employees e
NATURAL JOIN jobs USING (job.d);
SELECT efirst name,e last name,ejob_id, j.min_salary. j.max_salary FROM employees ee
NATURAL JOIN jobs
D. SELECT first name, last name, job_id, min_salary, max_salary FROM employees NATURAL JOIN
jobs,
Select one
A. CROSS
B. ALL
C. NATURAL
D. FULL
5. In the relational model, relationships between relations or tables are created by using.
Select one:
A. candidate keys
B. composite keys
C. determinants
D. foreign keys (Right answer:)
Selecttone
A. Outer Join
B. Self Join
Equijoin
D. Nonequijoin
Select one:
A. OR
3. NOT
C. IN
D.
8. Which syntax would be used to retrieve all rows in both the EMPLOYEES and DEPARTMENTS tables,
even when there is no match?
Select one:
Outer join
B. Inner join
C. Natural join
D. Selfjoin
9. If table A has 10 rows and table B has 5 rows, how many rows will be returned if you perform a
Cartesian join on the table
Select one
10
A
B. 5
C. 15
D. 50
10. The_ statement can be used to combine rows from two queries, returning only the rows that
appear in both sets
Select one:
A INTERSECT
B. UNION
C. UNION ALL
D. UNION Intersect
11. To perform a valid outer join between DEPARTMENTS and EMPLOYEES to list departments without
employees, select the correct clause for the following select statement.
Select one
A e.department_id(+) = d.department_id(+)
A. Combines the output from multiple queries and as one including the same number of columns
B. Combines the output from no more than two queries and does not include the same number of
column
C. Combines the output from no more than two queries and must include the same number of
column
D. Combined outputfrom multiple queries and mustincludethe same number of columns
13. Assume you are the intersect operator open to combine the result from 2 table with identical
structure customer and customer_2The customer table contends 10 rows While the customer 2 table
contents 7 row None ofthe customer appearinboth thecustomertable as wellas in customer_2 table
how many records are returned when using intersect operator?
A. 7
B. 17
C. None
D. 10
Select one
DThe table is joined to itself, one column to the next column, exhausting all possibilities.
Select one
Select one
This statement fails when executed. Which change will correct the problem?
Select one:
Select one
A. 10
B. 10.0
C. 9.99999999
D. 9.99999999999999999999999999999999999999
Select one
A. We are joining top and bottom rows
B. we are joiningtable toitself
C.we are using left and right join together
D. we are joining more than two tables
Select one:
A. returns all rows that have matching value inthe field on which the 2 tables are joined
B. returns only the rows from the first table, which have non-matching values with the second
table in the fig joined
C. returns all rows from 2 tables
D. no rows are returned
Select one:
A. Equi-join
B. Natural join
C. Outer join
D. Cartesian join
*24. Which operator is not appropriate in the join condition of a non-equi join SELECT statement?
Select one:
Select one:
26. The ID column in the CLIENT table that corresponds to the CLIENT_ID column of the ORDER table
contains null be displayed. Which type of join should you use to display the data?
Select one
A. Selfjoin
B. Nonequi-Join
Outer join
D. Equijoin
27. The. statement can be used to combine rows from two queries, returning only the rows that
appears in both sets
Select one:
A. INTERSECT
B. UNION
C. UNION ALL
D. UNION Intersect
28. To produce a meaningful result set without any Cartesian product what is the minimum number of
conditions that should Where clause of a four-table join?
Select one
B.4
C. 2
D. 8
*29. You need to calculate the total of all salaries in the accounting department Which group function
should you use?
Select one:
A. CoUNT
SUM
C. MAX
. MIN
30. A new standard has been adopted in your department that all codes that contain only 3 characters
must have a dash (-} values appended to them. Which function can be used in your query to restrict the
data displayed to only those codes 3 characters?
Select one:
. SUEBSTR
B. LENGTH
C. RPAD
D. REPLACE
31. Which two statements correctly describe functions that are available in SOL?
Select one
Select one:
34. You are sorting data in a table in SELECT statement in descending order. The column you are sorting
on contains NULL, records, where will the NULL record appear?
Select one:
35. You would like to display the system date in the format "Monday, 01 June, 2001 Which SELECT
statement should you use?
Selecttone:
36 Which function returns the date of given weekday that is greater than the given date?
Select one:
A. TO_DATE
B. LAST DAY
NEXT DAY
D. SYSDATE
20
B. 15
C. 15.10
D. 16
SELECT ROUND{45.953, -1), TRUNC(45.936, 2) FROM dual; Which values are displayed?
Select one
A. 46 and 45
B. 50 and 45.93
C. 46 and 45.93
D. 50 and 45.9
Select one:
A. 15
C. -75
D. 75
40. You are using the single row function in a SELECT statement. Which function can best be categorized
as similar in function to an IF-THEN-ELSE statemernt?
Select one
A. DECODE
B. ROWIDTOCHAR.
C. NEW TIME
D. SORT
Select one:
A LEFT
3. CAST
C
MIN
. RIGHT
A. NULL
B. HELLO
C. WORLD
D. HELLOwORLD
select
"hello | | null |l world' from dual;|
helloworld
STD ID NUMBER(4)
cOURSE ID VARCHARD2(10)
Which two aggregate functions are valid on the START DATE column? (Choose two options)
It is possible to apply COUNT) and MIN) functions on the column with DATE data type.
45. Which two are character manipulation functions? (Choose two options)
A. TRUNC
B. REPLACE
C. TO DATE
D. TRIM
46. You want to display the expiration date of the warranty for a product. Which SQL statement would
you execute?
Select one
/here warranty period is not date but number of months (i.e. number)
Answer: B
47. Which two statements are true regarding the ORDER BY clause? (Choose two options)
ITEM ID NUMBER(9)
cOST NUMBER(7,2)
RETAIL NUMBER(7,2)
The RETAIL and COST columns contain values greater than zero
1. SELECT item id. (retail 1.25)+ 5.00- (cost 1.10)- (cost .10) AS Calculated Profit FROM item;
2. SELECT item_id, retall 1.25 +5.00-cost 1.10-cost . 10 "Calculated "FROM item;
What will be the result?
Select one
49. The following SQL statement was written to retrieve the rows for the PRODUCT ID that has a UNT
PRICE more than 1,000 and has been ordered more than five times:
Select one:
A. The statement would not execute because the aggregate function is used in the WHERE clause.
B. The statement would not execute because the WHERE clause should have the OR logical
operator instead of AND.
C. The statement would not execute because in the SELECT Clause, the UNIT PRICE column is
placed after the column having the aggregate function.
D. The statement would execute and give you the desired result
SELECT last name, salary, hire date FROM EMPLOYEES ORDER BY 2 DESC;
Select one:
A. There is no need to specify DESC because the results are sorted in descending order by default
B. Thetwo statements produceidenticalresults
C. The second statement returns a syntax error
D. The two statements can be made to produce identical results by adding a column alias for the
salary the second SQL statement
51. Given below is a list of functions and their purpose in random order.
Function Purpose
1NVL a) Used for evaluating NOT NULL and NULL values 2)NULLIF b) Used to return the first non- null
values in a list of expressions
3)COALESCE c) Used to compare two expressions. If both are same, it returns NULL; otherwise, it returns
only the first expression.
4)NVL2 d) Used to convert NULL values to actual values Identify the correct combination of functions In
the usage.
Select one
A. 1-d,2-b,3-c,4-a
B. 1-a,2-c,3-b.4-d
C. 1-b,2-c3-d,4-a
D. 1-d,2-c3-b,4-a
52. Evaluate this SQL statement:
statement fails when executed. Which change will correct the problem?
Select one:
53. Which two statements are true regarding single row functions? (Choose two options)
54. The join column must be included in the select statement when you use the NATURAL JOIN clause,
State True False.
Select one:
A. Irue
3. False
55. You can use combination of GROUP BY clause, HAVING Clause and WHERE clause sQL clauses in one
SQL
Select one
A. True
B. False
S6. SELECT c.country.name, d.department name FROM countries c.departments d WHERE country_id (+)
d.country.id (+)
State True or False.
Select one:
A. True
3. False
Select one:
A. date number
B. date+date
C. date-date
D. Date+number