Oracle Questions

Q:

Explain Not Null constraint.

Answer

Oracle NOT NULL is used on a column to ensure that the value for that column can never be NULL.
Example:
Below, the constraint is that the id should never be NULL. If it is, oracle throws an error.
create table employee ( id number NOT NULL, Name varchar(200) );

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 1697
Q:

What does cache and no cache options mean while creating a sequence?

Answer

The CACHE option means how many sequences will be stored in memory for access by the application objects. The performance is faster. However in case of the database is down the data is memory is lost for the sequence.


The NO CACHE option means values are not stored in memory. So there might be some performance issue. 

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 1683
Q:

Explain unique Constraint.

Answer

A unique constraint on a column uniquely identifies the record by a combination of one or more fields. Few unique constraint fields can have a NULL value as long as the combination of values is unique.


Example:
create table employee ( id number NOT NULL, dob DATE, professor_id NOT NULL, Name varchar(200) Constraint id_unique UNIQUE(id,dob) );

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 1681
Q:

What is a PL/SQL Record data type?

Answer

A record data type represents a data type for that row in a database table. It lets u define your own records and not your own fields.

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 1681
Q:

What are the basic SQL*Plus commands?

Answer

1) START- Used to run a SQL script.
2) ACCEPT- Accepts input from user.
3) GET- Gets the sql file from user to place in buffer.
4) LIST- Displays the last command executed.
5) RUN- Used to list and run the command in buffer
6) SHOW- Shows the environment settings. Example: SHOW PAGESIZE

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 1633
Q:

How to Add a new column to an existing table?

Answer

New column can be added using the ALTER TABLE command as shown below:
Example:
ALTER TABLE employee ADD DateOfBirth date

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 1607