You are on page 1of 10

Topic: Data Types Topic: Data Types

Which of the following is not true regarding LONG values? Which of the following is not a valid data type in Oracle
a) A table can contain only one LONG column 10g?
b) LONG columns can appear in where clauses a) DATE
c) Stored function cannot return a LONG value b) TIMESTAMP(3)
d) LONG columns cannot be indexed c) TIMESTAMP(6)
Topic: Data Types d) TIME
A table can have column of boolean data type. Topic: Data Types
a) TRUE What is the maximum length of a CHAR data type
b) FALSE a) 2000
Topic: Data Types b) 4000
Oracle Table can have a boolean data type for its c) 8000
column(s)? d) No limit
a) TRUE Topic: Data Types
b) FALSE Assume we want to store patient's image onto the hospital
Topic: Data Types database while creating the patient table which of the
A long column can store data upto following data types should be used for storing image
a) 2 Megabytes within the database.
b) 2 Gigabytes a) CLOB
c) 2000 bytes b) BFILE – store a link to an external binary file (file stored
d) None of the above outside of the database)
Topic: Data Types c) BLOB
BFILE data type can store upto a maximum of d) NCLOB
a) 1 GB Topic: Data Types
b) 2 GB Which of the following is a not Unicode-only datatype?
c) 4 GB a) CHAR
d) None of the above b) NCHAR
c) NVARCHAR2
Topic: Data Types d) All of the above
Create table tab_name(col1 long, col2 long); The above Topic: Data Types
statement will create a table tab_name How many columns are allowed in Oracle10g table?
a) TRUE a) 255
b) FALSE (only one long col can be there) b) 10000
Topic: Data Types c) 1000
CREATE TABLE table_name(column_name CHAR); What d) there is no limit (infinite)
will be the length of the column column_name in the table Topic: Data Types
table_name What is the maximum length we can give to VARCHAR2( )?
a) 1 (default is 1) a) 2000
b) 2 b) 4000
c) 10 c) 1000
d) 2000 d) there is no limit (infinite)
Topic: Data Types Topic: Data Types
Which all are DATETIME data types that can be used when Which data type(s) can hold a null value?
specifying column definitions? a) VARCHAR2( )
a) TIMESTAMP b) NUMBER( )
b) INTERVAL MONTH TO DAY c) DATE
c) DATE d) All of the above
d) A & C Topic: Data Types
Topic: Data Types Which of the following is a Unicode-only datatype?
CREATE TABLE table_name(column_name CHAR); a) Char
The above SQL statement will throw an error as length for b) NCHAR
CHAR data type is not specified c) VARCHAR2
a) TRUE d) None
b) FALSE Topic: Data Types
What would be the value stored in database, if 123.89 is d) REPLACE
stored in a column of datatype NUMBER(6,-2)? Topic: Data Types
-2 means round to hundreds Which of the following is a pseudocolumn?
a) 123 a) ROWID ( SYSDATE,
b) 100 SYSTIMESTAMP,ROWID, ROWNUM, UID, USER, LEVEL,
c) 120 CURRVAL, NEXTVAL, ORA_ROWSCN, etc.)
d) 123.9 b) NUMBER
Topic: Data Types c) CHAR
Which of the following datatype is stored as an external d) VARCHAR2
file on the server? Topic: Data Retrieval Manipulation
a) BLOB What is the output for the following query?
b) NCLOB select NULL + 5 from dual ;
c) CLOB a) NULL ("Any arithmetic expression containing a null
d) BFILE always evaluates to null.")
Topic: Data Types b) 5
Which of the following SQL functions can operate on any c) Will give an Error
datatype? d) 0
a) MAX Topic: Data Retrieval Manipulation
b) LOWER What is the output for the following query?
c) LPAD Select round(15.193,-1) from dual;
d) ADD_MONTHS a) 20
Topic: Data Types b) 10
Which of the following can be stored in a NUMBER(8,2) c) 15.2
datatype? d) 15
a) 999999.99 Topic: Data Retrieval Manipulation
b) 999999.999 Which of the following will slow down the query most:-
c) 9999999.99 a) name=Ram
d) 99999.999 b) name like Ram%
Topic: Data Types c) name like %Ram%
Which of the following datatypes cannot be used with any d) None of the above
of the built-in functions? Topic: Data Retrieval Manipulation
a) NUMBER What is the output for the following query?
b) LONG RAW select NULL||'ORACLE L.1.1' from dual ;
c) VARCHAR2 a) NULL
d) BOOLEAN b) ORACLE L.1.1
Topic: Data Types c) A and B
Which datatype can be used for loop counters? d) None of the above
a) LONG Topic: Data Retrieval Manipulation
b) FLOAT In SQL string length constraints for VARCHAR2 must be in
c) PLS_INTEGER range
d) ROWID a) 1 .. 2000
Topic: Data Types b) 1 .. 4000
Which datatype is used to store unstructured binary data c) 1 .. 32767
outside the database? d) None of the above
a) BLOB Topic: Data Retrieval Manipulation
b) CLOB select name from salesreps where sales between 1000 and
c) NCLOB 2000;
d) BFILE a) Query will display the name from the salesreps table
Topic: Data Types whose sales is >1000 and sales < 2000
Which of the following SQL functions is used to convert a b) Query will display the name from the salesreps table
string from one CHARACTERSET to another? whose sales is >=1000 and sales <= 2000
a) CAST c) Query will display the name from the salesreps table
b) CONVERT whose sales is >=1000 and sales < 2000
c) TO_CHAR
d) Query will display the name from the salesreps table DEPARTMENT_ID NUMBER(6)
whose sales is >1000 and sales <= 2000 You need to display the employees who have not been
Topic: Data Retrieval Manipulation assigned to any department.
Table A has 120 rows ; Table B has no rows . You write the SELECT statement:
How many rows will be returned by the following SQL SELECT LAST_NAME, SALARY, DEPARTMENT_ID
statement FROM EMP
SELECT * FROM A,B; WHERE DEPARTMENT_ID = NULL;
a) 0 What is true about this SQL statement?
b) 120 a) The SQL statement displays the desired results.
c) 121 b) The column in the WHERE clause should be changed to
d) None of the above display the desired results.
Topic: Data Retrieval Manipulation c) The operator in the WHERE clause should be changed
Distinguish between case and decode to display the desired results.
a) case can be used wherever decode is used d) The WHERE clause should be changed to use an outer
b) decode can be used wherever case is used join to display the desired results.
c) In "case" we can only use equal operation and in Topic: Data Retrieval Manipulation
"decode" we can use all relational opeations What is true about ORDER BY clause?
d) none of the above a) Can appear only at the very end of the statement
Topic: Data Retrieval Manipulation b) Will accept the column name, aliases from the first
If a table (table_name) contains the values SELECT statement
10,20,30,null,null for a column col1,What will the output c) Will accept the positional notation
of the below select statement. d) All of the above
Select count(col1) from table_name; Topic: Data Retrieval Manipulation
a) 3 Group functions ignore null values.
b) 5 a) TRUE
c) 2 b) FALSE
d) None Topic: Data Retrieval Manipulation
Topic: Data Retrieval Manipulation select 1,5 from dual
When does a foreign key constraint enforce domain intersect
integrity? select 1,5 from dual;
a) During inserts What will be the output of the above statement?
b) During select a) 1 5
c) During optimization b) null null
d) During create c) 0 0
Topic: Data Retrieval Manipulation d) None of the above
Which of the following query will print Even number of Topic: Data Retrieval Manipulation
records ? What is the output of the below sql statement
a) select * from emp where (rowid,1) select * from dual;
b) select * from emp where (rowid,1) in (select rowid, a) NULL
mod(rownum,2) from emp) b) SYSDATE
c) select * from emp where (rowid,0) in (select rowid, c) 'X'
mod(rownum,2) from emp) d) Number of Tables
d) select * from emp where (rowid,0) Topic: Data Retrieval Manipulation
Topic: Data Retrieval Manipulation Which are true about aggregate functions?
In NVL2(expr1,expr2,expr3), if expr1 is not null, then NVL2 a) You can use aggregate functions in any clause of a
returns SELECT statement.
a) expr1 b) You can use aggregate functions only in the column list
b) expr2 of the SELECT clause and in the WHERE clause of a SELECT
c) expr3 statement.
d) null c) You can mix single row columns with aggregate
Topic: Data Retrieval Manipulation functions in the column list of a SELECT statement by
The EMP table contains these columns: grouping on the single row columns.
LAST NAME VARCHAR2(25) d) You can use aggregate functions on a table, only by
SALARY NUMBER(6,2) grouping the whole table as one single group.
Topic: Data Retrieval Manipulation a) 265
Examine the following statements. b) 250
c) 255
Insert into tableXYZ values (1, 2, 3); d) 275
Create table ABC (sno CHAR(1)); Topic: Data Retrieval Manipulation
Rollback; Which clause appears only in the last component of a
What happens to the row inserted into tableXYZ? query?
a) Record available in the table a) WHERE
b) Record not available in the table b) GROUP BY
c) Record available in table with inconsistent state c) ORDER BY
d) none of the above d) HAVING
Topic: Data Retrieval Manipulation Topic: Data Retrieval Manipulation
1 select 1 from dual What is the output of SIGN(a) function? If a is less than '0'.
2 minus a) 1
3 select 'a' from dual ; b) -1
The above statement will through error on line c) 0
a) 1 d) 2.414
b) 2 Topic: Data Retrieval Manipulation
c) 3 Examine the structure of the EMPLOYEES table:
d) None of the above EMPLOYEE_ID NUMBER Primary Key
Topic: Data Retrieval Manipulation FIRST_NAME VARCHAR2(25)
Which SQL function can be used instead of the IF LAST_NAME VARCHAR2(25)
construct? Which statement inserts a row into the table?
a) Coalesce a) INSERT INTO employees (employee_id, first_name,
b) Decode last_name) VALUES ( 1000, 'John',' ');
c) Nullif b) INSERT INTO employees( first_name,
d) B and C last_name)VALUES(John,Smith);
Topic: Data Retrieval Manipulation c) INSERT INTO employees( first_name, last_name,
Which of the following is multiple-row comparison employee_id) VALUES ( 1000, John, Smith);
operator? d) INSERT INTO employees VALUES ( NULL, John,Smith);
a) IN Topic: Data Retrieval Manipulation
b) ANY What DML operations can perform using Merge Statement
c) ALL a) Insert
d) All of the above b) Update
Topic: Data Retrieval Manipulation c) a & b also delete
select 1,5 from dual d) None of the above
minus Topic: Data Retrieval Manipulation
select 1,5 from dual; which of the following is data query language?
What will be the output of the above statement a) INSERT
a) 0 0 b) UPDATE
b) null null c) SELECT
c) No rows selected d) All the above
d) None of the above Topic: Data Retrieval Manipulation
Topic: Data Retrieval Manipulation Which of the following statement is true regarding ORDER
Evaluate the SQL statement: BY clause?
SELECT ROUND(45.953, -1), TRUNC(45.936, 2) FROM Dual; a) The sort is in ascending order by default.
Which values are displayed? b) The sort is in descending order by default.
a) 46 and 45 c) The ORDER BY clause must precede the WHERE clause.
b) 46 and 45.93 d) The ORDER BY clause is executed on the client side.
c) 50 and 45.93 Topic: Data Retrieval Manipulation
d) 45 and 45.93 Which is character manipulation function?
Topic: Data Retrieval Manipulation a) TRIM
The maximum number of components in the DECODE b) TRUNC
function, including expr,searches, results, and default, is c) TO_DATE
d) CASE Which operator is used to return all distinct rows that are
Topic: Data Retrieval Manipulation selected by the first query but not by the second?
which one of following commands does not belongs to a) MINUS
DML? b) intersect
a) truncate c) union
b) delete d) None of the above
c) update Topic: Data Retrieval Manipulation
d) merge Which operator is used to comment a single line within the
Topic: Data Retrieval Manipulation query?
Which SQL statement returns a numeric value? a) %%
a) SELECT ADD_MONTHS(MAX(hire_Date), 6) FROM EMP; b) --
b) SELECT ROUND(hire_date) FROM EMP; c) $$
c) SELECT sysdate-hire_date FROM EMP; d) COMMENT
d) SELECT TO_NUMBER(hire_date + 7) FROM EMP; Topic: Data Retrieval Manipulation
Topic: Data Retrieval Manipulation Which SELECT statement displays 2000 in the format
Evaluate the SQL statement: “$2,000.00??
SELECT ROUND(TRUNC(MOD(1600,10),-1),2)FROM dual; a) SELECT TO CNAR(2000, ‘$9,999.00’) FROM dual;
What will be displayed? b) SELECT TO CNAR(2000, ‘$#,###.##’) FROM dual;
a) 0 c) SELECT TO CNAR(2000, ‘$2,000.00’) FROM dual;
b) 1 d) SELECT TO CNAR(2000, ‘$N,NNN.NN’) FROM dual;
c) 2 Topic: Data Retrieval Manipulation
d) An error statement Which of the following is the right statement to get
Topic: Data Retrieval Manipulation maximum salary from employees table?
What would be the output of the below query? a) SELECT MAX(salary) FROM employees;
select decode(substr('TECHNOLOGY',2,3),'CH','PASS','FAIL') b) SELECT salary FROM employees;
from dual; c) SELECT salary (MAX) "Maximum" FROM employees;
a) PASS d) SELECT salary "Maximum" FROM employees;
b) FAIL Topic: Data Retrieval Manipulation
c) No output Unique Constraint violation error occurs during ?
d) Error a) INSERTS
Topic: Data Retrieval Manipulation b) SELECT
If a table (table_name) contains the values c) DELETE
10,20,30,null,null for a column col1,What will the output d) All of the above
of the below select statement. Topic: Data Retrieval Manipulation
Select count(*) from table_name; Which of the following syntax enables an existing
a) 5 constraint ?
b) 3 a) ALTER TABLE table_name ENABLE constraint_name;
c) 2 b) ALTER TABLE table_name STATUS = ENABLE
d) None CONSTRAINT constraint_name;
Topic: Data Retrieval Manipulation c) ALTER TABLE table_name ENABLE CONSTRAINT
Certain DML privileges are required for merge constraint_name;
statement.Which of the following is true? d) ALTER TABLE table_name STATUS ENABLE CONSTRAINT
INSERT and UPDATE object privileges on the target table constraint_name;
and the SELECT object privilege on the source table Topic: Data Retrieval Manipulation
INSERT,DELETE and UPDATE object privileges on the State TRUE or FALSE:
target table and the SELECT object privilege on the source Oracle SQL Function "MOD(n2,n1)" returns the remainder
table of n2 divided by n1
SELECT,INSERT and UPDATE object privileges on the target a) TRUE
table and the SELECT object privilege on the source table b) FALSE
SELECT,INSERT and UPDATE object privileges on the target Topic: Data Retrieval Manipulation
table and the SELECT,UPDATE object privilege on the Oracle Server implicitly creates a unique index for ?
source table a) NOT NULL & PRIMARY KEY
Topic: Data Retrieval Manipulation b) PRIMARY KEY & FOREIGN KEY
c) CHECK & UNIQUE
d) UNIQUE & PRIMARY KEY c) SELECT DECODE(SUBSTR(SYSDATE, 8), 'YYYY') FROM
Topic: Data Retrieval Manipulation dual;
Which of the following SELECT statement will display the d) SELECT DECODE(SUBSTR(SYSDATE, 8), 'year') FROM
result 'World' from the string 'Hello World'? dual;
a) SELECT SUBSTR( 'Hello World',7) FROM DUAL; Topic: Data Retrieval Manipulation
b) SELECT LEFT('Hello World',5) FROM DUAL; Evaluate this SQL statement:
c) SELECT RIGHT('Hello World',5) FROM DUAL; SELECT ename, sal FROM EMP;
d) All of the above The SAL column stores the monthly salary of the
Topic: Data Retrieval Manipulation employee. Which of the following query calculates the
SELECT * FROM employees annual compensation as "monthly salary plus a monthly
WHERE hire_date < TO_DATE ('01-JAN-1999', 'DD-MON- bonus of $100, multiplied by 12"?
YYYY') AND salary > 3500; a) SELECT ename, sal, (12*sal)+100 FROM emp;
The above SQL statement retrieves ? b) SELECT ename, sal+(100*12) FROM emp;
a) Only those hired before 1999 and earning less than c) SELECT ename, sal, 12*(sal+100) FROM emp;
$3500 a month are returned d) None of the above
b) Only those hired after 1999 and earning more than Topic: Data Retrieval Manipulation
$3500 a month are returned Which of the following transaction control statement
c) Only those hired after 1999 and earning more than prevents more than one user from updating data in a table
$3500 a month are returned ?
d) Only those hired before 1999 and earning more than a) LOCK
$3500 a month are returned b) COMMIT
Topic: Data Retrieval Manipulation c) ROLLBACK
Which of the following SQL statements can calculate and d) SAVEPOINT
return the absolute value Topic: Data Retrieval Manipulation
of -33? You are granted the CREATE VIEW privilege. What does
a) SELECT ABS("-33") Absolute FROM DUAL; this privilege allow you to do?
b) SELECT ABS('-33') "Absolute" FROM DUAL; a) Create a table view
c) SELECT ABS(-33) "Absolute" FROM DUAL; b) Create a view in ANY schema
d) None of the above c) Create a view in your schema (Create any view, drop
Topic: Data Retrieval Manipulation any view only)
Which of the following SQL statement will display system d) Create a view only of it is based on tables that you
date in the format "Monday, 01 June, 2001" ? created.
a) SELECT TO_DATE (SYSDATE, 'FMDAY, DD Month, YYYY') Topic: Data Retrieval Manipulation
FROM dual; An inline view is a SELECT statement that is given an alias
b) SELECT TO_CHAR (SYSDATE, 'FMDD, DY Month, YYYY') and is embedded in the _______________ clause of
FROM dual; another SELECT statement.
c) SELECT TO_CHAR (SYSDATE, 'FMDY, DDD Month, YYYY') a) FROM
FROM dual; b) WHERE
d) SELECT TO_CHAR (SYSDATE, 'FMDay, DD Month, YYYY') c) SELECT
FROM dual; d) CASE
Topic: Data Retrieval Manipulation Topic: Data Retrieval Manipulation
Which SQL statement would you use to remove a view Which SELECT statement will display the next value of the
called EMP_DEPT_VU from your schema? PARTS_ID_SEQ sequence by
a) DELETE VIEW emp_dept_vu; actually retrieving the value from the sequence?
b) DROP VIEW emp_dept_vu; a) SELECT NEXTVAL(parts_id_seq) FROM DUAL;
c) DROP emp_dept_vu; b) SELECT parts_id_seq.NEXTVAL FROM inventory;
d) DELETE emp_dept_vu; c) SELECT parts_id_seq.NEXTVAL FROM DUAL;
Topic: Data Retrieval Manipulation d) SELECT NEXTVAL(parts_id_seq) FROM inventory;
Which SELECT statement should you use to extract the Topic: Data Retrieval Manipulation
year from the system date and display it in the format The EMP table contains these columns:
"1998"? EMPLOYEE_ID NUMBER(4)
a) SELECT TO_DATE(SYSDATE, 'yyyy') FROM dual; LAST_NAME VARCHAR2 (25)
b) SELECT TO_CHAR(SYSDATE, 'yyyy') FROM dual; JOB_ID VARCHAR2(10)
You want to search for strings that contain 'SA' in the Which of the following clause allows Oracle to perform
JOB_ID column. Which SQL statement do you use? similar operations on dependant objects of a table
a) SELECT employee_id, last_name, job_id FROM EMP a) ALL
WHERE job_id LIKE '%SA%'; b) CACHE
b) SELECT employee_id, last_name, job_id FROM EMP c) CASCADE
WHERE job_id LIKE '%SA'; d) COALESCE
c) SELECT employee_id, last_name, job_id FROM EMP Topic: Data Retrieval Manipulation
WHERE job_id LIKE 'SA%'; which of the following statement will help to delete the
d) None of the above child record when a parent is getting deleted.
Topic: Data Retrieval Manipulation a) ALTER TABLE DEPT ADD FOREIGN KEY (empno)
Which of the following Oracle Function retrieves maximum REFERENCES emp(empno) ON DELETE CASCADE;
salary from EMP table ? b) ALTER TABLE DEPT ADD FOREIGN KEY (empno)
a) MAX REFERENCES emp(empno) ON DELETE ALL;
b) MIN c) ALTER TABLE DEPT ADD FOREIGN KEY (empno)
c) AVG REFERENCES emp(empno) DELETE ALL;
d) None of the above d) ALTER TABLE DEPT ADD FOREIGN KEY (empno)
Topic: Data Retrieval Manipulation REFERENCES emp(empno) AFTER DELETE CASCADE ;
Which of the following Oracle Function retrieves average Topic: Data Retrieval Manipulation
salary from EMP table ? Which of the following is NOT TRUE about the PURGE
a) MAX clause in delete statement
b) MIN a) Deletes the data from child tables
c) AVG b) Drops the table and releases the space associated with
d) None of the above it in a single step
Topic: Data Retrieval Manipulation c) Database does not place the table and its dependent
Which of the following UPDATE statement is TRUE objects into the recycle bin
a) UPDATE emp SET empno=12 , empname = 'JOHN' d) All the above
WHERE empno=1; Topic: Data Retrieval Manipulation
b) UPDATE SET empno=12 , EMPNAME = 'JOHN' ON emp In a SELECT statement that includes a WHERE clause,
WHERE EMPNO=1; where is the GROUP BY clause placed in the SELECT
c) UPDATE SET empno=12 , EMPNAME = 'JOHN' FROM statement?
emp WHERE EMPNO=1 a) Immediately after the SELECT clause
d) None of the above b) Before the WHERE clause
Topic: Data Retrieval Manipulation c) After the WHERE clause
Which of the following operation will not make an entry in d) After the ORDER BY clause
the log file
a) TRUNCATE Topic: Joins and Subqueries
b) DELETE The result of a ------------- for tables A and B always
c) INSERT contains all records of the "left" table (A), even if the join-
d) UPDATE condition does not find any matching record in the "right"
Topic: Data Retrieval Manipulation table (B).
Which command is used to delete the table information a) left outer join
from RECYCLEBIN b) RIGHT OUTER JOIN
a) Drop table from recyclebin c) FULL OUTER JOIN
b) Purge recyclebin d) None of the above
c) Delete recyclebin Topic: Joins and Subqueries
d) None of the above A left outer join will return all the rows that an inner join
Topic: Data Retrieval Manipulation returns plus one row for each of the other rows in the first
Space is allocated to temporary table during table that did not have a match in the second table
_________________ a) TRUE
a) Creation of temp table b) FALSE
b) First DML operation Topic: Joins and Subqueries
c) Compilation of table In which of the following join ,
d) Data Dictionary updation.
Topic: Data Retrieval Manipulation
Every record from the "right" table (B) will appear in the A subquery in the FROM clause of a SELECT statement is
result set at least once with null values for non-matching called :
from the "left" table (A) a) Nested subquery
a) LEFT OUTER JOIN b) Inline view
b) RIGHT OUTER JOIN c) Correlated subquery
c) FULL OUTER JOIN d) None
d) Inner join Topic: Joins and Subqueries
Topic: Joins and Subqueries what is the difference between Inner and equi join
In ----------------- join predicate arises implicitly by a) An inner join is a type of join where we use = and <> in
comparing all columns in both tables that have the same the where condition joining the tables. In an equi join we
column-name in the joined tables. join tables with = operator only
a) Equi Join b) An inner join is a type of join where we use =+ in the
b) Inner Join where condition joining the tables. In an equi join we join
c) Outer Join tables with + = operator only
d) Natural Join c) An equi join is a type of join where we use = and <> in
Topic: Joins and Subqueries the where condition joining the tables. In an inner join we
Evaluate the following SQL statement: join tables with = operator only
SELECT e.EMPLOYEE_ID,e.LAST_NAME,e.DEPARTMENT_ID, d) inner join and equi join both are same
d.DEPARTMENT_NAME Topic: Joins and Subqueries
FROM EMP e, DEPARTMENT d Which operator can be used with a multiple-row
WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID; subquery?
In the statement, which capabilities of a SELECT statement a) <>
are performed? b) LIKE
a) Selection, projection, join c) BETWEEN
b) Difference, projection, join d) NOT IN
c) Selection, intersection, join Topic: Joins and Subqueries
d) Difference, projection, product Table A has 5 rows and table B has 0 rows Cartesian join
Topic: Joins and Subqueries on A,B will have----rows.
An inner join essentially combines the records from two a) 1
tables (A and B) based on a given join-predicate. b) 0
a) TRUE c) 5
b) FALSE d) None of the above
Topic: Joins and Subqueries Topic: Joins and Subqueries
Which statement about subqueries is true? Which clause on merge statement is used to specify the
a) A single row subquery can retrieve data from more source of the data to be updated or inserted?
than one table. a) using
b) A single row subquery can retrieve data from only one b) on
table. c) into
c) A single row single column subquery cannot be used in d) merge_update_clause
a condition where the LIKE operator is used for Topic: Joins and Subqueries
comparison. Consider the following query :
d) None of the above select e.name, d.depid
Topic: Joins and Subqueries from emp e, dept d
What is true about the following two sql statements? where e.depid(+) = d.depid;
SELECT last_name, salary , hire_date FROM EMPLOYEES The above query indicates :
ORDER BY salary DESC; a) Right Outer Join
SELECT last_name, salary, hire_date FROM EMPLOYEES b) Left Outer Join
ORDER BY 2 DESC; c) Natural Join
a) The two statements produce identical results. d) Invalid Query
b) The second statement returns a syntax error Topic: Joins and Subqueries
c) There is no need to specify DESC because the results Which of the following is true regarding subqueries?
are sorted in descending order by default. a) No limit on subquery in WHERE clause and 256 level
d) None of the above can be nested in FROM clause
Topic: Joins and Subqueries
b) No limit on subquery in FROM clause and 255 level can c) error at line 3
be nested in WHERE clause d) None of the above
c) No limit on subquery in WHERE clause and 255 levels Topic: Joins and Subqueries
can be nested in FROM clause A full outer join combines the results of both left and right
d) No limit on subquery in WHERE clause and 32 level can outer joins.
be nested in FROM clause a) TRUE
Topic: Joins and Subqueries b) FALSE
The SQL------------------- operator takes the results of two Topic: Joins and Subqueries
queries and returns only rows that appear in both result What are the different types of OUTER JOINS?
sets. a) LEFT OUTER JOIN
a) INTERSECT b) RIGHT OUTER JOIN
b) UNION c) FULL OUTER JOIN
c) EXCEPT d) All of the above
d) None of the above Topic: Joins and Subqueries
Topic: Joins and Subqueries Which statements about subqueries are true?
What is wrong with the following query? a) A single row subquery can retrieve only one column
select col1, col2, col3 and one row.
from TableA, TableB, TableC b) A single row subquery can retrieve only one row but
where TableA.col1 = TableB.col1 many columns.
group by col3 c) A multiple row multiple columns subquery can be
a) col1 is ambiguously named but is not properly prefixed compared by using the ">" operator.
in the select clause. d) A single row single column subquery can not use the IN
b) There is no order by clause. operator.
c) Group by clauses are not permitted in a join. Topic: Joins and Subqueries
d) Identically named columns in two separate tables are The order in which the system joins tables changes the
not permitted in a join clause. final result-set of the query.
Topic: Joins and Subqueries a) TRUE
In which case would you use a FULL OUTER JOIN? b) FALSE
a) Both tables have NULL values. Topic: Joins and Subqueries
b) You want all unmatched data from one table. select 1 ,2 from dual
c) You want all unmatched data from both tables. union all
d) One of the tables has more data than the other. select 1,2 from dual;
Topic: Joins and Subqueries How many rows will be selected by the above query?
A subquery can be used to _________. a) 1
a) Sort data in a specific order b) 2
b) Convert data to a different format c) 0
c) Retrieve data based on an unknown condition d) Throws an error
d) All of the above Topic: Joins and Subqueries
Topic: Joins and Subqueries A join is a query that combines rows from two or more
select 1 ,2 from dual tables, views, or materialized views
union a) TRUE
select 1,2 from dual; b) FALSE
What will be the output of the above query Topic: Joins and Subqueries
a) 1 2 A join is a query that combines rows from only one table
b) 2 1 a) TRUE
c) null null b) FALSE
d) Throws an error Topic: Joins and Subqueries
Topic: Joins and Subqueries During Joins, if any two of these tables have a column
1 select 'A','B' from dual name in common, then you must qualify all references to
2 union these columns throughout the query with table names to
3 select 1,2 from dual ; avoid ambiguity
The above statement throws an error at line number ___? a) TRUE
a) error at line 1 b) FALSE
b) error at line 2 Topic: Joins and Subqueries
An equijoin is a join with a join condition containing an Topic: Joins and Subqueries
equality operator Full outer join can be achieved by using which of the
a) TRUE following option?
b) FALSE a) Left Outer Join intersect Right Outer Join
Topic: Joins and Subqueries b) Left Outer Join minus Right Outer Join
An equijoin is a join with a join condition containing an c) Left Outer Join union Right Outer Join
inequality operator d) None of the above
a) TRUE Topic: Joins and Subqueries
b) FALSE Which of the below statement could be accurate in
Topic: Joins and Subqueries describing Cartesian product?
A self join is a join of a table to itself a) select * from a, b where 1=2;
a) TRUE b) select * from a, b;
b) FALSE c) Both A & B
Topic: Joins and Subqueries d) None of the above
A self join is a join of two different tables Topic: Joins and Subqueries
a) TRUE In Oracle, Table A has 5 rows and table B has 1 row.
b) FALSE How many rows will be returned by the below query?
Topic: Joins and Subqueries Select * from A, B;
A cartesian product join is a join between two tables with a) 1
no join condition b) 5
a) TRUE c) 6
b) FALSE d) None of the above
Topic: Joins and Subqueries Topic: Joins and Subqueries
A cartesian product join is a join between two tables with In Oracle, Table A has 2 rows and table B has 3 rows.
atleast one join condition How many rows will be returned by the below query?
a) TRUE Select * from A, B;
b) FALSE a) 2
Topic: Joins and Subqueries b) 3
An inner join is also called a simple join c) 5
a) TRUE d) 6
b) FALSE
Topic: Joins and Subqueries
An inner join is also called as a self join
a) TRUE
b) FALSE
Topic: Joins and Subqueries
A natural join is a join statement that compares the
common columns of both tables with each other
a) TRUE
b) FALSE
Topic: Joins and Subqueries
A natural join is same as equi join
a) TRUE
b) FALSE
Topic: Joins and Subqueries
A natural join is NOT same as equi join
a) TRUE
b) FALSE
Topic: Joins and Subqueries
In Oracle, a sub query can be used to _________
a) Create groups of data
b) Sort data in a specific order
c) Convert data to a different format
d) Retrieve data based on an unknown condition

You might also like