Manipulating Data Questions
Manipulating Data Questions
Answer: C. All Oracle transactions comply with the basic properties of a database transaction,
known as ACID properties. Atomicity states that all tasks of a transaction are performed or none of
them are. There are no partial transactions. Consistency implies the transaction takes the
database from one consistent state to another consistent state. Isolation means the effect of a
transaction is not visible to other transactions until the transaction is committed. Durability means
that changes made by committed transactions are permanent. After a transaction completes, the
database ensures through its recovery mechanisms that changes from the transaction are not lost.
A. SELECT
B. GROUP BY
C. INTERSECT
D. INSERT
Answer: A, D. On strict grounds, SELECT is a DML command as it is one of the mandatory clauses
for manipulation of data present in tables.
A. INTERSECT
B. INSERT
C. SELECT
D. MERGE
Answer: D. MERGE can perform INSERT and UPDATE actions in a single statement in Oracle.
A. INSERT
B. DELETE
C. GROUP BY
D. None of the above
Answer: A, B. In some conditions MERGE can perform the DELETE operation too, along with
INSERT and UPDATE.
A. DELETE
B. INSERT
C. TRUNCATE
D. None of the above
Answer: C. TRUNCATE is a DDL command. It removes the records from the table without any
condition. It is not the part of any ongoing transaction and an uncommitted transaction in the
session is committed after TRUNCATE is executed.
A. MINUS
B. UPDATE
C. TRUNCATE
D. All of the above
8. Which of the following commands is used to populate table rows with data?
A. DELETE
B. INSERT
C. SELECT
D. UPDATE
9. What is true about the INSERT statement? (Choose the most appropriate answer)
Answer: C. The INSERT statement is capable of inserting a row or set of rows in a single table at a
time.
Answer: C. Constraints are business rules imposed on the columns so as to ensure the behavior
of the data coming in the column. These constraints are validated for the data during the INSERT
process.
11. What is true about the INSERT statement in Oracle SQL? (Choose the most
appropriate answer)
Answer: D. Oracle raises exception if any of the data contained in the insert statement violates
the constraint.
Consider the following data set from the EMPLOYEES table along with its structure and
answer the questions 12, 13 and 14:
12. Examine the structure of the EMPLOYEES table. You issue the following command:
Assuming that there is a duplicate value check constraint on the EMPLOYEE_ID column, what will
be the outcome of the above statement?
Answer: C. As the row with values "5100, BRUCE, CLERK" already exists in the table, the insert
statement with same data set is not possible.
13.You issue the following command to the data set shown above:
14. You issue the following command to the data set shown above:
Answer: D. As there is no NOT NULL constraint on the columns FIRST_NAME and JOB_ID , the NULL
value will get inserted.
15. What among the following can be said regarding inserting of rows in tables?
Answer: B. An INSERT statement can make use of substitution variable to prompt the user to key
in values during the runtime. It provides an interactive way of inserting data into tables
A. SELECT
B. INSERT
C. Sub-queries
D. All of the above
Answer: D. INSERT statement can make use of explicit INSERT, INSERT-SELECT or a sub-query
method to insert data into tables.
17. Which among the following is a common technique for inserting rows into a table?
(Choose the most sensible and appropriate answer)
Answer: A. Using the SELECT clause is the most common technique for inserting rows into tables.
It reduces the effort of manually keying in values for each column.
18.Which of the following commands is used to change the rows that already exist in a
table?
A. INSERT
B. UNION
C. UPDATE
D. SELECT
Answer: C. UPDATE is a DML statement which is used to modify the column values in a table.
Answer: C. An UPDATE can update multiple rows in one or more rows at a time based on the
WHERE clause conditions.
20.Which of the following clauses decides how many rows are to be updated?
A. SELECT
B. WHERE
C. FROM
D. All of the above
Answer: B. UPDATE statement makes use of WHERE clause to capture the set of rows which
needs to be updated.
21.What among the following is true about the UPDATE statement? (Choose the most
appropriate answer)
Answer: A, C. An UPDATE statement affects rows of only one table and not multiple tables.
Consider the following data set from the EMPLOYEES table and its structure. Answer
questions 22 to 24 that follow.
22. You need to change the JOB_ID for Bruce (Employee Id 7389) to 'ACCOUNTANT'.
Which of the following statements will you fire?
A. UPDATE employees
SET job_id = 'ACCOUNTANT'
WHERE employee_id = 7389;
C. UPDATE employees
SET job_id = 'ACCOUNTANT'
WHERE job_id = 'CLERK';
D. UPDATE employees
SET job_id = 'ACCOUNTANT';
Answer: A. Option B fails because it modifies the job code of all clerks to ACCOUNTANT. Option C
is wrong because it update job code to ACCOUNTANT for all the employees in the table.
You issue the following query to the EMPLOYEES table with the data set as shown above.
UPDATE employees
Set job_id = NULL
Where employee_id = 51000;
The data set will be as shown below: (Assume that there is a duplicate value constraint on the
EMPLOYEE_ID column)
23. Suppose you fire an UPDATE statement to update Bruce's JOB_ID to 'SALESMAN'
(with respect to the data set shown above). What will be the outcome of the query?
Answer: B. The UPDATE will add the new value to the NULL value changing the NULL to the new
value
24. You issue an UPDATE statement to update the employee id 7389 to 7900. You query
the employee by its id '7389' before committing the transaction. What will be the
outcome?
Answer: B. A query in a session is consistent with the ongoing transactions. If the same query
would have been executed in a different session, it would have shown the employee record with id
7389 because the active transaction in the first session is not yet committed.
25. What among the following is a typical use of an UPDATE statement? (Select the
most appropriate answer)
A. To retrieve a row and update one of more columns of that row
B. To modify all the rows for some columns
C. To modify all the rows for all the columns of a table
D. None of the above
Answer: A. Although, the UPDATE statement can modify all column values in all rows, but
typically it is used to select a row and update one or more columns.
26. Which of the following practices appropriately describe for selecting which row set
to update using the UPDATE statement?
Answer: C.
27. Which of the following columns in a table are not usually updated?
Answer: C. As a common practice, the primary key columns which serve as foreign key reference
in other tables, should not be updated. Though they can be updated by deferring the constraints
which is usually not recommended.
Consider the following data set and structure of the EMPLOYEES table and answer the
questions 28 and 29 that follow:
UPDATE employees
SET job_id = NULL;
Answer: C. An UPDATE statement without a WHERE clause will update all the rows of the table.
UPDATE employees
SET employee_id = NULL;
WHERE job_id = 'CLERK';
What will be the outcome of the above statement? (Here the column EMPLOYEE_ID is marked as
mandatory by putting a constraint)
A. The first column of the data set will get updated to NULL
B. The 3rd column of the first row will get updated to NULL
C. The 3rd column of all the rows will get updated to NULL
D. And ORA error will be thrown
Answer: D. The constraints on the column must be obeyed while updating its value. In the given
UPDATE statement, error will be thrown because the EMPLOYEE_ID column is a primary key in the
EMPLOYEES table which means it cannot be NULL.
30. Which of the following commands can be used to remove existing records from a
table?
A. UPDATE
B. INSERT
C. MINUS
D. DELETE
Answer: D. DELETE is used to remove the records from the table which can be optionally based
upon a condition. Being a DML statement, it is the part of a transaction.
31. What among the following is true about the DELETE statement?
Answer: B. The WHERE clause predicate is optional in DELETE statement. If the WHERE clause is
omitted, all the rows of the table will be deleted.
32.What among the following happens when we issue a DELETE statement on a table?
(Choose the most appropriate answer)
A. A prompt pops up asking the user whether he/she is sure of deleting the rows requested
B. The rows obeying the condition given in the DELETE statement are removed immediately
C. The requested rows are removed immediately without any prompt.
D. None of the above
Answer: C. As a part of the active or a new transaction, the rows in the table will be deleted.
33.Consider the following data set from the EMPLOYEES table and its structure:
SQL> DESC employees
Name Null? Type
----------------------- -------- ----------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
You need to delete the data from the JOB_ID column in the row with employee_id 51001. Which of
the following queries will be correct?
A. UPDATE employees
SET job_id = NULL
WHERE employee_id = 51001;
Answer: D. You cannot delete a particular column value for a particular row with the DELETE
statement. The entire row gets deleted based on the conditions given. Unwanted values in a
column can be updated to NULL. Option 'A' is near but not correct in the context of the question.
34. What is the difference between the UPSERT and MERGE statements?
A. There is no difference
B. UPSERT is the latest term adopted for MERGE statement, which has turned obsolete
C. UPSERT can perform delete operation which MERGE cannot
D. MERGE does INSERT, UPDATE and DELETE, UPSERT does only UPDATE and INSERT
Answer: D. UPSERT is an obsolete statement and MERGE took over with new capabilities.
35. What is the difference between the MERGE command and the commands INSERT,
UPDATE and DELETE?
A. MERGE statement consumes more time than each operation (INSERT, UPDATE, DELETE)
done separately
B. MERGE is obsolete after Oracle 10g
C. MERGE can perform all three operations on a table while INSERT, UPDATE and DELETE
perform one operation at a time.
D. None of the above.
Answer: C. The MERGE statement can embed all three operations on a table in a single statement
while INSERT, UPDATE and DELETE perform one operation at a time.
36. Which of the following objects can be the data source in a MERGE statement?
A. A table only
B. A sub-query only
C. A table or a sub-query
D. Both A or B
37. What among the following is a TRUNCATE statement equivalent to? (Choose the
most suitable answer)
A. To a DELETE statement
B. To an UPDATE statement
C. A DELETE statement without a WHERE clause
D. None of the above
38.Which of the following situations indicate that a DML operation has taken place?
Answer: A. When existing rows in a table are inserted, modified or removed from a table, it is
done through a DML statement.
Answer: C. A database transaction consists of one or more DML statements to constitute one
consistent change in data, or a DDL statement or a DCL command (GRANT or REVOKE). It starts
with the first DML statement and ends with a DCL or DDL or TCL (COMMIT or ROLLBACK) command.
Note that DDL and DCL commands hold auto commit feature.
40. What does a collection of DML statements that form a logical unit work known as?
A. ACID property
B. UNION
C. UNION ALL
D. Transaction
Answer: D.
Answer: A. If any of the DML statement in an active transaction encounters error, the whole
transaction ends up in a rollback.
Answer: D. The VALUES keyword is used only when the column values are explicitly specified in
the INSERT statement.
Consider the following statement and the table structure. Answer the questions 43 to
45 that follow:
A. 0
B. 2
C. 3
D. 1
Answer: D. When the keyword VALUES is used, it inserts only one row at a time.
44. In which order the values will get inserted with respect to the above INSERT
statement?
Answer: B. If the columns are mentioned in the INSERT clause, the VALUES keyword should
contain values in the same order
What will be the outcome of this modification? Assume that the DEPARTMENTS table has four
columns namely, department_id ,DEPARTMENT_NAME ,MANAGER_ID and LOCATION_ID .
A. It will insert values into all the columns of the departments table assuming that column
values are provided in the same sequence as the column in the table
B. It will throw an ORA error because column names are not explicitly mentioned
C. It will throw an ORA error because VALUES clause is wrongly used in the INSERT
D. None of the above
Answer: A. Including the column names in the INSERT statement is optional provided the values
must comply with the count and sequence of the columns in the table.
46. What will be the outcome of the below INSERT statement? (Consider the table
structure)
A. It will insert only the employee_id and the hire date of the employee, leaving all other
columns as blanks
B. It will insert only the employee_id
C. It will throw an ORA error
D. None of the above
Answer: C. The date literal formatting contains error. It should be enclosed within single
quotation marks and not double quotation marks.
47.What will be the outcome of the below INSERT statement? (Consider the given table
structure)
A. It will insert only the employee_id and the first name of Bryan, leaving all other columns as
blanks
B. It will insert only the first name
C. It will throw an ORA error
D. None of the above
Answer: C. The string literal formatting contains error. It should be enclosed within single
quotation marks and not double quotation marks.
48. Suppose you need to insert the name O'Callaghan as the last name of the employees
table. Which of the following queries will give you the required results? (Consider the
given table structure)
Answer: C.
49. What will be the outcome of the below INSERT statement? (Consider the given table
structure)
50. What will be the outcome of the below INSERT statement? (Consider the given table
structure)
Answer: C. NULLs can be used in the VALUES clause to fill up the column values alternatively.
51. What will be the outcome of the below INSERT statement? (Assume there is a NOT
NULL constraint on the department_id column and consider the table structure given)
52. What will be the outcome of the below INSERT statement? (Assume there is a NOT
NULL constraint on the department_id column and consider the given table structure)
Answer: B. Data type of the value mismatches with the data type of the column in the table.
53. Which of the following commands is used to save the changed data in a table
permanently?
A. ROLLBACK
B. COMMIT
C. INSERT
D. UPDATE
Answer: B. The TCL command COMMIT is used to end the current active transaction in a session
by making all the pending data changes permanent in the tables.
54. Which of the following commands allows undoing the changed data?
A. ROLLBACK
B. COMMIT
C. INSERT
D. UPDATE
Answer: A. The TCL command ROLLBACK is used to end the current active transaction in a
session by discarding all the pending data changes.
55. Which of the following commands allows enabling markers in an active transaction?
A. ROLLBACK
B. COMMIT
C. SAVEPOINT
D. None of the above
Answer: C. SAVEPOINT marks a point in a transaction which divides the transaction into smaller
sections.
56. Which of the following commands prevents other users from making changes to a
table?
A. ROLLBACK
B. COMMIT
C. LOCK TABLE
D. SAVEPOINT
Answer: C.
57. What is true about an INSERT statement which tries to insert values into a virtual
column? (Choose the most appropriate answer)
Answer: A. A Virtual column is a column which is always auto generated based on the derivation
expression defined in the column specification. Its value cannot be explicitly inserted by the user.
58.Which of the following commands allows the user to insert multiple rows with a
single statement?
A. INSERT
B. INSERT ALL
C. UNION ALL
D. None of the above
Answer: B. Bulk insert operations can be carried out using INSERT ALL.
59. Which of the following is the syntax for inserting rows through a sub-query?
C. Both A and B
D. None of the above
Answer: A.
Consider the following exhibit of the EMPLOYEES table and answer the questions 60 to
63 that follow:
A. UPDATE employees
SET salary = salary + 1000
WHERE to_char (hire_date, 'YYYY') > '2006';
B. UPDATE employees
SET salary = salary + 1000
WHERE to_date (hire_date, 'YYYY') > '2006';
C. UPDATE employees
SET salary = salary + 1000
WHERE hire_date > to_date (substr ('01-jan-200',8));
D. UPDATE employees
SET salary = salary + 1000
WHERE hire_date in (to_date ('JUN 01 11', to_date ('JUL 01 11'));
Answer: A.
61.Due to structural reorganization in the organization, you are asked to update
department IDs for all the employees to NULL before the final decision is made public.
Only those records should be updated which have the JOB_ID as NULL. Which of the
following queries will work?
A. UPDATE employees
SET department_id = NULL
Where job_id = NULL;
B. UPDATE employees
SET department_id = NULL
Where job_id = TO_NUMBER(NULL);
C. UPDATE employees
SET department_id = NULL
Where job_id IS NULL;
D. UPDATE employees
SET department_id = TO_NUMBER (' ', 9999)
Where job_id = TO_NUMBER(NULL);
62.You need to add a basic employee data into EMPLOYEES table. The basic data
contains the last name as 'Bond' and department ID as 300. Which of the following
statements will give the correct results?
Answer: B, C. Sub queries do work in INSERT statements provided they return a scalar value of
data type matching or compatible to the column for which they are used.
Assuming that there are no active transactions on the EMPLOYEES table in any sessions, which of
the following statements is true?
Answer: B. Being a DML statement, the data changes due to DELETE operation are made
permanent only after COMMIT is issued in the session.
What will happen when a ROLLBACK TO SAVEPOINT command is issued for the user session?
Answer: A, C. Since there are two savepoints - A and B, and the ROLLBACK command does
specifies the actual savepoint mark, Oracle throws error.
65.If a user issues a DML command and exits the SQL Developer abruptly without a
COMMIT or ROLLBACK, what will be the outcome? (Assume the session is not auto
commit)
A. Automatic COMMIT
B. Automatic ROLLBACK
C. Might be a COMMIT or a ROLLBACK to end the transaction
D. None of the above
A. COMMIT
B. SELECT
C. SAVEPOINT
D. CREATE
Answer: A, D. Apart from TCL commands i.e. COMMIT or ROLLBACK, the DDL commands and DCL
commands possess auto commit feature. The active transaction will be committed if the DDL
statement is executed in the same session.
Answer: D. Transaction completes if a TCL, DCL or a DDL command is executed in the session.
68. Examine the given table structures and consider the following query:
A. The columns in the EMPLOYEES table and the departments table do not match
B. The WHERE clause is mandatory to be used in a sub-query
C. The VALUES keyword cannot be used with the INSERT clause when sub-queries are used
D. None of the above
Answer: C. Wrong usage of VALUES keyword. It must be used only when you have column data in
hand, which has to be inserted in the table.
69.Examine the given table structure and consider the following query:
A. It would not execute as we cannot use two tables in a single update statement
B. It would not execute as UPDATE cannot use a sub-query
C. It would execute with the restrictions on the column specified
D. It would not execute as sub-query is used in the WHERE clause
Answer: C.
A. The changes made during the transaction are saved for a particular user session
B. The changes made during the transaction are discarded
C. If the transaction is a DDL, the commit doesn't work
D. None of the above
Answer: D. Committing a transaction saves the pending data changes permanently into the
database.
71. Which of the following reasons will the best one on the usage of string?
A. Using sub-queries
B. Syntax errors
C. Access permissions
D. Constraint violations
72. What happens when an INSERT statement tries to insert records in an old table?
Answer: C.
73. A user named 'Jonathan Adams' is able to SELECT columns from the EMPLOYEES
table but he is unable to insert records into EMPLOYEES. What can be the reason?
74. Suppose 1 million rows are to be inserted into the AUDIT table. An INSERT
transaction runs successfully for the first 1000 rows and an ORA error is thrown
'Constraint violated'. What will happen to the values inserted in the first 1000 rows?
Answer: C. If any of the DML statement during the transaction encounters error(s), the complete
transaction will be rolled back.
Examine the table structure and consider the following query and answer the questions
75, 76 and 77 that follow:
A. It will insert a row with department_id = 15 and all the other values as NULL
B. It will execute successfully but insert 0 rows in the table
C. It will throw an ORA error as the no. of columns and values do not match
D. None of the above
Answer: C. The DEPARTMENTS table contains four columns but the INSERT statement supplies
value for two columns only without mentioning the columns too. Hence, the ORA error is thrown.
A. If the columns are not mentioned in the INSERT statement, the values are inserted
positionally in the columns
B. It is mandatory to mention columns after the INSERT statement
C. Both A and B
D. None of the above
Answer: A. If the columns are not specified in the INSERT statement, Oracle sequentially and
positionally maps each value to the column in the table.
77. With respect to the statement given above, what will happen if the table is altered
to add a new column?
Examine the table structure given below and consider the following queries and answer
the questions 78 and 79 that follow:
Query 1:
INSERT INTO employees (employee_id , last_name, hire_date)
VALUES (100, 'ADAMS','21-DEC-12');
Query 2:
INSERT INTO employees (employee_id , last_name, hire_date)
VALUES (100, upper('ADAMS'),to_date('21-DEC-12','DD-MON-YY'));
Answer: C. Query-2 is better because it inserts date value as a date and not as a string. Though
Oracle will perform implicit conversion of string literal specified as a date, but not recommended.
79. Which of the following queries is equivalent of the query 2 given above?
Answer: A, C, D. Arithmetic operations /functions can be used to insert values as shown above.
80. You need to copy the data from one table to another table. Which of the following
methods can be used?
Answer: B. The direct path operations INSERT-AS-SELECT (IAS) is the most commonly used
method to copy data from one table to another.
81.Which of the following statements will copy data from the JOB_HISTORY table to the
JOB_HISTORY_ARCHIVE table? (Consider the table structure as given)
Answer: C. The option 'C' correctly shows the usage of IAS (INSERT-AS-SELECT) method.
Examine the given table structure. Consider the following query and answer the
questions 82 and 83 that follow:
INSERT ALL
WHEN job_id = 'SA_REP' then
INTO employees (employee_id , department_id , salary, hire_date)
VALUES (employee_id , 10, salary, hire_date)
WHEN job_id <> 'SA_REP' then
INTO employees (employee_id , department_id , salary, hire_date)
VALUES (employee_id , 20, salary, hire_date)
SELECT employee_id , department_id , job_id, salary, commission_pct , hire_date
FROM employees
WHERE hire_date > sysdate - 30;
A. Thrown an error
B. It will insert the records for all the employees who were hired a month before the sysdate.
C. It will insert the records for all the employees who are Sales Representatives in department
10
D. None of the above
Answer: B, C. INSERT ALL can make conditional inserts into the target tables.
A. Sales Representatives
B. Accountants
C. Both A or B
D. None of the above
Answer: B. As per the INSERT ALL statement, the details of employees whose job_id is not 'Sales
Representative'.
84. What will be the outcome of the below query? (Consider the table structure as
given)
85. Evaluate the following SQL statements that are executed in a user session in the
specified order:
UPDATE employees
SET employee_id = id_seq.NEXTVAL
WHERE first_name = 'Steyn'
AND job_id ='Trainee';
A. The CREATE SEQUENCE command would throw error because the minimum and maximum
value for the sequence have not been specified
B. All the statements would execute successfully and the employee_id column would contain
the value 2 for the employee STEYN.
C. The CREATE SEQUENCE command would not execute because the starting value of the
sequence and the increment value have not been specified.
D. All the statements would execute successfully and the employee_id column would have the
value 20 for the employee STEYN because the default CACHE value is 20.
Answer: B.
86. What is the restriction on the sub-query used in the UPDATE statement?
Answer: B. The sub-query should not return multiple rows when being used in an UPDATE
statement
Examine the given table structure and consider the query given below and answer the
questions 87 and 88 that follow:
UPDATE employees
SET salary = (SELECT salary FROM employees WHERE employee_id =7382);
Answer: B. Query results can be used to update the column values in a table.
88. Suppose if the employee 7382 doesn't exist in the EMPLOYEES table. What will be
the outcome of the query?
A. It throws an ORA error on execution because query results cannot be updated to the columns
B. Salary of all the employees will be updated to NULL
C. ORA exception 'NO_DATA_FOUND' will be raised because employee 7382 doesn't exists
D. None of the above
Answer: B. UPDATE statements do not raise any exception except for syntactical errors.
Examine the given table structure and consider the query given below and answer the
questions 89 and 90 that follow:
UPDATE employees
set salary = (select salary from employees where last_name = 'Adams');
A. It executes successfully
B. All the rows of the table have the same salary
C. It might throw an ORA error 'TOO_MANY_ROWS' upon execution
D. None of the above
Answer: C. The sub-query might return more than one row causing an error.
90. What changes in the above query will make sure there are no errors caused?
A. Use a single row function like MAX, MIN or AVG to reduce multi row results into a scalar result
B. Adding a Primary key constraint on SALARY column
C. No change required
D. None of the above
Answer: A.
Examine the given table structure and consider the following query and answer the
questions 91 and 92 that follow:
UPDATE employees
SET salary = (select max (salary) from employees where last_name = 'Adams');
A. It will update the salaries of all the employees equal to the salary of the employee named
Adam
B. It will update the salaries of all the employees equal to the average salary of all with last
name as 'Adam'
C. It will update 0 rows
D. It will update only one row
Answer: B. Arithmetic functions MAX or a MIN can be used with sub-queries to get scalar values
and avoid errors.
92. Assume that the sub-query above is replaced with the following:
Answer: C. it gives an error because as there are many with the last name as 'Adam' there will
many distinct salaries.
Examine the given table structure and consider the following query and answer the
questions 93 and 94 that follow:
UPDATE employees
SET salary = 50000;
WHERE job_id in (select job_id from job_history where department_id = 10);
93. What will the above statement do? (Choose the most appropriate answer)
A. It will update all the salaries for all the employees as 50000
B. It will update all the salaries for all the employees who are in department 10
C. It will update the salaries for all the employees who have one of the job IDs similar to those in
department 10
D. None of the above
Answer: C.
94. What will happen if the WHERE clause given above is replaced with the following?
Examine the given table structure and consider the following statement. Answer the
questions 95 to 97 that follow.
Answer: A. DELETE statement can have WHERE clause predicate. Based on conditions, the
records will be removed from the table.
Assuming there is a NOT NULL constraint on the column employee_id , what will be the outcome of
the above query?
Answer: B. Multiple predicates can be applied to the DML statements UPDATE and DELETE.
A. It will raise error because DML statements cannot use substitution variables
B. It will prompt for the department ID to be deleted from the user and delete the record with
the given department ID
C. It will prompt for the department ID but transaction cannot be committed
D. None of the above
98. All parts of a transaction should complete or none of them. Which property of ACID
rule complies with the given statement?
A. Atomicity
B. Consistency
C. Isolation
D. Durability
Answer: A. ACID refers to the basic properties of a database transaction: Atomicity, Consistency,
Isolation, and Durability. Atomicity implies that entire sequence of actions must be either
completed or aborted. Consistency implies that the transaction takes the resources from one
consistent state to another. Isolation implies that a transaction's effect is not visible to other
transactions until the transaction is committed. Durability implies that the changes made by the
committed transaction are permanent and must survive system failure.
99. What does the principle of Durability in the ACID property state?
Answer: C.
100. An incomplete transaction should be invisible to all the other users. Which of the
properties of the ACID state this?
A. Isolation
B. Consistency
C. Atomicity
D. Durability
A. It states that the results of a query must be consistent with the state of the DB at the time the
query started
B. It states that an incomplete transaction should be invisible to all the other users
C. It states that once a transaction completes, it must be impossible for the DB to lose it
D. None of the above
A. INSERT to COMMIT/ROLLBACK
B. UPDATE to COMMIT/ROLLBACK
C. DELETE to COMMIT/ROLLBACK
D. INSERT/UPDATE/DELETE to COMMIT/ROLLBACK
Answer: D.
103. A user named "Jonathan" inserts data in the table EMPLOYEES. When will the other
users be able to see the new data?
Answer: C.
A. A DDL statement
B. Exiting a client
C. System crashes
D. All of the above
Answer: D. DDL is auto commit and will end the ongoing active transaction.