Oracle 1z0-061 Exam Practice Questions (P. 5)
- Full Access (339 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #41
View the Exhibits and examine the structures of the products, sales, and customers tables.



You need to generate a report that gives details of the customer's last name, name of the product, and the quantity sold for a customers in 'Tokyo'.
Which two queries give the required result?




You need to generate a report that gives details of the customer's last name, name of the product, and the quantity sold for a customers in 'Tokyo'.
Which two queries give the required result?

send
light_mode
delete
Question #42
View the Exhibit and examine the structure of the products table.

Evaluate the following query:

What would be the outcome of executing the above SQL statement?

Evaluate the following query:

What would be the outcome of executing the above SQL statement?
- AIt produces an error.
- BIt shows the names of all products in the table.
- CIt shows the names of products whose list price is the second highest in the table.
- DIt shows the names of all products whose list price is less than the maximum list price.
Correct Answer:
C
C
send
light_mode
delete
Question #43
You issued the following command:
SQL> DROP TABLE employees;
Which three statements are true?
SQL> DROP TABLE employees;
Which three statements are true?
- AAll uncommitted transactions are committed.
- BAll indexes and constraints defined on the table being dropped are also dropped.
- CSequences used in the employees table become invalid.
- DThe space used by the employees table is reclaimed immediately.
- EThe employees table can be recovered using the rollback command.
- FThe employees table is moved to the recycle bin.
Correct Answer:
ABF
A: If a user issues a DDL (CREATE, ALTER, or DROP) or DCL (GRANT or REVOKE) command, the transaction in progress (if any) will be committed.
B: Dropping a table invalidates dependent objects, such as indexes and constraints.
F: The DROP TABLE statement moves a table or object table to the recycle bin.
Incorrect:
Not B: In general sequences used in the table would not by affected when the table is dropped.
Not D: Unless you specify the PURGE clause, the DROP TABLE statement does not result in space being released back to the tablespace for use by other objects, and the space continues to count toward the user's space quota.
Not E: Dropping a table invalidates dependent objects and removes object privileges on the table. If you want to re-create the table, then you must regrant object privileges on the table, re-create the indexes, integrity constraints, and triggers for the table, and respecify its storage parameters.
Reference:
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9003.htm
ABF
A: If a user issues a DDL (CREATE, ALTER, or DROP) or DCL (GRANT or REVOKE) command, the transaction in progress (if any) will be committed.
B: Dropping a table invalidates dependent objects, such as indexes and constraints.
F: The DROP TABLE statement moves a table or object table to the recycle bin.
Incorrect:
Not B: In general sequences used in the table would not by affected when the table is dropped.
Not D: Unless you specify the PURGE clause, the DROP TABLE statement does not result in space being released back to the tablespace for use by other objects, and the space continues to count toward the user's space quota.
Not E: Dropping a table invalidates dependent objects and removes object privileges on the table. If you want to re-create the table, then you must regrant object privileges on the table, re-create the indexes, integrity constraints, and triggers for the table, and respecify its storage parameters.
Reference:
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9003.htm
send
light_mode
delete
Question #44
Examine the create table statements for the stores and sales tables.
SQL> CREATE TABLE stores(store_id NUMBER(4) CONSTRAINT store_id_pk PRIMARY KEY, store_name VARCHAR2(12), store_address
VARCHAR2(20), start_date DATE);
SQL> CREATE TABLE sales(sales_id NUMBER(4) CONSTRAINT sales_id_pk PRIMARY KEY, item_id NUMBER(4), quantity NUMBER(10), sales_date
DATE, store_id NUMBER(4), CONSTRAINT store_id_fk FOREIGN KEY(store_id) REFERENCES stores(store_id));
You executed the following statement:
SQL> DELETE from stores -
WHERE store_id=900;
The statement fails due to the integrity constraint error:
ORA-02292: integrity constraint (HR.STORE_ID_FK) violated
Which three options ensure that the statement will execute successfully?
SQL> CREATE TABLE stores(store_id NUMBER(4) CONSTRAINT store_id_pk PRIMARY KEY, store_name VARCHAR2(12), store_address
VARCHAR2(20), start_date DATE);
SQL> CREATE TABLE sales(sales_id NUMBER(4) CONSTRAINT sales_id_pk PRIMARY KEY, item_id NUMBER(4), quantity NUMBER(10), sales_date
DATE, store_id NUMBER(4), CONSTRAINT store_id_fk FOREIGN KEY(store_id) REFERENCES stores(store_id));
You executed the following statement:
SQL> DELETE from stores -
WHERE store_id=900;
The statement fails due to the integrity constraint error:
ORA-02292: integrity constraint (HR.STORE_ID_FK) violated
Which three options ensure that the statement will execute successfully?
- ADisable the primary key in the STORES table.
- BUse CASCADE keyword with DELETE statement.
- CDELETE the rows with STORE_ID = 900 from the SALES table and then delete rows from STORES table.
- DDisable the FOREIGN KEY in SALES table and then delete the rows.
- ECreate the foreign key in the SALES table on SALES_ID column with on DELETE CASCADE option.
Correct Answer:
ACD
ACD
send
light_mode
delete
Question #45
You want to create a sales table with the following column specifications and data types:
SALESID: Number -
STOREID: Number -
ITEMID: Number -
QTY: Number, should be set to 1 when no value is specified
SLSDATE: Date, should be set to current date when no value is specified
PAYMENT: Characters up to 30 characters, should be set to CASH when no value is specified
Which statement would create the table?

SALESID: Number -
STOREID: Number -
ITEMID: Number -
QTY: Number, should be set to 1 when no value is specified
SLSDATE: Date, should be set to current date when no value is specified
PAYMENT: Characters up to 30 characters, should be set to CASH when no value is specified
Which statement would create the table?

- AOption A
- BOption B
- COption C
- DOption D
Correct Answer:
B
To specify the default value of payment field you must use DEFAULT 'CASH'.
Reference: https://docs.oracle.com/database/121/SQLRF/statements_7002.htm#SQLRF01402
B
To specify the default value of payment field you must use DEFAULT 'CASH'.
Reference: https://docs.oracle.com/database/121/SQLRF/statements_7002.htm#SQLRF01402
send
light_mode
delete
Question #46
Examine the data in the CUST_NAME column of the customers table.

You need to display customers' second names where the second name starts with "Mc" or "MC."
Which query gives the required output?


You need to display customers' second names where the second name starts with "Mc" or "MC."
Which query gives the required output?

send
light_mode
delete
Question #47
Evaluate the following query:
SQL> SELECT TRUNC(ROUND(156.00, -1), -1)
FROM DUAL;
What would be the outcome?
SQL> SELECT TRUNC(ROUND(156.00, -1), -1)
FROM DUAL;
What would be the outcome?
- A16
- B100
- C160
- D200
- E150
Correct Answer:
C
Function Purpose -
ROUND(column|expression, n) Rounds the column, expression, or value to n decimal places or, if n is omitted, no decimal places (If n is negative, numbers to the left of decimal point are rounded.)
TRUNC(column|expression, n) Truncates the column, expression, or value to n decimal places or, if n is omitted, n defaults to zero
C
Function Purpose -
ROUND(column|expression, n) Rounds the column, expression, or value to n decimal places or, if n is omitted, no decimal places (If n is negative, numbers to the left of decimal point are rounded.)
TRUNC(column|expression, n) Truncates the column, expression, or value to n decimal places or, if n is omitted, n defaults to zero
send
light_mode
delete
Question #48
You want to display 5 percent of the rows from the sales table for products with the lowest AMOUNT_SOLD and also want to include the rows that have the same
AMOUNT_SOLD even if this causes the output to exceed 5 percent of the rows.
Which query will provide the required result?

AMOUNT_SOLD even if this causes the output to exceed 5 percent of the rows.
Which query will provide the required result?

- AOption A
- BOption B
- COption C
- DOption D
Correct Answer:
D
The FETCH statement must include WITH TIES.
Incorrect:
Not B: You cannot use ROWS WITH in a FETCH statement.
D
The FETCH statement must include WITH TIES.
Incorrect:
Not B: You cannot use ROWS WITH in a FETCH statement.
send
light_mode
delete
Question #49
You need to list the employees in DEPARTMENT_ID 30 in a single row, ordered by HIRE_DATE.
Examine the sample output:

Which query will provide the required output?

Examine the sample output:

Which query will provide the required output?

- AOption A
- BOption B
- COption C
- DOption D
Correct Answer:
B
Reference:
http://docs.oracle.com/cd/E11882_01/server.112/e10592/functions089.htm
B
Reference:
http://docs.oracle.com/cd/E11882_01/server.112/e10592/functions089.htm
send
light_mode
delete
Question #50
Which create table statement is valid?


- AOption A
- BOption B
- COption C
- DOption D
Correct Answer:
D
PRIMARY KEY Constraint -
A PRIMARY KEY constraint creates a primary key for the table. Only one primary key can be created for each table. The PRIMARY KEY constraint is a column or a set of columns that uniquely identifies each row in a table. This constraint enforces the uniqueness of the column or column combination and ensures that no column that is part of the primary key can contain a null value.
Note: Because uniqueness is part of the primary key constraint definition, the Oracle server enforces the uniqueness by implicitly creating a unique index on the primary key column or columns.
Incorrect:
Not A: Two primary keys are not allowed.
Not B: You cannot specific a column to be both UNIQUE and NOT NULL.
Not C: The default value cannot be NOT NULL.
D
PRIMARY KEY Constraint -
A PRIMARY KEY constraint creates a primary key for the table. Only one primary key can be created for each table. The PRIMARY KEY constraint is a column or a set of columns that uniquely identifies each row in a table. This constraint enforces the uniqueness of the column or column combination and ensures that no column that is part of the primary key can contain a null value.
Note: Because uniqueness is part of the primary key constraint definition, the Oracle server enforces the uniqueness by implicitly creating a unique index on the primary key column or columns.
Incorrect:
Not A: Two primary keys are not allowed.
Not B: You cannot specific a column to be both UNIQUE and NOT NULL.
Not C: The default value cannot be NOT NULL.
send
light_mode
delete
All Pages