Examine the description of the PRODUCTS table which contains data:
Which two are true? (Choose two.)
Examine the description of the PRODUCTS table which contains data:
Which two are true? (Choose two.)
The EXPIRY_DATE column data type can be changed to TIMESTAMP because though it needs to be empty to change the data type, this is still a valid operation when the table is designed or emptied. The PROD_ID column can be renamed, as renaming columns does not depend on existing data and can be performed without restriction.
in case of empty table correct will be C,E,D. But in case of existing data in the table correct will be C,D. Impossible to change datatype. System raise an error: "ORA-01439: column to be modified must be empty to change datatype"
ORA-01439: column to be modified must be empty to change datatype D is ok cos the same group of datatype
100% C AND D HAVE A TRY: CREATE TABLE PRODUCTS_156 ( PROD_ID NUMBER(2) NOT NULL, PROD_NAME VARCHAR2(20), EXPIRY_DATE DATE ); INSERT INTO PRODUCTS_156 VALUES (1, 'Product 1', TO_DATE('2023-12-31', 'YYYY-MM-DD')); ALTER TABLE PRODUCTS_156 MODIFY EXPIRY_DATE TIMESTAMP; alter table products_156 rename column prod_id to product_id; alter table products_156 modify product_id varchar(2); (CHANGE DATA TYPE NOT ALLOWED WITH EXISTING DATA IN THE TABLE).
All are true for empty table CREATE TABLE K (ID NUMBER(2) NOT NULL,NAME VARCHAR2(20),EXPIRY_dATE DATE NOT NULL) ALTER TABLE K MODIFY NAME DEFAULT 'TEST' ALTER TABLE K MODIFY EXPIRY_dATE TIMESTAMP ALTER TABLE K RENAME COLUMN ID TO PROD_ID ALTER TABLE K MODIFY PROD_ID VARCHAR2(2)
CD is correct in that case
C works well when i run sql statement.
drop table products_156; CREATE TABLE PRODUCTS_156 (PROD_ID NUMBER(2) NOT NULL, PROD_NAME VARCHAR2(20), EXPIRY_DATE DATE); ALTER TABLE PRODUCTS_156 MODIFY EXPIRY_DATE TIMESTAMP; /*C OK*/ alter table products_156 modify prod_id varchar(2); /*E OK*/ alter table products_156 rename column prod_id to product_id; /*D OK*/ desc products_156; Nombre ¿Nulo? Tipo ----------- -------- ------------ PRODUCT_ID NOT NULL VARCHAR2(2) PROD_NAME VARCHAR2(20) EXPIRY_DATE TIMESTAMP(6)