Sie sind auf Seite 1von 11

Topic: Data Types The above SQL statement will throw an error as length for

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

Das könnte Ihnen auch gefallen