Multiple Choice Quiz Questions Of Oracle

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Sajeesh88
S
Sajeesh88
Community Contributor
Quizzes Created: 1 | Total Attempts: 580
| Attempts: 580 | Questions: 30
Please wait...
Question 1 / 30
0 %
0/100
Score 0/100
1. Which type of file is part of the Oracle database?

Explanation

The control file is a type of file that is part of the Oracle database. It is a binary file that stores important metadata about the database, such as the database name, datafile locations, and log file information. The control file is crucial for the proper functioning of the database as it is used during database startup and recovery operations. It helps in maintaining the consistency and integrity of the database by keeping track of changes made to the database. Therefore, the control file is an essential component of the Oracle database.

Submit
Please wait...
About This Quiz
Multiple Choice Quiz Questions Of Oracle - Quiz

This quiz focuses on Oracle database management, specifically index rebuilding, SQL operations, database files, and user privileges. It assesses key skills in managing large data sets and optimizing... see moredatabase queries, essential for IT professionals. see less

2. Which privilege is required to create a database?

Explanation

To create a database, the privilege required is SYSDBA. SYSDBA is a powerful privilege that allows a user to perform administrative tasks, including creating and managing databases, as well as performing backup and recovery operations. This privilege is typically granted to database administrators who need full control over the database system. SYSDBA users have the highest level of access and authority within the database, making them responsible for managing critical operations and ensuring the overall stability and security of the database environment.

Submit
3. User A issues this command: UPDATE emp SET id=200 WHERE id=1 Then user B issues this command: UPDATE emp SET id=300 WHERE id=1 User B informs you that the UPDATE statement seems to be hung. How can you resolve the problem so user B can continue working?

Explanation

If user B is experiencing a hung UPDATE statement, it means that user A's transaction is still in progress and has not been committed. By asking user A to commit the transaction, it will release the lock on the emp table and allow user B to continue working without any issues.

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

Explanation

The GROUP BY clause is placed after the WHERE clause in a SELECT statement. This allows for the grouping of rows based on a specified column or columns. The WHERE clause is used to filter the rows based on certain conditions before the grouping is applied. Placing the GROUP BY clause after the WHERE clause ensures that the filtering is done before the grouping is performed.

Submit
5.  The STUDENT_GRADES table has these columns: STUDENT_ID NUMBER(12) SEMESTER_END DATE GPA NUMBER(4,3) Which statement finds students who have a grade point average (GPA) greater than 3.0 for the calendar year 2001? 

Explanation

The correct answer is "SELECT student_id, gpa FROM student_grades WHERE semester_end BETWEEN '01-JAN-2001' AND '31-DEC-2001' AND gpa > 3.0;". This statement selects the student_id and gpa columns from the student_grades table. It uses the BETWEEN operator to filter the records where the semester_end date falls between '01-JAN-2001' and '31-DEC-2001'. Additionally, it includes a condition to filter only those records where the gpa is greater than 3.0.

Submit
6. Scott issues the SQL statements: to be done CREATE TABLE dept (deptno number(2) dname VARCHAR2(14) loc VARCHAR2(13)); GRANT SELECT ON DEPT TO SUE; If Sue needs to select from Scott's DEPT table, which command should she use?

Explanation

Sue should use the command "SELECT * FROM SCOTT.DEPT" to select from Scott's DEPT table. This command specifies the schema (SCOTT) and table name (DEPT) that Sue wants to select from.

Submit
7. Which is an /SQL * Plus command?

Explanation

The correct answer is DESCRIBE because it is a valid SQL*Plus command used to display the structure of a table, including the column names, datatypes, and constraints. It provides information about the table's structure and allows users to understand the layout of the table without querying the data itself.

Submit
8. Your developers asked you to create an index on the PROD_ID column of the SALES_HISTORY table, which has 100 million rows. The table has approximately 2 million rows of new data loaded on the first day of every month. For the remainder of the month, the table is only queried. Most reports are generated according to the PROD_ID, which has 96 distinct values. Which type of index would be appropriate?

Explanation

A bitmap index would be appropriate in this scenario. This is because the PROD_ID column has a relatively low cardinality (96 distinct values), and the table is mostly queried rather than being updated frequently. Bitmap indexes are efficient for columns with low cardinality and are especially useful for read-intensive operations. They use a bitmap for each distinct value in the column, making them suitable for queries that involve multiple values or combinations of values.

Submit
9. .Evaluate the SQL statement: SELECT ROUND(TRUNC(MOD(1600,10),-1),2) FROM dual; What will be displayed?

Explanation

The SQL statement is evaluating the expression ROUND(TRUNC(MOD(1600,10),-1),2).
First, the MOD(1600,10) calculates the remainder of 1600 divided by 10, which is 0.
Then, the TRUNC(0,-1) function truncates the value 0 to the nearest 10th, which is still 0.
Finally, the ROUND(0,2) function rounds the value 0 to 2 decimal places, resulting in 0.00.
Since the question asks for what will be displayed, the correct answer is 0.

Submit
10.  Which / SQL* Plus feature can be used to replace values in the where clause?

Explanation

Substitution variables in SQL* Plus can be used to replace values in the where clause. They allow users to dynamically input values at runtime, making queries more flexible and interactive. By using the ampersand (&) symbol followed by a variable name, users can prompt for input and substitute the entered value into the query. This feature is particularly useful when the values in the where clause need to be changed frequently or when the user wants to filter the results based on specific criteria.

Submit
11. A subquery can be used to _________.

Explanation

A subquery can be used to retrieve data based on an unknown condition. This means that the subquery can be used to fetch data from a table based on a condition that is not known or specified beforehand. The subquery can be used to dynamically retrieve data based on the result of another query or based on certain calculations or comparisons within the subquery itself. This allows for more flexible and dynamic data retrieval, as the condition can be determined at runtime.

Submit
12. Examine the structure of the EMPLOYEES table: column name   data type  remarks EMPLOYEE_ID        NUMBER  NOT NULL, primary key LAST_NAME            VARCHAR2(30)  FIRST_NAME           VARCHAR2(30)   JOB_ID                     NUMBER SAL                           NUMBER MGR_ID                    NUMBER  References EMPLOYEE_ID column 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?

Explanation

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

Submit
13. Which SELECT statement should you use to extract the year form the system date and display it in the format "1998"?

Explanation

The correct answer is SELECT TO_CHAR(SYSDATE, ‘yyyy’) FROM dual. This statement uses the TO_CHAR function to convert the system date (SYSDATE) into the specified format (‘yyyy’), which represents the year. The result will be displayed as "1998" or any other current year. The FROM dual clause is used to ensure that the query is executed properly.

Submit
14.  Which clause should you use to exclude group results?

Explanation

The HAVING clause should be used to exclude group results. Unlike the WHERE clause, which filters rows before grouping, the HAVING clause filters groups after they have been formed. It allows you to specify conditions that must be met by the groups, allowing you to exclude certain groups based on those conditions. This is useful when you want to filter the results based on aggregate functions such as COUNT, SUM, or AVG. The HAVING clause is typically used in conjunction with the GROUP BY clause to perform group-level filtering.

Submit
15. Which two statements are true about rebuilding an index? (Choose two.)

Explanation

During the rebuilding of an index, a new index is created using an existing index as the data source. This means that the existing index is used as a reference to build the new index. Additionally, during the rebuild process, enough space is required to accommodate both the old and the new index in their respective tablespaces. This is because the old index needs to be kept until the new index is fully built and ready to replace it.

Submit
16. You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column.  The table is currently empty.  Which statement accomplishes this task?

Explanation

The correct answer is "ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);". This statement adds a constraint named "stud_id_pk" to the "students" table, specifying that the "student_id" column should be the primary key. This ensures that each value in the "student_id" column is unique and not null, effectively creating a primary key on that column.

Submit
17. Which data dictionary view would you use to get a list of object privileges for all database users?

Explanation

DBA_TAB_PRIVS is the correct answer because it is a data dictionary view that provides information about object privileges for all database users. This view contains columns such as GRANTEE (the user who has been granted the privilege), OWNER (the owner of the object), TABLE_NAME (the name of the object), and PRIVILEGE (the type of privilege granted). By querying this view, you can obtain a comprehensive list of object privileges for all users in the database.

Submit
18. . 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 s2; Delete from new_emp; Rolback to s2; Delete from new_emp where employee_id = 180; UPDATE new_emp set name = 'James'; Rolback to s2; UPDATE new_emp set name = 'James' WHERE employee_id = 180; Rollback; At the end of this transaction, what is true?

Explanation

At the end of this transaction, the table "new_emp" will have no rows. This is because the transaction starts with creating the table "new_emp" and inserting data from the "employees" table into it. However, after saving a savepoint (s2) and deleting all rows from "new_emp", the rollback to s2 restores the table to its state before the delete statement, which means the rows are still deleted. The subsequent update statement does not affect any rows because the employee with ID 180 was already deleted. Therefore, the table will have no rows in the end.

Submit
19. You would like to display the system date in the format *Monday, 01 June, 2001* Which SELECT statement  should you use?

Explanation

The correct answer is SELECT TO_CHAR(SYSDATE, ‘FMDay, DD Month YYYY’) because the TO_CHAR function is used to convert the system date to a character string in the specified format. The 'FMDay' format specifier will display the full name of the day, 'DD' will display the day of the month, 'Month' will display the full name of the month, and 'YYYY' will display the year in four digits. This will result in the desired format of "Monday, 01 June, 2001".

Submit
20. Which two are character manipulation functions? (Choose two)

Explanation

TRIM and REPLACE are character manipulation functions. TRIM is used to remove leading and trailing spaces from a string, while REPLACE is used to replace a specific substring within a string with another substring. These functions are commonly used in database queries or programming languages to manipulate and modify character data. TRUNC, TO_DATE, and MOD are not character manipulation functions; TRUNC is used for truncating a date or number, TO_DATE is used for converting a string to a date, and MOD is used for finding the remainder of a division operation.

Submit
21. Which two statements about views are true? (Choose two)

Explanation

Views can be created as read-only, meaning that they can be used to retrieve data but not to modify it. Views can also be created as a join on two or more tables, allowing users to retrieve data from multiple tables as if it were a single table. However, views can have an ORDER BY clause in the SELECT statement, so the statement that says a view cannot have an ORDER BY clause is incorrect. Similarly, views can be created with a GROUP BY clause in the SELECT statement, so the statement that says a view cannot be created with a GROUP BY clause is also incorrect. Lastly, views do not necessarily require aliases for the column names in the SELECT statement, so the statement that says a view must have aliases defined for the column names is incorrect.

Submit
22. The CUSTOMERS table has these columns: CUSTOMER_ID  NUMBER(4) NOT NULL CUSTOMER_NAME  VARCHAR2(100) NOT NULL STREET_ADDRESS  VARCHAR2(150) CITY_ADDRESS  VARCHAR2(50)  STATE_ADDRESS  VARCHAR2(50) PROVINCE_ADDRESSVARCHAR2(50) COUNTRY_ADDRESS  VARCHAR2(50) POSTE_CODE  VARCHAR2(12)  CUSTOMER_PHONE  VARCHAR2(20) THE CUSTOMER_ID column is the primary key for the table  which two statements find the number of customer? (Choose two.)

Explanation

The first statement, "SELECT COUNT (*) FROM customers;", finds the number of customers by counting the total number of rows in the customers table.

The fourth statement, "SELECT COUNT(costomer_id) FROM customer;", also finds the number of customers by counting the total number of non-null values in the customer_id column of the customer table.

Submit
23. Examine this TRUNCATE TABLE command: TRUNCATE TABLE departments; Which four are true about the command? (Choose four.)

Explanation

The TRUNCATE TABLE command in this scenario has the following implications:
1. All rows of the table are deleted: This means that all data within the "departments" table will be removed.
2. Any associated indexes are truncated: Any indexes associated with the "departments" table will also be truncated, essentially removing them.
3. No undo data is generated for the table's rows: Unlike other deletion methods, such as DELETE, the TRUNCATE TABLE command does not generate any undo data for the deleted rows. This means that the action cannot be rolled back or undone.
4. It reduces the number of extents allocated to the DEPARTMENTS table to the original setting for MINEXTENTS: This implies that the TRUNCATE TABLE command will reduce the number of extents allocated to the "departments" table to its original setting, which is determined by the MINEXTENTS parameter.

Submit
24. Examine the structure of the EMPLOYEES table:         EMPLOYEE_ID NUMBER NOT NULL EMP_ID         VARCHAR2(30) JOB_ID          VARCHAR2(20) DEFAULT 'SA_REP' SAL                 NUMBER COMM_PCT  NUMBER MGR_ID         NUMBER DEPARTMENT_ID NUMBER you need to update the records of emloyees 103 and 115. The UPDATE statement you specify should update the rows with the values specified below: JOB_ID Default value specified for this column definition SAL maximum salary earned for the_job ID SA_REP COMM_PCT Default value is specified for the column, the value should be NULL DEPARTMENT_ID: Supplied by the user during run time through substitution variable which UPDATE statement meets the requirements?

Explanation

The correct answer is the fourth option: UPDATE emplouees SET job_id = DEFAULT sal = MAX (sal) comm_pct = DEFAULT department_id = &did WHERE employee_id IN (103,115) AND job_id = 'SA_REP'. This statement updates the job_id to the default value, the sal to the maximum salary earned for the job_id 'SA_REP', the comm_pct to the default value, and the department_id to the value provided by the user through the substitution variable &did. It also specifies that the update should only be applied to the employee_id 103 and 115.

Submit
25. Consider this SQL statement: UPDATE employees SET first_name = 'John' WHERE emp_id = 1009; COMMIT; What happens when a user issues the COMMIT in the above SQL statement?

Explanation

When the user issues the COMMIT statement, the user process notifies the server process that the resource locks can be released. This means that any locks held by the user process on the affected data are released, allowing other processes to access and modify the data. This ensures data consistency and concurrency in a multi-user environment.

Submit
26. Which two are true about aggregate functions? (Choose two)

Explanation

Aggregate functions can be used only in the column list of the SELECT clause and in the WHERE clause of a SELECT statement. This means that aggregate functions cannot be used in any other clause of a SELECT statement such as GROUP BY, HAVING, or ORDER BY. Additionally, aggregate functions allow for the passing of various parameters such as column names, expressions, constants, or functions. This allows for more flexibility in performing calculations on the data.

Submit
27. . The EMPLOYEES table contains these columns: LAST_NAME                  VARCHAR2(25) SALARY                           NUMBER(6,2) COMMISSION_PCT      NUMBER(6) You need to write a query that will produce these results: 1. Display the salary multiplied by the commission_pct 2. Exclude employees with a zero commission_pct 3. Display a zero for employees with a null commission value Evaluate the SQL statement: SELECT LAST_NAME, SALARY * COMMISSION_PCT FROM EMPLOYEES WHERE COMMISSION_PCT IS NOT NULL; What does the statement provide?

Explanation

The given SQL statement provides one of the desired results, which is to display the salary multiplied by the commission_pct. It achieves this by selecting the LAST_NAME and multiplying the SALARY by COMMISSION_PCT from the EMPLOYEES table, and only including rows where the COMMISSION_PCT is not null. However, it does not address the other two desired results, which are to exclude employees with a zero commission_pct and to display a zero for employees with a null commission value.

Submit
28. Which three are DATETIME data types that can be used when specifying column definitions? (Choose three)

Explanation

The three DATETIME data types that can be used when specifying column definitions are TIMESTAMP, INTERVAL DAY TO SECOND, and INTERVAL YEAR TO MONTH. These data types are commonly used in databases to store date and time information. TIMESTAMP stores both date and time values, INTERVAL DAY TO SECOND stores a duration in days, hours, minutes, and seconds, and INTERVAL YEAR TO MONTH stores a duration in years and months. These data types provide flexibility in storing and manipulating date and time data in a database.

Submit
29. Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME                 VARCHAR2(25) LAST_NAME                  VARCHAR2(25) DEPARTMENT_ID         NUMBER SALARY                          NUMBER

Explanation

The given answer is a valid SQL query that retrieves the last name, salary, department ID, and the maximum salary for each department from the EMPLOYEES table. It achieves this by using a subquery to calculate the maximum salary for each department and then joining it with the EMPLOYEES table using the department ID. The result is a list of employees with their respective last name, salary, department ID, and the maximum salary for each department.

Submit
30. which three statements correctly describe the functions and use of constraints? (Choose three)

Explanation

Constraints provide data independence by ensuring that the data remains consistent and accurate regardless of changes made to the database structure. Constraints enforce rules at both the view level and the table level to maintain data integrity and prevent invalid or inconsistent data from being entered. These rules can include enforcing unique values, referential integrity, and data type constraints. Constraints also prevent the deletion of a table or an index if there are dependencies, ensuring that data dependencies are maintained and preventing data loss or corruption.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

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

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jun 07, 2011
    Quiz Created by
    Sajeesh88
Cancel
  • All
    All (30)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which type of file is part of the Oracle database?
Which privilege is required to create a database?
User A issues this command:...
 In a SELECT statement that includes a WHERE clause, where is the...
 The STUDENT_GRADES table has these columns: STUDENT_ID...
Scott issues the SQL statements: to be done ...
Which is an /SQL * Plus command?
Your developers asked you to create an index on the PROD_ID column of...
.Evaluate the SQL statement:...
 Which / SQL* Plus feature can be used to replace values in the...
A subquery can be used to _________.
Examine the structure of the EMPLOYEES table:...
Which SELECT statement should you use to extract the year form the...
 Which clause should you use to exclude group results?
Which two statements are true about rebuilding an index? (Choose two.)
You need to modify the STUDENTS table to add a primary key on the...
Which data dictionary view would you use to get a list of object...
. Examine the structure of the EMPLOYEES table:...
You would like to display the system date in the format *Monday, 01...
Which two are character manipulation functions? (Choose two)
Which two statements about views are true? (Choose two)
The CUSTOMERS table has these columns: ...
Examine this TRUNCATE TABLE command:...
Examine the structure of the EMPLOYEES table:...
Consider this SQL statement:...
Which two are true about aggregate functions? (Choose two)
. The EMPLOYEES table contains these columns:...
Which three are DATETIME data types that can be used when specifying...
Examine the structure of the EMPLOYEES table: ...
Which three statements correctly describe the functions and use of...
Alert!

Advertisement