Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free Oracle MySQL 8.0 Database Developer 1Z0-909 Exam Questions

Last updated: · 11 practice questions with answers and explanations

Page: 1 / 7 Total 65 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Connectors and APIs

Skill tested: Select and configure a MySQL connector for secure application access.

A payment service written in Java must access MySQL 8.0 using JDBC. The service runs on multiple hosts, and database credentials must not be embedded in the application package. The database requires TLS, and the application must bind customer-supplied values rather than concatenate them into SQL. The team wants a supported driver that can be configured through standard JDBC properties and used with prepared statements. Which implementation best meets these requirements?

Correct Answer: B. Use MySQL Connector/J, load credentials from a protected runtime configuration source, configure TLS connection properties, and bind values through PreparedStatement.
Explanation:

MySQL Connector/J is the JDBC driver intended for Java applications. JDBC connection properties can configure TLS, while a PreparedStatement binds user-supplied values separately from SQL syntax and reduces injection risk. Loading credentials from a protected runtime source avoids packaging secrets with the application. Connector/ODBC is not the natural Java JDBC interface, and source-controlled passwords remain exposed. MySQL Shell is an interactive and scripting client, not a JDBC driver. Direct socket access through Connector/C is not a suitable substitute for the supported Java connector or a secure JDBC connection.

Question 2

New Multiple answers

Topic: Data-driven Applications

Skill tested: Use prepared statements and SQL modes to enforce safe, strict data handling.

An order-ingestion application accepts quantities and descriptions from external clients. Its current code constructs SQL by concatenating values, and invalid or truncated data has sometimes been accepted because the session uses permissive settings. The application must prevent values from changing SQL structure and must reject out-of-range or invalid data rather than silently coerce it. It must also preserve useful diagnostics when a statement fails. Which TWO changes best satisfy these requirements? Select TWO.

Correct Answer: B. Prepare statements with placeholders and bind each client-supplied value using the appropriate parameter type.; E. Enable an appropriate strict SQL mode for the application session and handle statement errors returned by the connector.
Explanation:

Prepared statements keep parameter data separate from SQL syntax, addressing the injection and quoting hazards in the existing concatenation approach. A strict SQL mode makes invalid or out-of-range values fail instead of being silently adjusted in applicable cases; the application should then inspect connector-reported errors and handle failures deliberately. Disabling diagnostics conceals data-quality problems. Manual quoting is error-prone and does not provide the same separation as parameter binding. An empty global SQL mode moves behavior in the opposite direction and can affect unrelated sessions.

Question 3

New Single answer

Topic: MySQL Schema Objects and Data

Skill tested: Choose temporal types and expressions for time-zone-safe event storage.

A ticketing platform accepts event timestamps from users in several regions and must retain the precise instant for later ordering and elapsed-time calculations. The application also needs to display each event in the user's current time zone. The MySQL sessions may connect from hosts configured with different local time zones, and the original textual input format is not a business requirement. Which storage and retrieval approach is most appropriate?

Correct Answer: D. Store the instant in a TIMESTAMP column, use an explicit and controlled session time zone for database operations, and convert for display in the user's time zone.
Explanation:

TIMESTAMP represents an instant and is converted between the session time zone and UTC for storage and retrieval. Controlling the session time zone avoids behavior varying with each host's local setting; application-layer conversion can then render the instant for the user's zone. VARCHAR makes ordering and arithmetic dependent on formatting and conversion. DATE discards time-of-day. DATETIME does not perform time-zone conversion, so treating an uncontrolled, zone-free value as UTC relies on an assumption the database cannot enforce.

Question 4

New Single answer

Topic: Transactions

Skill tested: Apply transaction isolation and locking to prevent concurrent inventory overselling.

An online store has a row containing each product's available quantity. Two checkout transactions can read the same positive quantity at nearly the same time, then both decrement it, causing overselling. The team needs a short, atomic operation that prevents a second transaction from acting on a stale quantity while minimizing the need for application-side retries. Which approach is most appropriate?

Correct Answer: C. Begin a transaction, select the product row with FOR UPDATE, validate the quantity, decrement it, and commit.
Explanation:

A locking read using SELECT ... FOR UPDATE inside a transaction acquires an exclusive lock on the selected row, serializing competing checkouts that need to modify that inventory. The application validates and updates while holding the lock, then commits promptly. An autocommit read followed by a separate update leaves a race window. A plain consistent read does not lock the row for this purpose, and committing before the decrement makes the stale-read problem worse. READ UNCOMMITTED permits dirty reads and does not provide the needed protection.

Question 5

New Single answer

Topic: Query Optimization

Skill tested: Design composite indexes around filtering, ordering, and covering requirements.

A workload frequently runs `SELECT order_id, created_at, total FROM orders WHERE customer_id = ? AND status = ? ORDER BY created_at DESC LIMIT 20`. The table is InnoDB, and existing indexes are single-column indexes on `customer_id` and `status`. Profiling shows many rows examined and a filesort for this query. Writes are frequent, so the team wants one targeted index rather than several overlapping indexes. Which index design is the best first candidate?

Correct Answer: D. Create an index on `(customer_id, status, created_at)`.
Explanation:

The composite index begins with both equality predicates and places created_at after them, allowing MySQL to locate the customer's matching status range and scan it in timestamp order. InnoDB secondary-index entries include the primary-key value, so order_id can often be obtained from the index when it is the primary key; whether the remaining selected columns are covered depends on the table's key and index design. A leading created_at column does not efficiently narrow by both equality conditions. Separate indexes do not generally provide the same ordered access path, and uniqueness would impose an unrelated constraint.

Question 6

New Single answer

Topic: MySQL Stored Programs

Skill tested: Use triggers to enforce row-level audit behavior during data changes.

A compliance team requires every successful update to an account's risk rating to create an audit row containing the account identifier, old rating, new rating, and change time. Updates can originate from several applications and from administrative SQL sessions, so application-only logging is insufficient. The audit insert must be atomic with the update, and failed updates must not leave audit records. Which implementation best meets the requirement?

Correct Answer: C. Add an AFTER UPDATE trigger on the account table that inserts the old and new values into the audit table within the same transactional engine.
Explanation:

An AFTER UPDATE trigger can access the prior row through OLD and the resulting row through NEW, then insert the audit entry as part of the same statement and transaction. With transactional tables, failure of the update or trigger work rolls back the associated changes. A periodic event cannot reliably capture every intermediate change, and application-only logging misses administrative updates. Separately committed application statements can leave mismatched audit and account state. A BEFORE trigger runs before the update is known to have completed and is not the best point for recording a successful change.

Question 7

New Multiple answers

Topic: JSON and Document Store

Skill tested: Query JSON documents with MySQL JSON functions and indexes on extracted values.

A product catalog stores flexible attributes in a JSON column named `details`, while `category` remains a conventional relational column. A high-volume endpoint filters for rows where `details.color` equals a supplied color and returns matching products. The team wants to keep the JSON representation but avoid repeatedly evaluating an unindexed extraction across the full catalog. The color value is a string, and schema changes to add a separate relational color column are not currently approved. Which TWO changes are suitable? Select TWO.

Correct Answer: C. Create an indexed generated column that extracts `$.color` from details as a character value, then filter on that generated column.; E. Create an appropriate functional index on the JSON path expression and write the predicate using a matching expression and type.
Explanation:

A generated column can extract a scalar JSON value into an indexable SQL type, and a functional index can index a JSON extraction expression when the query expression and type align with the index definition. Either approach can support selective lookup without abandoning the document column; choose one that fits the schema and expression behavior. MySQL does not create a general index over every arbitrary JSON path merely by indexing the JSON column. A BLOB plus full-text search is not a suitable typed equality lookup, and JSON_SEARCH does not automatically gain a general path index.

Question 8

New Single answer

Topic: Connectors and APIs

Skill tested: Retrieve result sets safely through connector APIs and handle nullable values.

A reporting service uses a MySQL connector to execute a parameterized SELECT. One selected column is nullable, and the service must distinguish SQL NULL from a numeric zero; it also must process every row without depending on a vendor-specific cursor feature. Which result-handling approach is the most portable and reliable?

Correct Answer: C. Iterate the connector's result set using its documented row-fetching API and check the column's null indicator or null predicate before interpreting its value.
Explanation:

Connector result-set APIs provide a row-by-row retrieval mechanism and a way to determine whether a column is SQL NULL. Checking nullness before using the typed value preserves the distinction between NULL and valid values such as zero. Treating zero as NULL corrupts legitimate data. A SELECT can return many rows, so processing only the first loses results. Converting values to strings and treating empty text as NULL conflates different values and makes interpretation dependent on formatting.

Question 9

New Single answer

Topic: Data-driven Applications

Skill tested: Build summary reports with grouping sets and interpret aggregate subtotal rows.

A finance team needs a single report that returns sales totals by region and product category, a subtotal for each region, and a grand total. The report must be generated from one query so all rows reflect the same statement execution. The application also needs to distinguish subtotal rows from ordinary rows when a grouping column is genuinely NULL in source data. Which approach is best?

Correct Answer: B. Use `GROUP BY region, category WITH ROLLUP` and use `GROUPING()` on the relevant columns to identify generated subtotal values.
Explanation:

WITH ROLLUP produces detail groups, hierarchical subtotals, and the grand-total row in one statement. GROUPING() identifies NULL values introduced by rollup, distinguishing them from genuine NULL values in the underlying data. Separate queries can observe different committed states and require additional reconciliation; labeling every NULL as a subtotal misclassifies real data. A plain GROUP BY omits the requested subtotals, while replacing source NULLs changes the data's meaning and can create collisions with legitimate category values.

Question 10

New Single answer

Topic: MySQL Schema Objects and Data

Skill tested: Create a view with appropriate security context and updatability constraints.

A support team should see customer identifiers and current service tiers but must not see email addresses. The team needs to update the service tier through a database view, and the view must not grant access to unrelated base-table columns. All users who access it have an application role with the required base-table privileges. Which view design is most appropriate?

Correct Answer: A. Create a simple view selecting only customer_id and service_tier from the customer table, then grant the support role access to that view.
Explanation:

A simple view that selects only the required columns limits the view's exposed data and, when based on a single table without constructs that prevent updates, can remain updatable for service_tier. Granting access to the view provides a narrower interface than granting access to the full table. Client-side hiding does not enforce database access control. A join and aggregation generally complicate or prevent view updates. SQL SECURITY DEFINER controls whose privileges are used to evaluate access; it does not automatically conceal columns selected by the view.

Question 11

New Single answer

Topic: Transactions

Skill tested: Select an isolation level that prevents nonrepeatable reads while preserving concurrency.

A billing transaction reads an account balance, performs several calculations, and reads that same row again before committing. The business rule requires both reads to return the same committed row version even if another transaction updates the balance meanwhile. The application does not require a range scan to be protected from newly inserted matching rows, and it should avoid stronger isolation than necessary. Which isolation level should the application use?

Correct Answer: B. REPEATABLE READ
Explanation:

REPEATABLE READ provides a consistent snapshot for ordinary consistent reads within a transaction, so repeated reads of the same row do not see a concurrent committed update after the snapshot is established. READ COMMITTED can expose a newer committed version on a later read, allowing a nonrepeatable read. READ UNCOMMITTED is weaker still. SERIALIZABLE adds stronger restrictions, particularly around read locking and concurrent operations, than this scenario requires because phantom prevention for range scans is explicitly unnecessary.