Quiz
Fundamentals
This quiz has a time limit, so it opens in the usual player.
Questions in this quiz (23)
1Which two statements are true regarding working with dates?
- AThe default internal storage of dates is in the numeric format
- BThe RR date format automatically calculates the century from the SYSDATE function but allows the user to enter the century if required
- CThe default internal storage of dates is in the character format
- DThe RR date format automatically calculates the century from the SYSDATE function and does not allow the user to enter the century
2promo_begin_date is stored in the default date format. Produce a report that provides name, cost, and start date of all promos in the post category that were launched before jan 1, 2000.
- Aselect promo_name, promo_cost, promo_begin_date
from promotions
where promo_category='post' and promo_begin_date <'01-01-00'; - Bselect promo_name, promo_cost, promo_begin_date
from promotions
where promo_cost like 'post%' and promo_begin_date <'01-01-2000'; - Cselect promo_name, promo_cost, promo_begin_date
from promotions
where promo_category like 'p%' and promo_begin_date <'1-JANUARY-2000'; - Dselect promo_name, promo_cost, promo_begin_date
from promotions
where promo_category like '%post%' and promo_begin_date <'1-JAN-00';
- Aselect promo_name, promo_cost, promo_begin_date
3Employees:
Employee_id number(4)
Last_name varchar2 (25)
Job_ID varchar2 (10)
Search for strings 'SA_' in job_ID.- Aselect employee_id, last_name, job_id from employees where job_id like '%SA\_'ESCAPE'\';
- Bselect employee_id, last_name, job_id from employees where job_id like '%SA_';
- Cselect employee_id, last_name, job_id from employees where job_id like '%SA_'ESCAPE"\";
- Dselect employee_id, last_name, job_id from employees where job_id ='%SA_';
4Which two are valid?
- Aselect promo_id, decode(nvl(promo_cost, 0), promo_cost, promo_cost * 0.25, 100) "Discount"
from promotions; - Bselect promo_id, decode(promo_cost, 10000, decode(promo_category, 'G1', promo_cost *.25, NULL), NULL) "Catcost"
from promotions; - Cselect promo_id, decode(nullif(promo_cost, 10000), null, promo_cost *.25,'N/A') "Catcost"
from promotions; - Dselect promo_id, decode(promo_cost, >10000, 'High',<10000, 'Low') "Range"
from promotions;
- Aselect promo_id, decode(nvl(promo_cost, 0), promo_cost, promo_cost * 0.25, 100) "Discount"
5Which two are true regarding dates?
- ADefault internal storage of dates is in the numeric format
- BThe RR date format automatically calculates the century from sysdate function but allows the user to enter century if required
- CDefault internal storage of dates is in the character format
- DThe RR date format automatically calculates the century from sysdate function and does not allow the user to enter century if required
6Which two are true regarding using and on clauses in table joins?
- AOn clause can be used to join tables on columns that have different names but compatible data types
- BMaximum one pair of columns can be joined between two tables using the on clause
- CBoth using and on clause can be used for equijoins and nonequijoins
- DWhere clause can be used to apply additional conditions in the select statement containing the on or the using clause
7In which two cases would one use an outer join?
- ATables being joined have not null columns
- BTables being joined have only matched data
- CColumns being joined have null values
- DTables being joined have only unmatched data
- ETables being joined have both matched and unmatched data
8Which two are true regarding constraints?
- AFK cannot contain null values
- BColumn with unique constraint can contain null values
- CConstraint is enforced only for insert operation on table
- DConstraint can be disabled even if constraint column contains data
9select lpad (salary, 10, '*')
from emp
where emp_id=1001;
If employee 1001 has a salary of 17000, what is the result?- A17000.00
- B17000*****
- C****170.00
- D**17000.00
- Eerror
10Create synonym emp for hr.employees;
What happens?- AError
- BTwo identical tables in HR schema with different names
- CA table called employees in HR schema based on EMP table is created
- DAlternative name for employees table in HR schema in your schema is created
11Display date 13-Oct-2008 in words: 'Thirteenth of October, Two Thousand Eight.'
- Aselect to_char('13-oct-2008', 'fmDdspth "of" Month, Year') from dual;
- Bselect to_char(to_date('13-oct-2008'), 'fmDdspth of month, year') from dual;
- Cselect to_char(to_date('13-oct-2008'), 'fmDdthsp "of" Month, Year') from dual;
- Dselect to_date(to_char('13-oct-2008', 'fmDdspth "of" Month, Year')) from dual
12Name three tasks that can be performed using SQL functions built into oracle?
- ADisplaying date in non-default format
- BCombining more than two columns/expressions into single column in the output
- CFinding number of characters in an expression
- DSubstituting character string in a test expression with a specified string
13Which union operator statement is true?
- AAll column names must be identical across all select statements
- BNull values are not ignored during duplicate checking
- COutput is not sorted by default
- DNumber of columns selected in all select statements need to be the same
14The following fails:
select e.emp_name, d.dept_name
from employees e
join departments d
using (department_id)
where d.department_id not in (10,40)
order by dept_name;
Find fix.- ARemove table alias prefix from where clause
- BRemove table alias from select clause
- CRemove order by clause
- DPrefix the column in the using clause with the table alias
- EPrefix the column in the order by clause with table alias
15Select two true statements regarding where and having clauses in select statements
- AHaving clause can be used with aggregate functions in subqueries
- BWhere clause can be used to exclude rows before dividing them into groups
- CWhere clause can be used to exclude rows after dividing them into groups
- DAggregate functions and columns used in the having clause must be specified in the select list of the query
16A sequence called EMP_ID_SEQ is created in order to populate values for the employee_id column of the employees table. Select two true statements.
- ACannot use the EMP_ID_SEQ to populate job_id column
- BEMP_ID_SEQ is invalidated when employee_id is modified
- CEMP_ID_SEQ not affected by modifications to employees table
- DEMP_ID_SEQ is dropped when employees table is dropped
- EAny other column of number type in your schema can use EMP_ID_SEQ
17Select three true statements regarding views.
- AViews can be created only from tables
- BViews can be created from tables and other views
- CBoth simple/complex views can use indexes existing on underlying tables
- DOnly simple views can use indexes existing on underlying tables
- EComplex views can be created on multiple tables that exist in the same/different schemas
- FComplex views can only be created on multiple tables that exist in the same schema
18Select three true statements regarding sub-queries
- ASub-queries can contain order by but not group by clause
- BMain/Sub query must get data from same tables
- CMain/Sub query can get data from different tables
- DSub queries can contain group by and order by clauses
- EMultiple columns/expressions can be compared between main/sub query
- FOnly one column/expression can be compared between main/sub query
19Select two correct statements that can be executed on a Job_detail table
- AOne cannot add a new column to the table with long as the data type
- BJob_image column cannot be included in the order by clause (because it can be null)
- CJob_image column can be included in the group by clause
- DOne can alter the table to include not null constraint on the job_image column
20Select two true statements regarding single row functions
- ATRUNC: can be used with number and date values
- BSYSDATE: returns database server current date/time
- CMOD: returns quotient of division
- DCONCAT: can be used with number/date values
- EINSTR: can be used to find only the first occurrence of character in a string
- FTRIM: can be used to remove all the occurrences of a character from a string
21Display the first names of all customers from the customers table that contain 'e' and have 'a' in the second last position. Select the correct answer.
- Aselect cust_first_name
from customers
where instr(cust_first_name, 'e')<>0 and
substr(cust_first_name, -2, 1)='a' - Bselect cust_first_name
from customers
where instr(cust_first_name, 'e')<>" and
substr(cust_first_name, -2, 1)='a' - Cselect cust_first_name
from customers
where instr(cust_first_name, 'e') is not null and
substr(cust_first_name, 1, -2)='a' - Dselect cust_first_name
from customers
where instr(cust_first_name, 'e')<>0 and
substr(cust_first_name, length(cust_first_name), -2)='a'
- Aselect cust_first_name
22Which statement is true regarding the outcome of the following query?
Select p.prod_id, prod_name, prod_list_price, quantity_sold, cust_last_name
From products p Natural Join sales s Natural Join customers c
Where prod_id=148;- AIt produces an error because a column used in the Natural Join cannot have a qualifier
- BIt produces an error because the Natural Join can be used only with two tables
- CIt produces an error because all columns used in the Natural Join should have a qualifier
- DIt executes successfully
23Which is a valid Create Table statement?
- ACreate Table emp9$# (emp_no NUMBER(4));
- BCreate Table 9emp$# (emp_no NUMBER(4));
- CCreate Table emp*123 (emp_no NUMBER(4));
- DCreate Table emp9$# (emp_no NUMBER(4), date DATE);
Information
- Description
- Quiz on Fundamentals, created by Umanji on 20/04/2015.
- Author
- Umanji
- Language
- English
- Views
- 1
- Rating
- No ratings yet Rate this quiz