Oracle Test 5

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By RubiyaSameen
R
RubiyaSameen
Community Contributor
Quizzes Created: 2 | Total Attempts: 2,061
Questions: 50 | Attempts: 1,465

SettingsSettingsSettings
Oracle Quizzes & Trivia

Questions and Answers
  • 1. 

    1.     Evaluate the SQL statement: 1 SELECT a.emp_name, a.sal, a.dept_id, b.maxsal 2 FROM employees a, 3 (SELECT dept_id, MAX(sal) maxsal 4. FROM employees 5 GROUP BY dept_id) b 6 WHERE a.dept_id = b.dept_id 7 AND a.sal < b.maxsal; What is the result of the statement?

    • A.

      The statement produces an error at line 1.

    • B.

      The state ment produces an error at line 3.

    • C.

      The statement produces an error at line 6.

    • D.

      The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all departments that pay less salary then the maximum salary paid in the company.

    • E.

      The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all employees who earn less than the maximum salary in their department.

    Correct Answer
    E. The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all employees who earn less than the maximum salary in their department.
    Explanation
    The given SQL statement retrieves the employee name, salary, department ID, and maximum salary earned in the department of the employee. It does this by joining the "employees" table with a subquery that calculates the maximum salary for each department. The subquery is aliased as "b" and is grouped by department ID. The main query then filters the results by comparing the employee's salary with the maximum salary in their department. Only the employees who earn less than the maximum salary in their department are included in the result.

    Rate this question:

  • 2. 

    1.     QUESTION NO: 18 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 there is a COMMIT statement introduced before the ROLLBACK statement.

    Correct Answer
    A. The DESCRIBE DEPT statement displays the structure of the DEPT table.
    Explanation
    The correct answer is that the DESCRIBE DEPT statement displays the structure of the DEPT table. This means that when the DESCRIBE DEPT statement is executed, it will show the column names, data types, and other information about the DEPT table. This is useful for understanding the structure of the table and its columns.

    Rate this question:

  • 3. 

    1.     The EMP table contains these columns: LAST NAME VARCHAR2(25) SALARY NUMBER(6,2) DEPARTMENT_ID NUMBER(6) You need to display the employees who have not been assigned to any department. You write the SELECT statement: SELECT LAST_NAME, SALARY, DEPARTMENT_ID FROM EMP WHERE DEPARTMENT_ID = NULL; What is true about this SQL statement?

    • A.

      The SQL statement displays the desired results.

    • B.

      The column in the WHERE clause should be changed to display the desired results.

    • C.

      The operator in the WHERE clause should be changed to display the desired results.

    • D.

      The WHERE clause should be changed to use an outer join to display the desired results.

    Correct Answer
    C. The operator in the WHERE clause should be changed to display the desired results.
    Explanation
    The operator in the WHERE clause should be changed to display the desired results. In SQL, the correct way to check for null values is by using the "IS NULL" operator instead of the "=" operator. So, the correct statement should be "WHERE DEPARTMENT_ID IS NULL" instead of "WHERE DEPARTMENT_ID = NULL".

    Rate this question:

  • 4. 

    A MERGE statement can be used to insert new rows into a table. 

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A MERGE statement can be used to insert new rows into a table. This statement combines the functionality of both INSERT and UPDATE statements. It allows you to insert new rows into a table if they do not already exist, or update existing rows if they do. Therefore, the statement "A MERGE statement can be used to insert new rows into a table" is true.

    Rate this question:

  • 5. 

    A role is created  when the number of people using the database is very high

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given statement suggests that a role is created when the number of people using the database is very high. However, this is not true. A role is not created based on the number of people using the database. Instead, a role is created to assign specific privileges and permissions to a group of users, regardless of the number of users.

    Rate this question:

  • 6. 

    A subquery can be used in the GROUP BY clause of a SELECT statement  

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    A subquery cannot be used in the GROUP BY clause of a SELECT statement. The GROUP BY clause is used to group rows based on a specific column or expression, and a subquery is a query nested within another query. The GROUP BY clause can only contain columns or expressions that are directly referenced in the SELECT statement. Therefore, it is not possible to use a subquery in the GROUP BY clause.

    Rate this question:

  • 7. 

    Before making a tablespace read only, which of the following conditions must be met (Choose all that apply)? 

    • A.

      The tablespace must contain an active rollback segments

    • B.

      The tablespace must be online.

    • C.

      The tablespace must not contain any active rollback segments.

    • D.

      The tablespace must not be involved in an open backup.

    • E.

      The tablespace must be involved in an open backup.

    Correct Answer(s)
    B. The tablespace must be online.
    C. The tablespace must not contain any active rollback segments.
    D. The tablespace must not be involved in an open backup.
    Explanation
    Before making a tablespace read only, the tablespace must be online, meaning it is accessible and available for use. Additionally, there should not be any active rollback segments within the tablespace, as this can cause conflicts and inconsistencies. Lastly, the tablespace should not be involved in an open backup, as this can interfere with the read-only operation.

    Rate this question:

  • 8. 

    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

    Correct Answer
    A. 0
    Explanation
    The SQL statement SELECT ROUND(TRUNC(MOD(1600,10),-1),2)FROM dual; calculates the remainder of dividing 1600 by 10, which is 0. The TRUNC function then truncates this result to the nearest multiple of -1, which is also 0. Finally, the ROUND function rounds this result to 2 decimal places, which is still 0. Therefore, when this statement is evaluated, the value 0 will be displayed.

    Rate this question:

  • 9. 

    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.

    Correct Answer
    C. There will be no difference in the value displayed in the CALC_VALUE column.
    Explanation
    If all the parentheses are removed from the calculation, the order of operations in the calculation will still be maintained. The multiplication and addition operations will still be performed in the correct order, resulting in the same value being displayed in the CALC_VALUE column. Therefore, there will be no difference in the value displayed in the CALC_VALUE column.

    Rate this question:

  • 10. 

    Examine the description of the EMPLOYEES table: EMP_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) JOB_CAT VARCHAR2(30) SALARY NUMBER(8,2) Which statement shows the department ID, minimum salary, and maximum salary paid in that department, only of the minimum salary is less then 5000 and the maximum salary is more than 15000?

    • A.

      SELECT dept_id, MIN(salary(, MAX(salary) FROM employees WHERE MIN(salary) < 5000 AND MAX(salary) > 15000;

    • B.

      SELECT dept_id, MIN(salary), MAX(salary) FROM employees WHERE MIN(salary) < 5000 AND MAX(salary) > 15000 GROUP BY dept_id;

    • C.

      SELECT dept_id, MIN(salary), MAX(salary) FROM employees HAVING MIN(salary) < 5000 AND MAX(salary) > 15000;

    • D.

      SELECT dept_id, MIN(salary), MAX(salary) FROM employees GROUP BY dept_id HAVING MIN(salary) < 5000 AND MAX(salary) < 15000;

    • E.

      SELECT dept_id, MIN(salary), MAX(salary) FROM employees GROUP BY dept_id, salary HAVING MIN(salary) < 5000 AND MAX(salary) > 15000;

    Correct Answer
    E. SELECT dept_id, MIN(salary), MAX(salary) FROM employees GROUP BY dept_id, salary HAVING MIN(salary) < 5000 AND MAX(salary) > 15000;
    Explanation
    The correct answer is the last option: SELECT dept_id, MIN(salary), MAX(salary) FROM employees GROUP BY dept_id, salary HAVING MIN(salary) < 5000 AND MAX(salary) > 15000. This statement uses the GROUP BY clause to group the data by department ID and salary. It then applies the HAVING clause to filter the results, only selecting departments where the minimum salary is less than 5000 and the maximum salary is more than 15000.

    Rate this question:

  • 11. 

    Examine the description of the MARKS table: STD_ID NUMBER(4) STUDENT_NAME VARCHAR2(30) SUBJ1 NUMBER((33)) SUBJ1 and SUBJ2 indicate the marks obtained by a student in two subjects. Examine this SELECT statement based on the MARKS table: SELECT subj1+subj2 total_marks, std_id FROM marks WHERE subj1 > AVG(subj1) AND subj2 > AVG(subj2) ORDER BY total_marks; What is the result of the SELECT statement?

    • A.

      The statement executes successfully and returns the student ID and sum of all marks for each student who obtained more than the average mark in each subject

    • B.

      The statement returns an error at the SELECT clause.

    • C.

      The statement returns an error at the WHERE clause.

    • D.

      The statement returns an error at the ORDER BY clause. SUBJ2

    Correct Answer
    C. The statement returns an error at the WHERE clause.
    Explanation
    The SELECT statement is trying to compare subj1 and subj2 with the AVG(subj1) and AVG(subj2) respectively. However, the AVG function cannot be used directly in the WHERE clause. To compare the marks with the average, a subquery or a derived table needs to be used. Since this is not done in the given SELECT statement, it results in an error at the WHERE clause.

    Rate this question:

  • 12. 

    Examine the structure if the EMPLOYEES and NEW EMPLOYEES tables: EMPLOYEES EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE NEW EMPLOYEES EMPLOYEE_ID NUMBER Primary Key NAME VARCHAR2(60) Which MERGE statement is valid?

    • A.

      MERGE INTO new_employees c USING employees e ON (c.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET c.name = e.first_name ||’,’|| e.last_name WHEN NOT MATCHED THEN INSERT VALUES(e.employee_id, e.first_name ||’, ‘||e.last_name);

    • B.

      MERGE new_employees c USING employees e ON (c.employee_id = e.employee_id) WHEN EXIST THEN UPDATE SET c.name = e.first_name ||’,’|| e.last_name WHEN NOT MATCHED THEN INSERT VALUES(e.employee_id, e.first_name ||’, ‘||e.last_name);

    • C.

      MERGE INTO new employees c USING employees e ON (c.employee_id = e.employee_id) WHEN EXISTS THEN UPDATE SET c.name = e.first_name ||’,’|| e.last_name WHEN NOT MATCHED THEN INSERT VALUES(e.employee_id, e.first_name ||’, ‘||e.last_name);

    • D.

      MERGE new_employees c FROM employees e ON (c.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET c.name = e.first_name ||’,’|| e.last_name WHEN NOT MATCHED THEN INSERT INTO new_employees VALUES(e.employee_id, e.first_name ||’.’||e.last_name);

    Correct Answer
    A. MERGE INTO new_employees c USING employees e ON (c.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET c.name = e.first_name ||’,’|| e.last_name WHEN NOT MATCHED THEN INSERT VALUES(e.employee_id, e.first_name ||’, ‘||e.last_name);
    Explanation
    The correct answer is the first option:

    MERGE INTO new_employees c
    USING employees e
    ON (c.employee_id = e.employee_id)
    WHEN MATCHED THEN
    UPDATE SET
    c.name = e.first_name ||’,’|| e.last_name
    WHEN NOT MATCHED THEN
    INSERT VALUES(e.employee_id, e.first_name ||’,
    ‘||e.last_name);

    This statement uses the correct syntax for the MERGE statement. It specifies the target table (new_employees) and the source table (employees) using the USING clause. It then defines the join condition using the ON clause. The WHEN MATCHED clause is used to specify the action to be taken when a match is found, which in this case is to update the name column in the new_employees table. The WHEN NOT MATCHED clause is used to specify the action to be taken when no match is found, which in this case is to insert a new row into the new_employees table.

    Rate this question:

  • 13. 

    Examine the structure of the EMPLOYEES table: Column name EMPLOYEE_ID LAST_NAME VARCNAR2(30) FIRST_NAME VARCNAR2(30) JOB_ID MGR_ID DEPARTMENT_ID NUMBER You need to create an index called NAME_IDX on the first name and last name fields of the EMPLOYEES table. Which SQL statement would you use to perform this task?

    • A.

      CREATE INDEX NAME_IDX (first_name, last_name);

    • B.

      CREATE INDEX NAME_IDX (first_name AND last_name);

    • C.

      CREATE INDEX NAME_IDX ON (first_name, last_name);

    • D.

      CREATE INDEX NAME_IDX ON employees (first_name AND last_name);

    • E.

      CREATE INDEX NAME_IDX ON employees(first_name, last_name);

    • F.

      CREATE INDEX NAME_IDX FOR employees(first_name, la st_name);

    Correct Answer
    E. CREATE INDEX NAME_IDX ON employees(first_name, last_name);
    Explanation
    The correct SQL statement to create an index called NAME_IDX on the first name and last name fields of the EMPLOYEES table is "CREATE INDEX NAME_IDX ON employees(first_name, last_name)". This statement specifies the index name, the table name, and the columns to be included in the index.

    Rate this question:

  • 14. 

    Examine the structure of the STUDENTS table: STUDENT_ID STUDENT_NAME VARCHAR2(30) COURSE_ID MARKS NUMBER NOT NULL, Primary Key VARCHAR2(10) NOT NULL NUMBER START_DATE DATE FINISH_DATE DATE You need to create a report of the 10 students who achieved the highest ranking in the course INT SQL and who completed the course in the year 1999. Which SQL statement accomplishes this task?

    • A.

      SELECT student_ id, marks, ROWNUM "Rank" FROM students WHERE ROWNUM

    • B.

      SELECT student_id, marks, ROWID "Rank" FROM students WHERE ROWID

    • C.

      SELECT student_id, marks, ROWNUM "Rank" FROM (SELECT student_id, marks FROM students WHERE ROWNUM

    • D.

      SELECT student_id, marks, ROWNUM "Rank: FROM (SELECT student_id, marks FROM students ORDER BY marks) WHERE ROWNUM

    Correct Answer
    D. SELECT student_id, marks, ROWNUM "Rank: FROM (SELECT student_id, marks FROM students ORDER BY marks) WHERE ROWNUM
    Explanation
    The given SQL statement selects the student_id, marks, and assigns a rank to each student based on their marks. The inner query selects the student_id and marks from the students table and orders them by marks in ascending order. The outer query then selects the student_id, marks, and assigns a row number as "Rank" to each student. The WHERE clause filters the result to only include the top 10 students. This statement will give a report of the 10 students who achieved the highest ranking in the course INT SQL and completed it in the year 1999.

    Rate this question:

  • 15. 

    Explicit conversion is required for conversion and display of date/time data to character form and vice-versa.  

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Explicit conversion is required for converting and displaying date/time data to character form and vice versa. This means that when we want to convert a date/time value to a character form, or vice versa, we need to explicitly specify the conversion method or function to perform the conversion. This is necessary because the data types of date/time and character are different, and therefore a specific conversion process is needed to ensure the correct representation and interpretation of the data.

    Rate this question:

  • 16. 

    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

    Correct Answer(s)
    B. Viewing
    D. Inserting
    Explanation
    The given SQL statement "SELECT * From orders;" is used to retrieve data from a data table. It selects all columns (indicated by *) from the "orders" table. Therefore, the correct answers are "Viewing" and "Inserting" as this statement can be used to view the data in the "orders" table and insert new data into it.

    Rate this question:

  • 17. 

    Group functions on columns include NULL values in calculations if you use the keyword INC_NULLS.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Group functions on columns do not include NULL values in calculations by default. If you want to include NULL values in calculations, you need to use the keyword INC_NULLS. Therefore, the statement "Group functions on columns include NULL values in calculations if you use the keyword INC_NULLS" is false.

    Rate this question:

  • 18. 

    If a sequence starting from a value 100 and incremented by 1 is used by more then one application, then all of these applications could have a value of 105 assigned to theircolumn whose value is being generated by the sequence.  

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement says that if a sequence starting from 100 and incremented by 1 is used by more than one application, then all of these applications could have a value of 105 assigned to their column. However, this statement is false because if the sequence is incremented by 1, the next value after 100 would be 101, not 105. Therefore, it is not possible for all the applications to have a value of 105 assigned to their column.

    Rate this question:

  • 19. 

    In a SELECT statement that includes a WHERE clause, where is the GROUP BY clause placed in the SELECT statement?

    • A.

      Immediately after the SELECT clause

    • B.

      . Before the WHERE clause

    • C.

      Before the FROM clause

    • D.

      After the ORDER BY clause

    • E.

      After the WHERE clause

    Correct Answer
    E. After the WHERE clause
    Explanation
    The GROUP BY clause is placed after the WHERE clause in a SELECT statement. This is because the WHERE clause filters the data based on specified conditions before the grouping is done. Once the data is filtered, the GROUP BY clause is used to group the data based on one or more columns.

    Rate this question:

  • 20. 

    In which four clauses can a subquery be used? (Choose four.)

    • A.

      In the INTO clause of an INSERT statement

    • B.

      In the FROM clause of a SELECT statement

    • C.

      In the GROUP BY clause of a SELECT statement

    • D.

      In the WHERE clause of a SELECT statement

    • E.

      In the SET clause of an UPDATE statement

    • F.

      In the VALUES clause of an INSERT statement

    Correct Answer(s)
    A. In the INTO clause of an INSERT statement
    B. In the FROM clause of a SELECT statement
    D. In the WHERE clause of a SELECT statement
    E. In the SET clause of an UPDATE statement
    Explanation
    A subquery can be used in the INTO clause of an INSERT statement to insert data from the result of the subquery into a table. It can also be used in the FROM clause of a SELECT statement to retrieve data from a subquery as a virtual table. Additionally, a subquery can be used in the WHERE clause of a SELECT statement to filter the result based on the result of the subquery. Lastly, a subquery can be used in the SET clause of an UPDATE statement to set the value of a column based on the result of the subquery.

    Rate this question:

  • 21. 

    In which scenario would 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.

    Correct Answer
    D. The indexed column contains a wide range of values.
    Explanation
    Indexing is most useful when the indexed column contains a wide range of values. This is because indexing allows for faster retrieval of data based on specific values in the indexed column. When the column has a wide range of values, it means that there is a greater likelihood of needing to search for specific values within that range. By indexing the column, the database can quickly locate the desired values, improving the overall performance of queries and data retrieval.

    Rate this question:

  • 22. 

    Once created, a sequence belongs to a specific schema

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A sequence is a database object that generates a sequence of numbers. Once a sequence is created, it is associated with a specific schema, which is a logical container for database objects. This means that the sequence will be stored and accessed within that particular schema. Therefore, the statement "Once created, a sequence belongs to a specific schema" is true.

    Rate this question:

  • 23. 

    QUESTION NO: 41 The ORDERS table has these columns: ORDER_ID CUSTOMER_ID NUMBER(12) ORDER_TOTAL NUMBER(10,2) The ORDERS table tracks the Order number, the order total, and the customer to whom the Order belongs. Which two statements retrieve orders with an inclusive total that ranges between 100.00 and 2000.00 dollars? (Choose two.)

    • A.

      SELECT customer_id, order_id, order_total FROM orders RANGE ON order_total (100 AND 2000) INCLUSIVE;

    • B.

      SELECT customer_id, order_id, order_total NUMBER(4) NOT NULL NOT NULL . FROM orders HAVING order_total BETWEEN 100 and 2000;

    • C.

      SELECT customer_id, order_id, order_total FROM orders WHERE order_total BETWEEN 100 and 2000;

    • D.

      SELECT customer_id, order_id, order_total FROM orders WHERE order_total >= 100 and

    • E.

      SELECT customer_id, order_id, order_total FROM orders WHERE order_total >= 100 and order_total

    Correct Answer(s)
    C. SELECT customer_id, order_id, order_total FROM orders WHERE order_total BETWEEN 100 and 2000;
    E. SELECT customer_id, order_id, order_total FROM orders WHERE order_total >= 100 and order_total
    Explanation
    The correct answers are the third and fifth options. The third option retrieves orders with an inclusive total that ranges between 100.00 and 2000.00 dollars by using the BETWEEN operator. The fifth option also retrieves orders with an inclusive total that ranges between 100.00 and 2000.00 dollars by using the greater than or equal to (>=) operator.

    Rate this question:

  • 24. 

    Refer to the SQL codes below: SELECT manager_id, last_name, hire_date, salary, AVG(salary) OVER (PARTITION BY manager_id ORDER BY hire_date ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS c_mavg FROM employees; What has been achieved? 

    • A.

      Because of a syntax problem, no row will be returned

    • B.

      It calculates, for each employee in the employees table, the average salary of the employees reporting to his/her respective manager

    • C.

      It calculates, for each employee in the employees table, the average salary of the employees reporting to his/her respective manager who were hired just before the employee

    • D.

      It calculates, for each employee in the employees table, the average salary of the employees reporting to the same manager who were hired in the range just before through just after the employee

    • E.

      It calculates, for each employee in the employees table, the average salary of the employees reporting to his/her respective manager who were hired just after the employee

    Correct Answer
    D. It calculates, for each employee in the employees table, the average salary of the employees reporting to the same manager who were hired in the range just before through just after the employee
    Explanation
    The SQL code provided calculates the average salary of the employees reporting to the same manager who were hired in the range just before through just after the employee. This is achieved by using the AVG function with the OVER clause and specifying the PARTITION BY manager_id to group the data by manager, and the ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING to define the range of rows to include in the calculation.

    Rate this question:

  • 25. 

    SCN_TO_TIMESTAMP can be used to find out the latest timing on which a change is made to a particular table.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The SCN_TO_TIMESTAMP function in Oracle can indeed be used to determine the latest timing of a change made to a specific table. SCN stands for System Change Number, which is a unique identifier for each change made in the database. By using the SCN_TO_TIMESTAMP function, the SCN value can be converted into a timestamp, allowing users to see the exact time when a change occurred. Therefore, the statement is true.

    Rate this question:

  • 26. 

    The concatenation operator manipulates character strings and CLOB data.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The concatenation operator in programming languages like C and SQL is used to combine or join character strings and CLOB (Character Large Object) data. It allows you to merge two or more strings together to form a single string. This operator is commonly used for tasks like appending text to existing strings or combining multiple fields into a single field. Therefore, the statement "The concatenation operator manipulates character strings and CLOB data" is true.

    Rate this question:

  • 27. 

    The database administrator of your company created a public synonym called HR for the HUMAN_RESOURCES table of the GENERAL schema, because many users frequently use this table. As a user of the database, you created a table called HR in your schema. What happens when you execute this query? SELECT * FROM HR; 

    • A.

      You obtain the results retrieved from the public synonym HR created by the database administrator.

    • B.

      You obtain the results retrieved from the HR table that belongs to your schema.

    • C.

      You get an error message because you cannot retrieve from a table that has the same name as a public synonym.

    • D.

      You obtain the results retrieved from both the public synonym HR and the HR table that belongs to your schema, as a Cartesian product.

    • E.

      You obtain the results retrieved from both the public synonym HR and the HR table that belongs to your schema, as a FULL JOIN.

    Correct Answer
    B. You obtain the results retrieved from the HR table that belongs to your schema.
    Explanation
    When you execute the query, you obtain the results retrieved from the HR table that belongs to your schema. Since you have created a table with the same name in your schema, it takes precedence over the public synonym created by the database administrator. Therefore, the query will retrieve data from your own table rather than the public synonym.

    Rate this question:

  • 28. 

    The EMPLOYEES table has these columns: LAST_NAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATE Management wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement: ALTER TABLE EMPLOYEES MODIFY (SALARY DEFAULT 5000); Which is true about your ALTER statement?

    • A.

      None

    • B.

      A change to the DEFAULT value affects only subsequent insertions to the table.

    • C.

      Column definitions cannot be altered to add DEFAULT values for columns with a NUMBER data type.

    • D.

      All the rows that have a NULL value for the SALARY column will be updated with the value 5000.

    Correct Answer
    B. A change to the DEFAULT value affects only subsequent insertions to the table.
    Explanation
    A change to the DEFAULT value affects only subsequent insertions to the table. This means that the alteration to the SALARY column will not affect any existing rows in the table. Only new rows that are inserted after the alteration will have the default value of 5000 for the SALARY column.

    Rate this question:

  • 29. 

    The MANAGE TABLESPACE system privilege allows you to perform which of the following operations (Choose all that apply)? 

    • A.

      Take the tablespace offline

    • B.

      Begin a backup

    • C.

      End a backup

    • D.

      Take the tablespace online

    • E.

      Make the tablespace read only

    • F.

      Make the tablespace read write

    Correct Answer(s)
    A. Take the tablespace offline
    B. Begin a backup
    C. End a backup
    D. Take the tablespace online
    E. Make the tablespace read only
    F. Make the tablespace read write
    Explanation
    The MANAGE TABLESPACE system privilege allows you to perform various operations on a tablespace. These operations include taking the tablespace offline, beginning and ending a backup, taking the tablespace online, and making the tablespace read-only or read-write.

    Rate this question:

  • 30. 

    TO_DATE is a character manipulation function

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given statement is false. TO_DATE is not a character manipulation function. It is a function used in SQL to convert a string into a date format. It takes a character string and a format mask as input and returns a date value.

    Rate this question:

  • 31. 

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

    • A.

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

    • 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

    Correct Answer
    B. You need SELECT privileges on the view.
    Explanation
    To execute a query on an existing view successfully, it is necessary to have SELECT privileges on the view. This means that the user executing the query must have the permission to retrieve data from the view. The underlying tables do not necessarily need to be in the same schema, and SELECT privileges on the underlying tables are not required, as the view acts as a virtual table that presents the data from the underlying tables.

    Rate this question:

  • 32. 

    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.

    Correct Answer
    A. Substitution variables
    Explanation
    Substitution variables in SQL*Plus can be used to replace values in the WHERE clause. These variables allow users to enter values at runtime, which can then be used in the query to dynamically filter the results. By using substitution variables, users can make their queries more flexible and adaptable to different scenarios without having to modify the query itself.

    Rate this question:

  • 33. 

    Which four are attributes of single row functions? (Choose four.)

    • A.

      Cannot be nested

    • B.

      . manipulate data items

    • C.

      Act on each row returned

    • D.

      Return one result per row

    • E.

      Accept only one argument and return only one value

    • F.

      Accept arguments which can be a column or an expression

    Correct Answer(s)
    B. . manipulate data items
    C. Act on each row returned
    D. Return one result per row
    F. Accept arguments which can be a column or an expression
    Explanation
    The four attributes of single row functions are:
    1. Manipulate data items: Single row functions can perform operations on individual data items within a row.
    2. Act on each row returned: Single row functions are applied to each row returned by a query or a table.
    3. Return one result per row: Single row functions produce a single result for each row processed.
    4. Accept arguments which can be a column or an expression: Single row functions can accept either a column or an expression as an argument.

    Rate this question:

  • 34. 

    Which four are correct guidelines for naming database tables? (Choose four)

    • A.

      Must begin with either a number or a letter.

    • B.

      Must be 1-30 characters long.

    • C.

      Should not be an Oracle Server reserved word.

    • D.

      Must contain only A-Z, a-z, 0-+, _, *, and #.

    • E.

      Must contain only A-Z, a-z, 0-9, _, $, and #.

    • F.

      Must begin with a letter.

    Correct Answer(s)
    B. Must be 1-30 characters long.
    C. Should not be an Oracle Server reserved word.
    E. Must contain only A-Z, a-z, 0-9, _, $, and #.
    F. Must begin with a letter.
    Explanation
    The guidelines for naming database tables include:
    1) The table name must be 1-30 characters long.
    2) It should not be an Oracle Server reserved word.
    3) The table name must contain only A-Z, a-z, 0-9, _, $, and #.
    4) The table name must begin with a letter.

    Rate this question:

  • 35. 

    Which four are valid Oracle constraint types? (Choose four.)

    • A.

      CASCADE

    • B.

      UNIQUE

    • C.

      CHECK

    • D.

      NON UNIQUE

    • E.

      PRIMARY KEY

    • F.

      CONSTANT

    • G.

      NOT NULL

    Correct Answer(s)
    B. UNIQUE
    D. NON UNIQUE
    E. PRIMARY KEY
    F. CONSTANT
    Explanation
    The four valid Oracle constraint types are UNIQUE, NON UNIQUE, PRIMARY KEY, and CONSTANT. UNIQUE constraint ensures that each value in a column is unique and does not allow duplicate values. NON UNIQUE constraint allows duplicate values in a column. PRIMARY KEY constraint uniquely identifies each record in a table and does not allow duplicate or null values. CONSTANT constraint ensures that the value of a column remains constant and cannot be modified.

    Rate this question:

  • 36. 

    Which is an /SQL*Plus command?

    • A.

      INSERT

    • B.

      UPDATE

    • C.

      SELECT

    • D.

      DESCRIBE

    • E.

      DELETE

    • F.

      RENAME

    Correct Answer
    D. DESCRIBE
    Explanation
    The correct answer is DESCRIBE. DESCRIBE is an SQL*Plus command that is used to retrieve information about a table, such as its structure, column names, and data types. It provides a description of the specified table, allowing users to understand the table's schema without having to query the database. This command is often used for debugging or when trying to understand the structure of a table before performing any operations on it.

    Rate this question:

  • 37. 

    Which of the following are the conditions that must b met before you can use RENAME DATAFILE with the alter tablepace command (Choose all that apply)? 

    • A.

      . the database must be taken offline before renaming

    • B.

      The database must be open

    • C.

      When only a single datafile is to be renamed

    • D.

      When only a single datafile on the same drive is to be renamed

    Correct Answer(s)
    A. . the database must be taken offline before renaming
    B. The database must be open
    Explanation
    Before using the RENAME DATAFILE command with the alter tablespace command, the database must be taken offline. Additionally, the database must be open in order to perform the rename operation. These conditions must be met in order to successfully rename a datafile.

    Rate this question:

  • 38. 

    Which operator can be used with a multiple -row subquery?

    • A.

      =

    • B.

      LIKE

    • C.

      BETWEEN

    • D.

      NOT IN

    • E.

      IS

    • F.

    Correct Answer
    D. NOT IN
    Explanation
    The operator "NOT IN" can be used with a multiple-row subquery. This operator is used to exclude rows from the result set that are found in the subquery. It checks if the value on the left side of the operator is not present in the result set of the subquery. So, in this case, the "NOT IN" operator can be used to compare a value with multiple rows returned by a subquery and exclude any matching rows from the result.

    Rate this question:

  • 39. 

    Which SQL statement generates the alias Annual Salary for the calculated column SALARY*12?

    • A.

      SELECT ename, salary*12 ‘Annual Salary’ FROM employees;

    • B.

      SELECT ename, salary*12 “Annual Salary” FROM employees;

    • C.

      SELECT ename, salary*12 AS Annual Salary FROM employees;

    • D.

      SELECT ename, salary*12 AS INITCAP(“ANNUAL SALARY”) FROM employees

    Correct Answer
    B. SELECT ename, salary*12 “Annual Salary” FROM employees;
    Explanation
    The correct answer is "SELECT ename, salary*12 'Annual Salary' FROM employees;". This statement uses single quotes to define the alias "Annual Salary" for the calculated column SALARY*12.

    Rate this question:

  • 40. 

    Which statement creates a new user?

    • A.

      CREATE USER susan;

    • B.

      CREATE OR REPLACE USER susan;

    • C.

      CREATE NEW USER susan DEFAULT;

    • D.

      CREATE USER susan IDENTIFIED BY blue;

    • E.

      CREATE NEW USER susan IDENTIFIED by blue;

    • F.

      CREATE OR REPLACE USER susan IDENTIFIED BY blue;

    Correct Answer
    D. CREATE USER susan IDENTIFIED BY blue;
    Explanation
    The statement "CREATE USER susan IDENTIFIED BY blue;" creates a new user named "susan" with the password "blue".

    Rate this question:

  • 41. 

    Which statement describes the ROWID data type?

    • A.

      Binary data up to 4 gigabytes.

    • B.

      Character data up to 4 gigabytes.

    • C.

      Raw binary data of variable length up to 2 gigabytes.

    • D.

      Binary data stored in an external file, up to 4 gigabytes.

    • E.

      A hexadecimal string representing the unique address of a row in its table.

    Correct Answer
    E. A hexadecimal string representing the unique address of a row in its table.
    Explanation
    The ROWID data type is a hexadecimal string that represents the unique address of a row in its table. It is used to identify a specific row in a table and is particularly useful for fast retrieval of data.

    Rate this question:

  • 42. 

    Which substitution variable would you use if you want to reuse the variable without prompting the user each time?

    • A.

      &

    • B.

      ACCEPT

    • C.

      PROMPT

    • D.

      &&

    Correct Answer
    D. &&
    Explanation
    The correct answer is &&. The double ampersand (&&) is used as a substitution variable in SQL*Plus and Oracle SQL. It allows the user to reuse the variable without being prompted for its value each time. This is useful when running a script multiple times and wanting to use the same value for a variable without having to enter it repeatedly.

    Rate this question:

  • 43. 

    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.

    Correct Answer(s)
    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
    Explanation
    Constraints enforce rules at the view level by specifying conditions that must be met for the view to be updated or modified. Constraints also enforce rules at the table level by defining conditions that must be met for data to be inserted, updated, or deleted in a table. Additionally, constraints prevent the deletion of a table if there are dependencies, meaning that if other tables or views rely on the data in the table, it cannot be deleted.

    Rate this question:

  • 44. 

    Which two are attributes of /SQL*Plus? (Choose two)

    • A.

      /SQL*Plus commands cannot be abbreviated.

    • B.

      /SQL*Plus commands are accesses from a browser

    • C.

      /SQL*Plus commands are used to manipulate data in tables.

    • D.

      /SQL*Plus commands manipulate table definitions in the database.

    • E.

      /SQL*Plus is the Oracle proprietary interface for executing SQL statements

    Correct Answer(s)
    C. /SQL*Plus commands are used to manipulate data in tables.
    D. /SQL*Plus commands manipulate table definitions in the database.
  • 45. 

    Which two statements are true regarding the ORDER BY clause? (Choose two)

    • A.

      The sort is in ascending by order by default.

    • B.

      The sort is in descending order by default.

    • C.

      The ORDER BY clause must precede the WHERE clause

    • D.

      The ORDER BY clause is executed on the client side.

    • E.

      The ORDER BY clause comes last in the SELECT statement.

    • F.

      The ORDER BY clause is executed first in the query execution

    Correct Answer(s)
    A. The sort is in ascending by order by default.
    E. The ORDER BY clause comes last in the SELECT statement.
    Explanation
    The first true statement is that the sort is in ascending order by default when using the ORDER BY clause. This means that if the order is not specified as ascending or descending, the default behavior is to sort the results in ascending order.

    The second true statement is that the ORDER BY clause comes last in the SELECT statement. This means that after specifying the columns to select and any other clauses like WHERE or GROUP BY, the ORDER BY clause is used to specify the sorting order of the results.

    Rate this question:

  • 46. 

    With 9i SQL Plus, what kind of commands can you enter at the command prompt (Choose all that apply)? 

    • A.

      PL/SQL blocks

    • B.

      SQL*Plus commands

    • C.

      Security commands

    • D.

      SQL commands

    Correct Answer(s)
    A. PL/SQL blocks
    B. SQL*Plus commands
    D. SQL commands
    Explanation
    With 9i SQL Plus, you can enter PL/SQL blocks, SQL*Plus commands, and SQL commands at the command prompt. PL/SQL blocks are used for writing procedural code in Oracle databases. SQL*Plus commands are specific commands used within the SQL*Plus environment. SQL commands are used for querying and manipulating data in the database. Security commands are not mentioned as an option, so they cannot be entered at the command prompt.

    Rate this question:

  • 47. 

    You added a PHONE_NUMBER column of NUMBER data type to an existing EMPLOYEES table. The EMPLOYEES table already contains records of 100 employees. Now, you want to enter the phone numbers of each of the 100 employees into the table. Some of the employees may not have a phone number available. Which data manipulation operation do you perform?

    • A.

      MERGE

    • B.

      INSERT

    • C.

      UPDATE

    • D.

      ADD

    • E.

      ENTER

    • F.

      You cannot enter the phone numbers for the existing employee records.

    Correct Answer
    C. UPDATE
    Explanation
    The correct answer is UPDATE. The question states that a new column of NUMBER data type has been added to the EMPLOYEES table to store phone numbers. To enter the phone numbers for each employee, an UPDATE operation is needed to update the existing records in the table with the corresponding phone numbers. INSERT would be used to add new records, not update existing ones. ADD and ENTER are not valid data manipulation operations. The statement "You cannot enter the phone numbers for the existing employee records" is incorrect, as the UPDATE operation allows for modifying existing records.

    Rate this question:

  • 48. 

    You need to perform certain data manipulation operations through a view called EMP_DEPT_VU, which you previously created. You want to look at the definition of the view (the SELECT statement on which the view was create.) How do you obtain the definition of the view?

    • A.

      Use the DESCRIBE command in the EMP_DEPT VU view.

    • B.

      Use the DEFINE VIEW command on the EMP_DEPT VU view.

    • C.

      Use the DESCRIBE VIEW command on the EMP_DEPT VU view.

    • D.

      Query the USER_VIEWS data dictionary view to search for the EMP_DEPT_VU view.

    • E.

      Query the USER_SOURCE data dictionary view to search for the EMP_DEPT_VU view

    • F.

      Query the USER_OBJECTS data dictionary view to search for the EMP_DEPT_VU view.

    Correct Answer
    D. Query the USER_VIEWS data dictionary view to search for the EMP_DEPT_VU view.
    Explanation
    To obtain the definition of the view EMP_DEPT_VU, you can query the USER_VIEWS data dictionary view. This view contains information about all the views owned by the current user, including the text of the SELECT statement used to create the view. By querying this view, you can retrieve the definition of the EMP_DEPT_VU view and examine the SELECT statement used to create it.

    Rate this question:

  • 49. 

    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;

    Correct Answer
    C. SELECT TO_CHAR(SYSDATE, 'FMDay, DD Month, YYYY') FROM dual;
    Explanation
    The correct answer is SELECT TO_CHAR(SYSDATE, 'FMDay, DD Month, YYYY') FROM dual; This SELECT statement uses the TO_CHAR function to convert the system date (SYSDATE) into a character string in the specified format 'FMDay, DD Month, YYYY'. The 'FM' format modifier is used to remove leading spaces and zeros.

    Rate this question:

  • 50. 

    BULK COLLECT and the FORALL statements allows to bulk together all of the context switches into a single switch and pass that to the SQL engine. 

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The statement is true because BULK COLLECT and FORALL statements in SQL allow for the processing of multiple rows of data at once, reducing the number of context switches between the SQL engine and the PL/SQL engine. This improves performance by minimizing the overhead associated with individual context switches for each row. By bulk collecting and processing data in batches, the number of context switches is reduced to a single switch, resulting in improved efficiency.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 27, 2011
    Quiz Created by
    RubiyaSameen
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.