Examine the following command:
CREATE TABLE (prod_id number(4),
Prod_name varchar2 (20),
Category_id number(30),
Quantity_on_hand number (3) INVISIBLE);
Which three statements are true about using an invisible column in the PRODUCTS table?
A.
The %ROWTYPE attribute declarations in PL/SQL to access a row will not display the invisible
column in the output.
B.
The DESCRIBE commands in SQL *Plus will not display the invisible column in the output.
C.
Referential integrity constraint cannot be set on the invisible column.
D.
The invisible column cannot be made visible and can only be marked as unused.
E.
A primary key constraint can be added on the invisible column.
Explanation:
AB: You can make individual table columns invisible. Any generic access of a table
does not show the invisible columns in the table. For example, the following operations do not
display invisible columns in the output:
* SELECT * FROM statements in SQL
* DESCRIBE commands in SQL*Plus
* %ROWTYPE attribute declarations in PL/SQL
* Describes in Oracle Call Interface (OCI)
Incorrect:
Not D:You can make invisible columns visible.
You can make a column invisible during table creation or when you add a column to a table, and
you can later alter the table to make the same column visible.
Reference: Understand Invisible Columns
Answer: ABE
Agree ABE is the right answer. You can try the following
CREATE TABLE test (prod_id number(4),
Prod_name varchar2 (20),
Category_id number(30),
Quantity_on_hand number (3) INVISIBLE);
ALTER TABLE TEST ADD PRIMARY KEY (Quantity_on_hand);
Yes, that is correct – you can create Primary key on invisible column so also it can be refrenced into the child table.
Thanks,
ABE
A B and E
ABE
A – OK
%ROWTYPE Attribute and Invisible Columns
Suppose that you use the %ROWTYPE attribute to define a record variable that represents a row of a table that has an invisible column, and then you make the invisible column visible.
B – OK
If I were to describe this table in SQL*Plus or many other tools, I would see the table without this new column:
SQL> desc t
Name Null? Type
————— ———————— ——————————
X NUMBER(38)
Y NUMBER(38)
ABE
ABE
Tested
ABC and E are correct
Created primary key and foreign key constraints (Referential integrity constraint ) on the invisible column without any problem
Sorry C is wrong, created foreign key constraints (Referential integrity constraint ) on the invisible column without any problem
A,B,C are correct
C is correct
tested.
Sorry is not correct, I created PK invisible, FK visible and made a constraint, wich means C is in correct
A, B
http://www.oracle.com/technetwork/articles/database/invisible-columns-odb12c-2331522.html
For B, it depends on the COLINVISBLE setting:
1 CREATE TABLE products (prod_id number(4),
2 Prod_name varchar2 (20),
3 Category_id number(30),
4* Quantity_on_hand number (3) INVISIBLE)
SQL> /
Tabel is aangemaakt.
SQL> set colinvisible ON
SQL> desc products
Naam Null? Type
—————————————————————————————————————– ——– —————————————————————————-
PROD_ID NUMBER(4)
PROD_NAME VARCHAR2(20 CHAR)
CATEGORY_ID NUMBER(30)
QUANTITY_ON_HAND (INVISIBLE) NUMBER(3)
SQL>