Q1
True / FalseIn Oracle, the JSON_EXISTS function is used to check if a specified JSON path exists in a JSON document.
The JSON_EXISTS function checks if a specified JSON path exists within a JSON document, returning true if the path is found.
Q2
True / FalseIn Oracle, you can use the SELECT statement to query JSON data stored in a column.
You can use the SELECT statement to retrieve JSON data stored in a column in Oracle.
Q3
True / FalseThe JSON_QUERY function in Oracle extracts an array or object from a JSON document and returns it as a VARCHAR2 value.
The JSON_QUERY function extracts a JSON array or object and returns it as a VARCHAR2 value.
Q4
True / FalseIn Oracle, the JSON_VALUE function extracts a scalar value from a JSON document and returns it as a SQL data type.
The JSON_VALUE function extracts a scalar value (such as a string, number, or boolean) from a JSON document and returns it as a SQL data type.
Q5
True / FalseThe JSON_TABLE function in Oracle creates a relational view of JSON data, allowing it to be queried like a regular table.
The JSON_TABLE function creates a relational view of JSON data, allowing it to be queried using standard SQL operations.
Q6
True / FalseIn Oracle, the IS JSON condition can be used to check if a column contains valid JSON data.
The IS JSON condition checks whether a column contains valid JSON data.
Q7
True / FalseThe JSON_OBJECT function in Oracle creates a JSON object from the specified key-value pairs and returns it as a VARCHAR2 value.
The JSON_OBJECT function creates a JSON object from the provided key-value pairs and returns it as a VARCHAR2 value.
Q8
True / FalseIn Oracle, you can use the JSON_TABLE function to generate multiple columns from a single JSON document.
The JSON_TABLE function can be used to generate multiple columns, each representing different parts of the JSON document.
Q9
True / FalseIn Oracle, the JSON_MERGEPATCH function is used to apply a JSON Patch to a JSON document, modifying its content.
The JSON_MERGEPATCH function applies a merge patch to a JSON document, not a JSON Patch. JSON Patch and JSON Merge Patch are different specifications for modifying JSON documents.
Q10
True / FalseThe Oracle Certified Professional (OCP) exam includes knowledge on using JSON functions like JSON_QUERY, JSON_TABLE, and JSON_VALUE effectively, understanding their syntax, and optimizing their performance in SQL queries.
The OCP certification covers advanced topics, including the effective use of JSON functions, understanding their syntax, and optimizing their performance in SQL queries involving JSON data.
Q21
Multiple ChoiceWhich SQL code snippet correctly uses JSON_TABLE to extract a JSON object from a column in Oracle?
SQL Code
SELECT id, jt.name
FROM orders,
JSON_TABLE(order_details, '$.customer'
COLUMNS (name VARCHAR2(100) PATH '$.name')) jt;
SELECT id, jt.name
FROM orders,
JSON_TABLE(order_details, '$.customer'
COLUMNS (name VARCHAR2(100) PATH '$.name')) jt
WHERE jt.name IS NOT NULL;
SELECT id, jt.name
FROM orders,
JSON_TABLE(order_details, '$.customer'
COLUMNS (name VARCHAR2(100) PATH '$.name')) jt
WHERE jt.name = 'John Doe';
Options A, B, and C correctly use JSON_TABLE to extract a JSON object from the 'order_details' column. Option D is incorrect because it does not use JSON_TABLE correctly.
Q22
Multiple ChoiceWhich SQL code snippet demonstrates how to use JSON_VALUE to extract a value from a JSON column in Oracle?
SQL Code
SELECT id, JSON_VALUE(order_details, '$.customer.name') AS customer_name
FROM orders;
SELECT id, JSON_VALUE(order_details, '$.customer.address.city') AS city
FROM orders;
SELECT id, JSON_VALUE(order_details, '$.order_total') AS order_total
FROM orders;
Options A, B, and C correctly use JSON_VALUE to extract values from JSON columns in Oracle. Option D is incorrect because it uses a different method for extracting JSON values.
Q24
Multiple ChoiceWhich SQL code snippet demonstrates advanced use of JSON_TABLE to flatten a nested JSON array into a relational format in Oracle?
SQL Code
SELECT id, jt.product_name, jt.quantity
FROM orders,
JSON_TABLE(order_details, '$.items[*]'
COLUMNS (product_name VARCHAR2(50) PATH '$.product_name',
quantity NUMBER PATH '$.quantity')) jt;
SELECT id, jt.product_name, jt.quantity
FROM orders,
JSON_TABLE(order_details, '$.items[*]'
COLUMNS (product_name VARCHAR2(50) PATH '$.product_name',
quantity NUMBER PATH '$.quantity')) jt
WHERE jt.quantity > 1;
SELECT id, jt.product_name, jt.quantity
FROM orders,
JSON_TABLE(order_details, '$.items[*]'
COLUMNS (product_name VARCHAR2(50) PATH '$.product_name',
quantity NUMBER PATH '$.quantity')) jt
ORDER BY jt.product_name;
Options A, B, and C correctly demonstrate advanced use of JSON_TABLE to flatten a nested JSON array into a relational format. Option D is incorrect because it does not correctly use JSON_TABLE.
Q25
Multiple ChoiceWhich SQL code snippet demonstrates how to use JSON_QUERY to return a JSON fragment from a column in Oracle?
SQL Code
SELECT id, JSON_QUERY(order_details, '$.customer') AS customer_info
FROM orders;
SELECT id, JSON_QUERY(order_details, '$.items[0]') AS first_item
FROM orders;
SELECT id, JSON_QUERY(order_details, '$.shipping') AS shipping_info
FROM orders;
Options A, B, and C correctly use JSON_QUERY to return a JSON fragment from a column in Oracle. Option D is incorrect because it uses a different method to return JSON data.
Q26
Multiple ChoiceWhich SQL code snippet demonstrates advanced use of JSON_VALUE to extract nested values from a JSON column in Oracle?
SQL Code
SELECT id, JSON_VALUE(order_details, '$.customer.address.city') AS city
FROM orders;
SELECT id, JSON_VALUE(order_details, '$.items[0].product_name') AS first_product_name
FROM orders;
SELECT id, JSON_VALUE(order_details, '$.shipping.method') AS shipping_method
FROM orders;
Options A, B, and C correctly demonstrate advanced use of JSON_VALUE to extract nested values from a JSON column. Option D is incorrect because it does not correctly use JSON_VALUE.
Q27
Multiple ChoiceWhich SQL code snippet demonstrates certification-level use of JSON_TABLE to parse a complex JSON array in Oracle?
SQL Code
SELECT id, jt.product_name, jt.price
FROM orders,
JSON_TABLE(order_details, '$.items[*]'
COLUMNS (product_name VARCHAR2(50) PATH '$.product_name',
price NUMBER PATH '$.price')) jt;
SELECT id, jt.product_name, jt.price
FROM orders,
JSON_TABLE(order_details, '$.items[*]'
COLUMNS (product_name VARCHAR2(50) PATH '$.product_name',
price NUMBER PATH '$.price')) jt
WHERE jt.price > 20;
SELECT id, jt.product_name, jt.price
FROM orders,
JSON_TABLE(order_details, '$.items[*]'
COLUMNS (product_name VARCHAR2(50) PATH '$.product_name',
price NUMBER PATH '$.price')) jt
ORDER BY jt.price DESC;
Options A, B, and C correctly demonstrate certification-level use of JSON_TABLE to parse a complex JSON array in Oracle. Option D is incorrect because it does not correctly use JSON_TABLE.
Q29
Multiple ChoiceWhich SQL code snippet demonstrates advanced use of JSON_QUERY to return a nested JSON object from a column in Oracle?
SQL Code
SELECT id, JSON_QUERY(order_details, '$.shipping') AS shipping_info
FROM orders;
SELECT id, JSON_QUERY(order_details, '$.customer') AS customer_info
FROM orders;
SELECT id, JSON_QUERY(order_details, '$.items') AS items_info
FROM orders;
Options A, B, and C correctly demonstrate advanced use of JSON_QUERY to return a nested JSON object from a column in Oracle. Option D is incorrect because it does not correctly use JSON_QUERY.
Q30
Multiple ChoiceWhich SQL code snippet demonstrates certification-level use of JSON_VALUE to extract multiple values from a JSON column in Oracle?
SQL Code
SELECT id, JSON_VALUE(order_details, '$.customer.name') AS customer_name,
JSON_VALUE(order_details, '$.shipping.method') AS shipping_method
FROM orders;
SELECT id, JSON_VALUE(order_details, '$.customer.name') AS customer_name,
JSON_VALUE(order_details, '$.items[0].product_name') AS first_product_name
FROM orders;
SELECT id, JSON_VALUE(order_details, '$.customer.address.city') AS city,
JSON_VALUE(order_details, '$.order_total') AS total_amount
FROM orders;
Options A, B, and C correctly demonstrate certification-level use of JSON_VALUE to extract multiple values from a JSON column in Oracle. Option D is incorrect because it does not correctly use JSON_VALUE.