Set - 4

Question 11 :

What is difference between CHAR and VARCHAR2? What is the maximum SIZE allowed for each type?

Answer :

CHAR pads blank spaces to the maximum length.
VARCHAR2 does not pad blank spaces.
For CHAR the maximum length is 255 and 2000 for VARCHAR2.


Question 12 :

How many LONG columns are allowed in a table? Is it possible to use LONG columns in WHERE clause or ORDER BY?

Answer :

Only one LONG column is allowed. It is not possible to use LONG column in WHERE or ORDER BY clause.


Question 13 :

What are the pre-requisites to modify datatype of a column and to add a column with NOT NULL constraint?

Answer :

- To modify the datatype of a column the column must be empty.
- To add a column with NOT NULL constrain, the table must be empty.


Question 14 :

Where the integrity constraints are stored in data dictionary?

Answer :

The integrity constraints are stored in USER_CONSTRAINTS.


Question 15 :

How will you activate/deactivate integrity constraints?

Answer :

The integrity constraints can be enabled or disabled by ALTER TABLE ENABLE CONSTRAINT / DISABLE CONSTRAINT.