Which statement is true regarding this command?

Evaluate the following SQL statement used to create the PRODUCTS table:
CREATE TABLE products
(product_id NUMBER(3) PRIMARY KEY,
product_desc VARCHAR2(25),
qty NUMBER(8,2),
rate NUMBER(10,2),
total_value AS ( qty * rate))
PARTITION BY RANGE (total_value)
(PARTITION p1 VALUES LESS THAN (100000),
PARTITION p2 VALUES LESS THAN (150000),
PARTITION p3 VALUES LESS THAN (MAXVALUE))
COMPRESS FOR ALL OPERATIONS;
Which statement is true regarding this command?

Evaluate the following SQL statement used to create the PRODUCTS table:
CREATE TABLE products
(product_id NUMBER(3) PRIMARY KEY,
product_desc VARCHAR2(25),
qty NUMBER(8,2),
rate NUMBER(10,2),
total_value AS ( qty * rate))
PARTITION BY RANGE (total_value)
(PARTITION p1 VALUES LESS THAN (100000),
PARTITION p2 VALUES LESS THAN (150000),
PARTITION p3 VALUES LESS THAN (MAXVALUE))
COMPRESS FOR ALL OPERATIONS;
Which statement is true regarding this command?

A.
It executes successfully but partition pruning cannot happen for this partition key.

B.
It produces an error because the TOTAL_VALUE column cannot be used as a partition key.

C.
It produces an error because compression cannot be used for the TOTAL_VALUE partition key.

D.
It executes successfully but the values in the TOTAL_VALUE column would not be physically
stored in the partitions.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


Helcio

Helcio

Virtual Column-Based Partitioning

Oracle 11g supports the concept of virtual columns on tables. These virtual columns are not physically stored in the table, but derived from data in the table. These virtual columns can be used in the partition key in all basic partitioning schemes. The example below creates a table that is list partitioned on a virtual column that represents the first letter in the username column of the table.

CREATE TABLE users (
id NUMBER,
username VARCHAR2(20),
first_letter VARCHAR2(1)
GENERATED ALWAYS AS
(
UPPER(SUBSTR(TRIM(username), 1, 1))
) VIRTUAL
)
PARTITION BY LIST (first_letter)
(
PARTITION part_a_g VALUES (‘A’,’B’,’C’,’D’,’E’,’F’,’G’),
PARTITION part_h_n VALUES (‘H’,’I’,’J’,’K’,’L’,’M’,’N’),
PARTITION part_o_u VALUES (‘O’,’P’,’Q’,’R’,’S’,’T’,’U’),
PARTITION part_v_z VALUES (‘V’,’W’,’X’,’Y’,’Z’)
);