This practice test for the Oracle 1z0-007 certification assesses skills in SQL database management, focusing on roles, subqueries, and table operations. It's essential for those aiming to excel in database administration and management roles.
SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department _ id);
SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);
SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);
SELECT department_id FROM employees WHERE SALARY > ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);
SELECT last_name FROM employees Where salary > ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);
SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));
Rate this question:
SELECT dept_id, job_cat, MAX(salary) FROM employees WHERE salary > MAX (salary);
SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept_id,job_cat;
SELECT dept_id, job_cat, MAX(salary) FROM employees;
SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept_id; E. SELECT dept_id, job_cat, MAX(salary) FROM employees GROUP BY dept _ id job _ cat salary;
Rate this question:
ALTER TABLE students ADD PRIMARY KEY student_id;
ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);
ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student _ id);
ALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
ALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
Rate this question:
The statement produces an error at line 1.
The statement produces an error at line 3.
The statement produces an error at line 6.
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.
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.
Rate this question:
Only the row with department ID 40 is deleted in the DEPARTMENTS table.
The statement fails because there are child records in the EMPLOYEES table with department ID 40.
The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 110 and 106 are deleted from the EMPLOYEES table.
The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 106 and 110 and the employees working under employee 110 are deleted from the EMPLOYEES table.
The row with department ID 40 is deleted in the DEPARTMENTS table. Also all the rows in the EMPLOYEES table are deleted.
The statement fails because there are no columns specifies in the DELETE clause of the DELETE statement.
Rate this question:
CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) NOT NULL CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);
CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));
CREATE TABLE EMP (empno NUMBER(4) ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));
CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp deptno fk REFERENCES dept (deptno));
Rate this question:
SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);
SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;
SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;
SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);
Rate this question:
0
1
0.00
An error statement
Rate this question:
ALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students (student_id);
ALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
ALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
ALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
ALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
Rate this question:
ALTER VIEW EMP_dept_vu (ADD manger_id NUMBER);
MODIFY VIEW EMP_dept_vu (ADD manger_id NUMBER);
ALTER VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employee e, departments d WHERE e.department _ id = d.department_id;
MODIFY VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id = d.department_id;
CREATE OR REPLACE VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id =d.department_id;
You must remove the existing view first, and then run the CREATE VIEW command with a new column list to modify a view.
Rate this question:
UPDATE new_employees SET name = (Select last_name|| first_name FROM employees Where employee_id =180) WHERE employee_id = 180;
UPDATE new_employees SET name = (SELECT last_name||first_name FROM employees) WHERE employee_id = 180;
UPDATE new_employees SET name = (SELECT last_name|| first_name FROM employees WHERE employee_id =180) WHERE employee_id =(SELECT employee_id FROM new employees
UPDATE new_employees SET name = (SELECT last name|| first_name FROM employees WHERE employee_id= (SELECT employee_id FROM new_employees)) WHERE employee_id =180;
Rate this question:
CREATE VIEW emp_Vu AS SELECT employee_id, emp_name, department_id FROM employees WHERE mgr_id IN (102, 120);
CREATE VIEW emp_Vu AS SELECT employee_id, emp_name, job_id department_id FROM employees WHERE mgr_id IN (102, 120);
CREATE VIEW emp_Vu AS SELECT department_id, SUM(sal) TOTALSAL FROM employees WHERE mgr_id IN (102, 120) GROUP BY department_ id;
CREATE VIEW emp_Vu AS SELECT employee_id, emp_name, job_id, DISTINCT department_id FROM employees;
Rate this question:
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);
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);
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);
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.employees_id, e.first_name ||','||e.last_name);
Rate this question:
Immediately after the SELECT clause
Before the WHERE clause
Before the FROM clause
After the ORDER BY clause
After the WHERE clause
Rate this question:
A single row subquery can retrieve data from only one table.
A SQL query statement cannot display data from table B that is referred to in its subquery, unless table B is included in the main query's FROM clause.
A SQL query statement can display data from table B that is referred to in its subquery, without including table B in its own FROM clause.
A single row subquery can retrieve data from more than one table.
A single row subquery cannot be used in a condition where the LIKE operator is used for comparison
A multiple-row subquery cannot be used in a condition where the LIKE operator is used for comparison.
Rate this question:
The underlying tables must have data.
You need SELECT privileges on the view.
The underlying tables must be in the same schema
You need SELECT privileges only on the underlying tables.
Rate this question:
The two statements produce identical results
The second statement returns a syntax error.
There is no need to specify DESC because the results are sorted in descending order by default
The two statements can be made to produce identical results by adding a column alias for the salary column in the second SQL statement.
Rate this question:
The value displayed in the CALC_VALUE column will be lower.
The value displayed in the CALC_VALUE column will be higher.
There will be no difference in the value displayed in the CALC_VALUE column.
An error will be reported.
Rate this question:
SELECT student_ id, marks, ROWNUM "Rank" FROM students WHERE ROWNUM
SELECT student_id, marks, ROWID "Rank" FROM students WHERE ROWID
SELECT student_id, marks, ROWNUM "Rank" FROM (SELECT student_id, marks FROM students WHERE ROWNUM
SELECT student_id, marks, ROWNUM "Rank" FROM (SELECT student_id, marks FROM students ORDER BY marks DESC) WHERE ROWNUM
Rate this question:
SELECT TOTAL(*) FROM customer;
SELECT COUNT(*) FROM customer;
SELECT TOTAL(customer_id) FROM customer;
SELECT COUNT(customer_id) FROM customer;
SELECT COUNT(customers) FROM customer;
SELECT TOTAL(customer_name) FROM customer;
Rate this question:
COMMIT...
MERGE...
UPDATE...
DELETE...
CREATE...
DROP...
Rate this question:
Scott can create a synonym for the EMP_DEPT_LOC_VU bus using the command: CREATE PRIVATE SYNONYM EDL_VU FOR mary. EMP DEPT_LOC_VU; then he can prefix the columns with this synonymn.
Scott can create a synonym for the EMP_DEPT_LOC_VU by using the command: CREATE SYNONYM EDL_VU FOR mary. EMP DEPT_LOC_VU; then he can prefix the columns with this synonym.
Scott can create a synonym for the EMP_DEPT_LOC_VU by using the command: CREATE LOCAL SYNONYM EDL_VU FOR mary. EMP DEPT_LOC_VU; then he can prefix the columns with this synonym.
Scott can create a synonym for the EMP_DEPT_LOC_VU by using the command: CREATE SYNONYM EDL_VU FOR mary. EMP DEPT_LOC_VU; then he can prefix the columns with this synonym.
Scott cannot create a synonym because synonyms can be created only for tables.
Scott cannot create any synonym for Mary's view. Mary should create a private synonym for the view and grant SELECT privilege on that synonym to Scott.
Rate this question:
You have no rows in the table.
You have an employee with the name of James.
You cannot roll back to the same savepoint more than once.
Your last update fails to update any rows because employee ID 180 was already deleted.
Rate this question:
The indexed column is declared as NOT NULL.
The indexed columns are used in the FROM clause.
The indexed columns are part of an expression.
The indexed column contains a wide range of values.
Rate this question:
SELECT a.last_name, a.salary, a.department_id, b.maxsal FROM employees a, (SELECT department_id, max(salary)maxsal FROM employees GROUP BY department_id) b WHERE a.department_id = b.department_id AND a.salary < b.maxsal;
SELECT a.last name, a.salary, a.department_id FROM employees a WHERE a.department_id IN (SELECT department_id FROM employees b GROUP BY department_id having salary = (SELECT max(salary) from employees))
SELECT a.last_name, a.salary, a.department_id FROM employees a WHERE a.salary = (SELECT max(salary) FROM employees b WHERE a.department _ id = b.department _ id);
SELECT a.last_name, a.salary, a.department_id FROM employees a WHERE (a.department_id, a.salary) IN (SELECT department_id, a.salary) IN (SELECT department_id max(salary) FROM employees b GROUP BY department_id ORDER BY department _ id);
Rate this question:
A single row subquery can retrieve only one column and one row.
A single row subquery can retrieve only one row but many columns
A multiple row subquery can retrieve multiple rows and multiple columns
A multiple row subquery can be compared by using the ">" operator.
A single row subquery can use the IN operator.
A multiple row subquery can use the "=" operator.
Rate this question:
Must begin with either a number or a letter.
Must be 1-30 characters long.
Should not be an Oracle Server reserved word.
Must contain only A-Z, a-z, 0-+, _, *, and #.
Must contain only A-Z, a-z, 0-9, _, $, and #.
Must begin with a letter.
Rate this question:
=
LIKE
BETWEEN
NOT IN
IS
Rate this question:
The main query executes with the first value returned by the subquery.
The main query executes with the last value returned by the subquery.
The main query executes with all the values returned by the subquery
The main query fails because the multiple-row subquery cannot be used with the comparison operator.
You cannot define a multiple-row subquery in the WHERE clause of a SQL query.
Rate this question:
MAX
MIN
SUM
COUNT
TOTAL
LARGEST
Rate this question:
SELECT * FROM DEPT;
SELECT * FROM SCOTT. DEPT;
SELECT * FROM DBA.SCOTT DEPT;
SELECT * FROM ALL_USERS WHERE USER_NAME = 'SCOTT' AND TABLE NAME = 'DEPT';
Rate this question:
Create groups of data
Sort data in a specific order
Convert data to a different format
Retrieve data based on an unknown condition
Rate this question:
All of the desired results
Two of the desired results
One of the desired results
An error statement
Rate this question:
INSERT
UPDATE
SELECT
DESCRIBE
DELETE
RENAME
Rate this question:
CREATIVE USER susan;
CREATIVE OR REPLACE USER susan;
CREATE NEW USER susan DEFAULT
CREATE USER susan IDENTIFIED BY blue;
CREATE NEW USER susan IDENTIFIED BY blue;
CREATE OR REPLACE USER susan IDENTIFIED BY blue;
Rate this question:
It allows a grantee DBA privileges.
It is required syntax for object privileges.
It allows privileges on specified columns of tables
It is used to grant an object privilege on a foreign key column.
It allows the grantee to grant object privileges to other users and roles.
Rate this question:
DELETE employees;
DESCRIBE employees;
ROLLBACK TO SAVE POINT C;
GRANT SELECT ON employees TO SCOTH
ALTER TABLE employees SET UNUSED COLUMN sal;
Select MAX(sal) FROM employees WHERE department _ id 20;
Rate this question:
Binary data up to 4 gigabytes.
Character data up to 4 gigabytes.
Raw binary data of variable length up to 2 gigabytes.
Binary data stored in an external file, up to 4 gigabytes.
A hexadecimal string representing the unique address of a row in its table.
Rate this question:
Create a table view.
Create a view in any schema.
Create a view in your schema.
Create a sequence view in any schema.
Create a view that is accessible by everyone.
Create a view only of it is based on tables that you created.
Rate this question:
Constraint names must start with SYS_C.
All constraints must be defines at the column level.
Constraints can be created after the table is created.
Constraints can be created at the same time the table is created.
Information about constraints is found in the VIEW_CONSTRAINTS dictionary view.
Rate this question:
SELECT &1, "&2" FROM &3 WHERE last_name = '&4';
SELECT &1, '&2' FROM &3 WHERE '& last_name = '&4';
SELECT &1, &2 FROM &3 WHERE last_name = '&4';
SELECT &1, '&2' FROM EMP WHERE last_name = '&4';
Rate this question:
DELETE FROM employees WHERE employee_id = (SELECT employee_id FROM employees);
DELETE * FROM employees WHERE employee_id = (SELECT employee_id FROM new_ employees);
DELETE FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE name = ('Carrey')'
DELETE * FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE last_ name = ('Carrey')'
Rate this question:
SELECT * FROM emp_dept_vu;
SELECT department_id, SUM(salary) FROM emp_dept_vu GROUP BY department _ id;
SELECT department_id, job_id, AVG(salary) FROM emp_dept_vu GROUP BY department _ id, job_id;
SELECT job_id, SUM(salary) FROM emp_dept_vu WHERE department_id IN (10,20) GROUP BY job_id HAVING SUM (salary) > 20000
None of the statements produce an error; all are valid.
Rate this question:
DROP emp_dept_uv;
DELETE emp_dept_uv;
REMOVE emp_dept_uv;
DROP VIEW emp_dept_uv;
DELETE VIEW emp_dept_uv;
REMOVE VIEW emp_dept_uv;
Rate this question:
CREATE ROLL registrar; GRANT MODIFY ON student_grant TO registrar; GRANT registrar to user 1, user2, user3
CREATE NEW ROLE registrar; GRANT ALL ON student_grant TO registrar; GRANT registrar to user 1, user2, user3
CREATE ROLL registrar; GRANT UPDATE ON student_grant TO registrar; GRANT ROLE to user1, user2, user3
CREATE ROLL registrar; GRANT UPDATE ON student_grant TO registrar; GRANT registrar to user 1, user2, user3;
CREATE registrar; GRANT CHANGE ON student_grant TO registrar; GRANT registrar;
Rate this question:
The table is accessible to all users
Tables are created in the public schema.
Tables are created in your schema.
Tables are created in the DBA schema
You must specify the schema when the table is created.
Rate this question:
Cannot be nested
Manipulate data items
Act on each row returned
Return one result per row
Accept only one argument and return only one value
Accept arguments which can be a column or an expression
Rate this question:
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE = SYSDATE);
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE DEFAULT SYSDATE);
CREATE OR REPLACE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE DEFAULT SYSDATE);
CREATE OR REPLACE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status VARCHAR2 (10), date_ordered DATE = SYSDATE);
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE = SYSDATE);
CREATE TABLE orders ( order_id NUMBER (10), customer_id NUMBER (8), order_status NUMBER (10), date_ordered DATE DEFAULT SYSDATE);
Rate this question:
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.
Wait!
Here's an interesting quiz for you.