Quiz
Oracle SQL
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (19)
1What is true about the WITH GRANT OPTION clause?
- AIt allows privileges on specified columns of tables.
- BIt is used to grant an object privilege on a foreign key column.
- CIt allows a grantee DBA privileges.
- DIt is required syntax for object privileges.
- EIt allows the grantee to grant object privileges to other users and roles.
2Which single-row function could you use to return a specific portion of a character string?
- AINSTR
- BLEAST
- CLPAD
- DSUBSTR
3Where can sub queries be used?
- Afield names in the SELECT statement
- Bthe FROM clause in the SELECT statement
- Cthe WHERE clause in SELECT as well as all DML statements
- Dthe HAVING clause in the SELECT statement
- Ethe WHERE clause in only the SELECT statement
- Fthe GROUP BY clause in the SELECT statement
4In the following SELECT statement, which component is a literal?
SELECT 'Employee Name: ' || ename
FROM emp WHERE deptno = 10;- A||
- Bename
- CEmployee Name:
- D10
5The EMPLOYEES table has EMPLOYEE_ID, DEPARTMENT_ID, and FULL_NAME columns. The DEPARTMENTS table has DEPARTMENT_ID and DEPARTMENT_NAME columns.
Which two of the following queries return the department ID, name, and employee name, listing department names even if there is no employee assigned to that department?- ASELECT d.department_id, d.department_name, e.full_name FROM departments d NATURAL LEFT OUTER JOIN employees e;
- BSELECT d.department_id, d.department_name, e.full_name FROM departments d LEFT OUTER JOIN employees eON (d.department_id = e.department_id);
- CSELECT d.department_id, d.department_name, e.full_name FROM departments d LEFT OUTER JOIN employees eUSING (d.department_id);
- DSELECT department_id, department_name, full_name FROM departments NATURAL LEFT JOIN employees;
6Evaluate the SQL statement DROP TABLE DEPT:
Which four statements are true of the SQL statement?- AAll indexes based on the DEPT table are dropped.
- BYou cannot roll back this statement.
- CAll data in the table is deleted, but the structure of the table is retained.
- DAll views based on the DEPT table are deleted.
- EAll synonyms based on the DEPT table are deleted.
- FAll pending transactions are committed.
- GAll data in the table is deleted, and the table structure is also deleted.
7Which statement is true regarding sub queries?
- AThe NOT IN operator is equivalent to IS NULL with single- row subqueries.
- BThe LIKE operator cannot be used with single- row subqueries.
- CThe NOT operator can be used with IN, ANY, and ALL operators in multiple- row subqueries.
- D=ANY and =ALL operators have the same functionality in multiple- row subqueries.
8Which statement is true regarding tables?
- AA table name can be of any length.
- BA column that has a DEFAULT value cannot store null values.
- CA table and a view can have the same name in the same schema.
- DA table and a synonym can have the same name in the same schema.
- EThe same table name can be used in different schemas in the same database.
- FA table can have any number of columns.
9Which date components does the CURRENT_TIMESTAMP function display?
- ASession date and session time zone offset
- BSession date and session time
- CSession date, session time, and session time zone offset
- DSession time zone offset
10SELECT ROUND(45.953, -1), TRUNC(45.936, 2)
FROM dual;
Which values are displayed?- A46 and 45
- B50 and 45.9
- C46 and 45.93
- D45.95 and 45.93
- E50 and 45.93
- F45 and 45.93
11When a DML statement executes, what happens?
- AThe redo log buffer is updated with information needed to redo the transaction, and the undo blocks are updated with information needed to reverse the transaction.
- BBoth data and undo blocks are updated in the database buffer cache, and the updates also go to the log buffer.
- CThe old version of the data is written to an undo segment, and the new version is written to the data segments and the redo log buffer.
- DBoth the data and the undo blocks on disk are updated, and the changes are written out to the redo stream.
12A query can have a sub query embedded within it. Under what circumstances could there be more than one sub query?
- AIt is possible to embed a single-row subquery inside a multiple-row subquery, but not the other way around.
- BThe outer query can have multiple inner queries, but they must not be embedded within each other.
- CSubqueries can be embedded within each other with no practical limitations on depth.
- DThe outer query can include an inner query. It is not possible to have another query within the inner query.
13Choose the SQL statement that has no syntax error and is valid.
- ASELECT department_id, SUM(salary) sum_sal
FROM employees
WHERE department_id <> 50
AND sum_sal > 3000
GROUP BY department_id; - BSELECT department_id, SUM(salary) sum_sal
FROM employees
WHERE department_id <> 50
GROUP BY department_id
HAVING sum_sal > 3000; - CSELECT department_id, SUM(salary)
FROM employees
WHERE department_id <> 50
GROUP BY department_id
HAVING COUNT(*) > 30; - DSELECT department_id, SUM(salary)
FROM employees
WHERE department_id <> 50
AND SUM(salary) > 3000
GROUP BY department_id;
- ASELECT department_id, SUM(salary) sum_sal
14Several object types share the same namespace, and therefore cannot have the same name in the same schema.
Which of the following object types is not in the same namespace as the others?
(Choose the best answer.)- AIndex
- BView
- CSynonym
- DPL/SQL stored procedure
- ETable
15View the Exhibit and examine the structure and data in the INVOICE table. Which two SQL statements would execute successfully?
- ASELECT AVG(inv_date )
FROM invoice; - BSELECT MAX(inv_date), MIN(cust_id)
FROM invoice; - CSELECT MAX(AVG(SYSDATE – inv_date))
FROM invoice; - DSELECT AVG( inv_date – SYSDATE), AVG(inv_amt)
FROM invoice;
- ASELECT AVG(inv_date )
16Which statements are true?
- AA group function can be used only if the GROUP BY clause is present.
- BGroup functions along with nonaggregated columns can appear in the SELECT clause as long as a GROUP BY clause and a HAVING clause are present.
- CThe HAVING clause is optional when the GROUP BY clause is used.
- DThe HAVING clause and the GROUP BY clause are mutually exclusive; you can use only one clause in a SELECT statement.
17You are granted the CREATE VIEW privilege. What does this allow you to do?
- ACreate a table view.
- BCreate a view in any schema.
- CCreate a view in your schema.
- DCreate a sequence view in any schema.
- ECreate a view that is accessible by everyone.
- FCreate a view only of it is based on tables that you created.
18Column alias names cannot be used in which clause?
- ASELECT clause
- BWHERE clause
- CORDER BY clause
- DNone of the above
19Which of the following statements are syntactically correct?
(Choose all that apply.)- ASELECT JH.JOB_ID FROM JOB_HISTORY JH RIGHT OUTER JOIN JOBS J ON JH.JOB_ID=J.JOB_ID;
- BNone of the above
- CSELECT JOB_ID FROM JOB_HISTORY JH RIGHT OUTER JOIN JOBS J ON (JH.JOB_ID=J.JOB_ID);
- DSELECT JOB_HISTORY.JOB_ID FROM JOB_HISTORY OUTER JOIN JOBS ON JOB_HISTORY.JOB_ID=JOBS.JOB_ID;
Information
- Description
- Quiz on Oracle SQL, created by Brandon Gagon on 08/02/2019.
- Author
- Brandon Gagon
- Language
- English
- Views
- 5
- Rating
- No ratings yet Rate this quiz