0% found this document useful (0 votes)
54 views

Test1 Oca

Uploaded by

sreeni.thummana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Test1 Oca

Uploaded by

sreeni.thummana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

1.

Which SELECT statement should you use to extract the year from the system date and display it in the format "1998"?
A. SELECT TO_CHAR(SYSDATE,'yyyy') FROM dual;
B. SELECT TO_DATE(SYSDATE,'yyyy') FROM dual;
C. SELECT DECODE(SUBSTR(SYSDATE, 8), 'YYYY') FROM dual;
D. SELECT DECODE(SUBSTR(SYSDATE, 8), 'year') FROM dual;
E. SELECT TO_CHAR(SUBSTR(SYSDATE, 8,2),'yyyy') FROM dual;

2. Which two statements about the evaluation of clauses in a SELECT statement are true? (Choose two.)
A. The Oracle Server will evaluate a HAVING clause before a WHERE clause.
B. The Oracle Server will evaluate a WHERE clause before a GROUP BY clause.
C. The Oracle Server will evaluate a GROUP BY clause before a HAVING clause.
D. The Oracle Server will evaluate an ORDER BY clause before a WHERE clause.
E. The Oracle Server will evaluate an ORDER BY clause before a HAVING clause.

3. Which clause would you use in a SELECT statement to limit the display to those employees whose salary is greater then 5000?
A. ORDER BY SALARY > 5000
B. GROUP BY SALARY > 5000
C. HAVING SALARY > 5000
D. WHERE SALARY > 5000

4. Which are iSQL*Plus commands? (Choose all that apply.)


A. INSERT
B. UPDATE
C. SELECT
D. DESCRIBE
E. DELETE
F. RENAME

5. Which two statements are true regarding the default behavior of the ORDER BY clause? (Choose two.)
A. Null values are left out of the sort.
B. Character values are displayed from Z to A.
C. Date values are displayed with the earliest value first.
D. Null values are displayed last for descending sequences.
E. Numeric values are displayed with the lowest values first.

6. Which statement adds a constraint that ensures the CUSTOMER_NAME column of the CUSTOMERS table holds a value?
A. ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;
B. ALTER TABLE customers MODIFY CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;
C. ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn NOT NULL;
D. ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn IS NOT NULL;
E. ALTER TABLE customers MODIFY name CONSTRAINT cust_name_nn NOT NULL;
F. ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name NOT NULL;

7. What is necessary for your query on an existing view to execute successfully?


A. The underlying tables must have data.
B. You need SELECT privileges on the view.
C. The underlying tables must be in the same schema.
D. You need SELECT privileges only on the underlying tables.

8. Evaluate this SQL statement: SELECT e.employee_id, (.15* e.salary) + (.5 * e.commission_pct) + (s.sales_amount * (.35 * e.bonus)) AS
CALC_VALUE FROM employees e, sales s WHERE e.employee_id = s.emp_id; What will happen if you remove all the parentheses from the
calculation?
A. The value displayed in the CALC_VALUE column will be lower.
B. The value displayed in the CALC_VALUE column will be higher.
C. There will be no difference in the value displayed in the CALC_VALUE column.
D. An error will be reported.

9. The CUSTOMERS table has these columns: CUSTOMER_ID NUMBER(4) NOT NULL CUSTOMER_NAME VARCHAR2(100) NOT NULL
CUSTOMER_ADDRESS VARCHAR2(150) CUSTOMER_PHONE VARCHAR2(20) You need to produce output that states "Dear Customer
customer_name, ". The customer_name data values come from the CUSTOMER_NAME column in the CUSTOMERS table. Which
statement produces this output?
A. SELECT dear customer, customer_name, FROM customers;
B. SELECT "Dear Customer", customer_name || ',' FROM customers;
C. SELECT 'Dear Customer ' || customer_name ',' FROM customers;
D. SELECT 'Dear Customer ' || customer_name || ',' FROM customers;
E. SELECT "Dear Customer " || customer_name || "," FROM customers;
F. SELECT 'Dear Customer ' || customer_name || ',' || FROM customers;

10. Which three SELECT statements display 2000 in the format "$2,000.00"? (Choose three.)
A. SELECT TO_CHAR(2000, '$#,###.##') FROM dual;
B. SELECT TO_CHAR(2000, '$0,000.00') FROM dual;
C. SELECT TO_CHAR(2000, '$9,999.00') FROM dual;
D. SELECT TO_CHAR(2000, '$9,999.99') FROM dual;
E. SELECT TO_CHAR(2000, '$2,000.00') FROM dual;
F. SELECT TO_CHAR(2000, '$N,NNN.NN') FROM dual;

11. Examine this statement: SELECT student_id, gpa FROM student_grades WHERE gpa > &&value; You run the statement once, and when
prompted you enter a value of 2.0. A report is produced. What happens when you run the statement a second time?
A. An error is returned.
B. You are prompted to enter a new value.
C. A report is produced that matches the first report produced.
D. You are asked whether you want a new value or if you want to run the report based on the previous value.

12. Examine the SQL statement that creates ORDERS table: CREATE TABLE orders (SER_NO NUMBER UNIQUE, ORDER_ID NUMBER,
ORDER_DATE DATE NOT NULL, STATUS VARCHAR2(10) CHECK (status IN ('CREDIT', 'CASH')), PROD_ID NUMBER REFERENCES
PRODUCTS(PRODUCT_ID), ORD_TOTAL NUMBER, PRIMARY KEY (order_id, order_date)); For which columns would an index be
automatically created when you execute the above SQL statement? (Choose two.)
A. SER_NO
B. ORDER_ID
C. STATUS
D. PROD_ID
E. ORD_TOTAL
F. composite index on ORDER_ID and ORDER_DATE

13. Which three SELECT statements display 2000 in the format "$2,000.00"? (Choose three.)
A. SELECT TO_CHAR(2000, '$#,###.##') FROM dual;
B. SELECT TO_CHAR(2000, '$0,000.00') FROM dual;
C. SELECT TO_CHAR(2000, '$9,999.00') FROM dual;
D. SELECT TO_CHAR(2000, '$9,999.99') FROM dual;
E. SELECT TO_CHAR(2000, '$2,000.00') FROM dual;
F. SELECT TO_CHAR(2000, '$N,NNN.NN') FROM dual;

14. Examine the description of the MARKS table: STD_ID NUMBER(4) STUDENT_NAME VARCHAR2(30) SUBJ1 NUMBER(3) SUBJ2 NUMBER(3)
SUBJ3 NUMBER(3) SUBJ1, SUBJ2, and SUBJ3 indicate the marks (grades) obtained by a student in the three subjects. Which two
statements are valid? (Choose two.)
A. SELECT SUM(subj1, subj2, subj3) FROM marks;
B. SELECT SUM(subj1 + subj2 + subj3) FROM marks;
C. SELECT SUM(subj1), SUM(subj2), SUM(subj3) FROM marks;
D. SELECT MAX(subj1, subj2, subj3) FROM marks;
E. SELECT MINIMUM(subj1) FROM marks;
F. SELECT COUNT(std_id) FROM marks WHERE subj1 >= AVG(subj1);

15. The EMPLOYEES table contains these columns: EMPLOYEE_ID NUMBER(4) LAST_NAME VARCHAR2 (25) JOB_ID VARCHAR2(10) You want
to search for strings that contain 'SA_' in the JOB_ID column. Which SQL statement do you use?
A. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA\_%' ESCAPE '\';
B. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA_';
C. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA_' ESCAPE "\";
D. SELECT employee_id, last_name, job_id FROM employees WHERE job_id = '%SA_';

16. The INVENTORY table contains these columns: ID_NUMBER NUMBER PK CATEGORY VARCHAR2(10) LOCATION NUMBER DESCRIPTION
VARCHAR2(30) PRICE NUMBER(7,2) QUANTITY NUMBER . You want to return the total of the extended amounts for each item category
and location, including only those inventory items that have a price greater than $100.00. The extended amount of each item
A. SELECT category, SUM(price * quantity) TOTAL, location FROM inventory WHERE price > 100.00 GROUP BY category;
B. SELECT category, location, SUM(price) FROM inventory WHERE price > 100.00 GROUP BY category, location;
C. SELECT category, SUM(price * quantity) TOTAL, location FROM inventory WHERE price > 100.00;
D. SELECT category, SUM(price * quantity) TOTAL, location FROM inventory WHERE price > 100.00 GROUP BY category, location;

17. Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME
VARCHAR2(25) HIRE_DATE DATE You issue these statements: CREATE table new_emp ( employee_id NUMBER, name VARCHAR2(30));
INSERT INTO new_emp SELECT employee_id , last_name from employees; Savepoint s1; UPDATE new_emp set name = UPPER(name);
Savepoint s2; Delete from new_emp; Rollback to s2; Delete from new_emp where employee_id =180; UPDATE new_emp set name =
'James'; Rollback to s2; UPDATE new_emp set name = 'James' WHERE employee_id =180; Rollback; At the end of this transaction, what is
true?
A. You have no rows in the table.
B. You have an employee with the name of James.
C. You cannot roll back to the same savepoint more than once.
D. Your last update fails to update any rows because employee ID 180 was already deleted.

18. Which SELECT statement will the result ‘elloworld’ from the string ‘HelloWorld’?
A. SELECT SUBSTR( ‘HelloWorld’,1) FROM dual;
B. SELECT INITCAP(TRIM (‘HelloWorld’, 1,1)) FROM dual;
C. SELECT LOWER(SUBSTR(‘HellowWorld’, 1, 1) FROM dual;
D. SELECT LOWER(SUBSTR(‘HelloWorld’, 2, 1) FROM dual;
E. SELECT LOWER(TRIM (‘H’ FROM ‘HelloWorld’)) FROM dual;

19. Which two tasks can you perform by using the TO_CHAR function? (Choose two)
A. Convert 10 to ‘TEN’
B. Convert ‘10’ to 10
C. Convert ‘10’ to ‘10’
D. Convert ‘TEN’ to 10
E. Convert a date to a character expression
F. Convert a character expression to a date
20. Which three functions can be used to manipulate character, number, or date column values? (Choose three.)
A. CONCAT
B. ROUND
C. TRUNC
D. RPAD
E. INSTR

21. Which SELECT statement should you use if you want to display unique combinations of the POSITION and MANAGER values from the
EMPLOYEE table?
A. SELECT DISTINCT position, manager FROM employee;
B. SELECT position, manager DISTINCT FROM employee;
C. SELECT position, manager FROM employee;
D. SELECT position, DISTINCT manager FROM employee;

22. Which three pieces of information are considered while deciding the size of the undo tablespace in your database? (Choose three.)
A. the size of an undo block
B. the size of the redo log files
C. undo blocks generated per second
D. the size of the database buffer cache
E. the value of the UNDO_RETENTION parameter

23. Which three statements are true about the stages of database startup? (Choose three.)
A. Data files and redo log files can be renamed at the MOUNT stage.
B. Control files are read at the OPEN stage for the location of data files.
C. Control files are required to bring the database to the NOMOUNT stage.
D. Data files and redo log files are made available to users at the OPEN stage.
E. Data files and online redo log files are checked for consistency while opening the database.

24. The EMPloyee table contains these columns: Empno Number(4) Ename Varchar2(10) job varchar2(10) sal Varchar2(10) You need to
display the employees information by using this query. How many columns are presented after executing this query: SELECT Empno||','||
Ename||','||Job "Employee Information" FROM employee;
A. 1
B. 2
C. 3
D. 4
E. 0

25. You need to display the last names of those employees who have the letter “A” as the second character in their names. Which SQL
statement displays the required results?
A. SELECT last_name FROM EMP WHERE last_name LIKE ‘_A%’;
B. SELECT last_name FROM EMP WHERE last name =’*A%’
C. SELECT last_name FROM EMP WHERE last name =’_A%’;
D. SELECT last_name FROM EMP WHERE last name LIKE ‘*A%’
26. Which statement regarding the contents of the V$PARAMETER view is true?
A. displays only the list of default values
B. displays only the list of all basic parameters
C. displays the currently in effect parameter values
D. displays only the list of all advanced parameters
E. displays the list of all the parameter files of a database
F. displays the current contents of the server parameter file
27. Examine the description of the STUDENTS table: STD_ID NUMBER(4) COURSE_ID VARCHARD2(10) START_DATE DATE END_DATE DATE.
Which two aggregate functions are valid on the START_DATE column? (Choose two)
A. SUM(start_date)
B. AVG(start_date)
C. COUNT(start_date)
D. AVG(start_date, end_date)
E. MIN(start_date)
F. MAXIMUM(start_date)
28. You want to use a function in you column clause of a SQL statement. The NVL function accomplishes which of the following tasks?
A. Assists in the distribution of output across multiple columns.
B. Enables you to specify alternate output for non-NULL column values.
C. Enables you to specify alternated out for NULL column values.
D. Nullifies the value of the column out put.

29. You would like to display the system date in the format "Monday, 01 June, 2001". Which SELECT statement should you use?
A. SELECT TO_DATE(SYSDATE, 'FMDAY, DD Month, YYYY') FROM dual;
B. SELECT TO_CHAR(SYSDATE, 'FMDD, DY Month, 'YYY') FROM dual;
C. SELECT TO_CHAR(SYSDATE, 'FMDay, DD Month, YYYY') FROM dual;
D. SELECT TO_CHAR(SYSDATE, 'FMDY, DDD Month, YYYY') FROM dual;
E. SELECT TO_DATE(SYSDATE, 'FMDY, DDD Month, YYYY') FROM dual;

30. Which two statements about views are true? (Choose two.)
A. A view can be created as read only.
B. A view can be created as a join on two or more tables.
C. A view cannot have an ORDER BY clause in the SELECT statement.
D. A view cannot be created with a GROUP BY clause in the SELECT statement.
E. A view must have aliases defined for the column names in the SELECT statement.

31. Because of a power outage, instance failure has occurred. From what point in the redo log does recovery begin and where does it end?
A. current redo log and inactive redo log
B. checkpoint position to end of redo log
C. beginning of redo log to end of redo log
D. all redo logs before the point of last commit
E. beginning of redo log to checkpoint position

32. Which clause should you use to exclude group results?


A. WHERE
B. HAVING
C. RESTRICT
D. GROUP BY
E. ORDER BY

33. According to your backup strategy, you performed an incremental level 0 backup of your database. Which statement regarding this
backup is true?
A. The backup is similar to image copy.
B. The backup contains all used data blocks.
C. The backup contains only unused data blocks.
D. The backup contains all data blocks changed since the last incremental level 1 backup.

34. Evaluate the set of SQL statements: CREATE TABLE dept (deptno NUMBER(2), dname VARCNAR2(14), loc VARCNAR2(13)); ROLLBACK;
DESCRIBE DEPT What is true about the set?
A. The DESCRIBE DEPT statement displays the structure of the DEPT table.
B. The ROLLBACK statement frees the storage space occupies by the DEPT table.
C. The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does not exist.
D. The DESCRIBE DEPT statement displays the structure of the DEPT table only if the us a COMMIT statement introduced before
the ROLLBACK statement..
35. In which scenario would an index be most useful?
A. The indexed column is declared as NOT NULL.
B. The indexed columns are used in the FROM clause.
C. The indexed columns are part of an expression.
D. The indexed column contains a wide range of values.

36. Which three statements correctly describe the functions and use of constraints? (Choose three.)
A. Constraints provide data independence.
B. Constraints make complex queries easy.
C. Constraints enforce rules at the view level.
D. Constraints enforce rules at the table level.
E. Constraints prevent the deletion of a table if there are dependencies.
F. Constraints prevent the deletion of an index if there are dependencies.

37. Which two statements are true about the roles in the Oracle database? (Choose two.)
A. A role can be granted to itself.
B. Roles are owned by the SYS user.
C. Roles can be granted to other roles.
D. A role cannot be assigned external authentication.
E. A role can contain both system and object privileges.

38. You want to use SQL*Plus to connect to the oracle database. Which of the following choices does not indicate a component you must
specify when logging into the oracle?
A. The SQL*Plus Keyword.
B. The username
C. The password.
D. The database name.

39. From SQL*Plus, you issue this SELECT statement: SELECT* From orders; You use this statement to retrieve data from a data table for
__________. (Choose all that apply)
A. Updating
B. Viewing
C. Deleting
D. Inserting
E. Truncating

40. Which /SQL*Plus feature can be used to replace values in the WHERE clause?
A. Substitution variables
B. Replacement variables
C. Prompt variables
D. Instead-of variables
E. This feature cannot be implemented through /SQL*Plus.

41. Which two operations require undo data? (Choose two.)


A. committing a transaction
B. rolling back a transaction
C. recovering from failed transactions
D. recording a transaction to redo log files
E. rolling forward during instance recovery

42. Evaluate the SQL statement: SELECT ROUND(TRUNC(MOD(1600,10),-1),2) FROM dual; What will be displayed?
A. 0
B. 1
C. 0.00
D. an error statement

43. The STUDENT_GRADES table has these columns: STUDENT_ID NUMBER(12) SEMESTER_END DATE GPA NUMBER(4,3) The registrar has
requested a report listing the students' grade point averages (GPA), sorted from highest grade point average to lowest within each
semester, starting from the earliest date. Which statement accomplishes this?
A. SELECT student_id, semester_end, gpa FROM student_grades ORDER BY semester_end DESC, gpa DESC;
B. SELECT student_id, semester_end, gpa FROM student_grades ORDER BY semester_end ASC, gpa ASC;
C. SELECT student_id, semester_end, gpa FROM student_grades ORDER BY semester_end, gpa DESC;
D. SELECT student_id, semester_end, gpa FROM student_grades ORDER BY gpa DESC, semester_end DESC;
E. SELECT student_id, semester_end, gpa FROM student_grades ORDER BY gpa DESC, semester_end ASC;
44. Which SQL statement displays the date March 19, 2001 in a format that appears as "Nineteenth of March 2001 12:00:00 AM"?
A. SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'fmDdspth "of" Month YYYY fmHH:MI:SS AM') NEW_DATE FROM
dual;
B. SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'Ddspth "of" Month YYYY fmHH:MI:SS AM') NEW_DATE FROM
dual;
C. SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'fmDdspth "of" Month YYYY HH:MI:SS AM') NEW_DATE FROM
dual;
D. SELECT TO_CHAR(TO_DATE('19-Mar-2001', 'DD-Mon-YYYY'), 'fmtDdspth "of" Month YYYY fmtHH:MI:SS AM') NEW_DATE FROM
dual;

45. A subquery 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

46. Evaluate this SQL*Plus command: START delaccount Which task will this command accomplish?
A. It executes the DELACCOUNT PL/SQL routine.
B. It runs the DELACCOUNT.SQL script file.
C. It creates the DELACCOUNT file using the default file extension.
D. It invokes the editor to edit the contents of the DELACCOUNT file.

You might also like