Free Oracle Database SQL Practice Questions
100 free questions · Answer explanations · No signup required
View examination details, outline and sourcesLoading selected examination banks…
Sample Practice Questions
Try these 10 sample questions from the Oracle Database SQL practice bank. Each includes the answer and explanation. Continue with the interactive practice above to review the full question set.
1In the relational model, how does a table represent a relation?
- A.Rows represent tuples; columns represent attributes.Correct answer: A
- B.Rows represent attributes; columns represent tuples.
- C.Both rows and columns represent attributes.
- D.Both rows and columns represent tuples.
2Without parentheses, what is the result of the Oracle SQL expression 5 + 2 * 4?
3What does SUBSTR('DATABASE', -3) return in Oracle SQL?
- A.DAT
- B.BAS
- C.ASECorrect answer: C
- D.ABA
4Which clause restricts groups to those whose aggregate total meets a specified condition?
- A.WHERE
- B.HAVINGCorrect answer: B
- C.ORDER BY
- D.FROM
Explanation: Oracle states: "You use aggregate functions in the HAVING clause to eliminate groups from the output based on the results of the aggregate functions, rather than on the values of the individual rows of the queried table or view." HAVING filters the grouped results.
5In a SELECT expression, what value does a scalar subquery contribute when it returns no rows?
- A.0
- B.NULLCorrect answer: B
- C.An empty result set in place of the scalar
- D.An error because a row is required
Explanation: Oracle states: "If the subquery returns 0 rows, then the value of the scalar subquery expression is NULL. If the subquery returns more than one row, then Oracle returns an error." An empty scalar subquery evaluates to NULL.
Reference: Scalar Subquery Expressions — Scalar Subquery Expressions
6What must match between the select lists of component queries in an Oracle compound query?
- A.The expression counts and corresponding data type groups must match.Correct answer: A
- B.The expression counts must match but data type groups may differ.
- C.The data type groups must match but expression counts may differ.
- D.Neither expression counts nor data type groups need to match.
Explanation: Oracle states: "The corresponding expressions in the select lists of the component queries of a compound query must match in number and must be in the same data type group (such as numeric or character)." Corresponding expressions must satisfy both requirements.
7What happens to the indexed table's stored data when an independent index is dropped?
- A.The table data remains physically unaffected.Correct answer: A
- B.All indexed table rows are deleted.
- C.The indexed columns are dropped from the table.
- D.The table data is moved into a new index.
Explanation: Oracle states: "Indexes are schema objects that are logically and physically independent of the data in the objects with which they are associated. Thus, you can drop or create an index without physically affecting the indexed table." Dropping the index does not physically affect the indexed table.
Reference: Indexes and Index-Organized Tables — Introduction to Indexes
8For a view created WITH READ ONLY, how are UPDATE statements through that view treated?
- A.UPDATE through the view is prohibited.Correct answer: A
- B.UPDATE is permitted if the changed row satisfies the view query.
- C.UPDATE is permitted without checking changed rows against the view query.
- D.UPDATE is permitted if the base table has a primary key.
9Which is an example of an Oracle system privilege?
- A.CREATE TABLECorrect answer: A
- B.SELECT on a specific table
- C.UPDATE on a specific table
- D.DELETE on a specific table
Explanation: Oracle states: "For example, to create a table, the user must have the CREATE TABLE or CREATE ANY TABLE system privilege." CREATE TABLE is a system privilege; table-specific SELECT, UPDATE and DELETE grants are object privileges.
Reference: Configuring Privilege and Role Authorization — 4.10.1.9 How Roles Aid or Restrict DDL Usage
10Which time zone determines the value returned by CURRENT_DATE?
- A.The session time zoneCorrect answer: A
- B.The database time zone regardless of session settings
- C.The database server operating-system time zone regardless of session settings
- D.UTC regardless of session settings
Topics in this practice bank
These topics describe the available practice for Oracle Database SQL. Review the examination outline and its sources for scope and allocation details.
Relational Database concepts
- Explaining the theoretical and physical aspects of a relational database
- Relating clauses in SQL Select Statement to Components of an ERD
- Explaining the relationship between a database and SQL
Retrieving Data using the SQL SELECT Statement
- Using Column aliases
- Using The SQL SELECT statement
- Using concatenation operator, literal character strings, alternative quote operator, and the DISTINCT keyword
- Using Arithmetic expressions and NULL values in the SELECT statement
Restricting and Sorting Data
- Applying Rules of precedence for operators in an expression
- Limiting Rows Returned in a SQL Statement
- Using Substitution Variables
- Using the DEFINE and VERIFY commands
- Sorting Data
Using Single-Row Functions to Customize Output
- Manipulating strings with character functions in SQL SELECT and WHERE clauses
- Performing arithmetic with date data
- Manipulating numbers with the ROUND, TRUNC and MOD functions
- Manipulating dates with the date function
Using Conversion Functions and Conditional Expressions
- Applying the NVL, NULLIF, and COALESCE functions to data
- Understanding implicit and explicit data type conversion
- Using the TO_CHAR, TO_NUMBER, and TO_DATE conversion functions
- Nesting multiple functions
Reporting Aggregated Data Using Group Functions
- Restricting Group Results
- Creating Groups of Data
- Using Group Functions
Displaying Data from Multiple Tables
- Using Self-joins
- Using Various Types of Joins
- Using Non equijoins
- Using OUTER joins
- Understanding and Using Cartesian Products
Using Subqueries to Solve Queries
- Using Single Row Subqueries
- Using Multiple Row Subqueries
- Update and delete rows using correlated subqueries
Using SET Operators
- Matching the SELECT statements
- Using the ORDER BY clause in set operations
- Using The INTERSECT operator
- Using The MINUS operator
- Using The UNION and UNION ALL operators
Managing Tables using DML statements
- Managing Database Transactions
- Controlling transactions
- Perform Insert, Update and Delete operations
- Performing multi table Inserts
- Performing Merge statements
Managing Indexes Synonyms and Sequences
- Managing Indexes
- Managing Synonyms
- Managing Sequences
Use DDL to manage tables and their relationships
- Describing and Working with Tables
- Describing and Working with Columns and Data Types
- Creating tables
- Dropping columns and setting column UNUSED
- Truncating tables
- Creating and using Temporary Tables
- Creating and using external tables
- Managing Constraints
- Managing Views
Controlling User Access
- Differentiating system privileges from object privileges
- Granting privileges on tables
- Distinguishing between granting privileges and roles
Managing Objects with Data Dictionary Views
- Using data dictionary views
Managing Data in Different Time Zones
- Working with CURRENT_DATE, CURRENT_TIMESTAMP,and LOCALTIMESTAMP
- Working with INTERVAL data types
How to use these free practice questions
Choose an answer, check the explanation, and review your progress by chapter. Practice questions and explanations are free to access without signing up.
These are independent study questions, not actual examination items. For examination requirements and official information, view Oracle Database SQL details.