Friday, January 18, 2008

Sql Question and answer 2

1. What are different Oracle database objects

TABLES
VIEWS
INDEXES
SYNONYMS
SEQUENCES
TABLESPACES etc




2. What is difference between Rename and Alias

Rename is a permanent name given to a table or column whereas Alias is a temporary
name given to a table or column which do not exist once the SQL statement is
executed.

3. What is a view

A view is stored procedure based on one or more tables, it’s a virtual table.


What are various privileges that a user can grant to another user

SELECT
CONNECT
RESOURCES

4. What is difference between UNIQUE and PRIMARY KEY constraints

A table can have only one PRIMARY KEY whereas there can be any number of UNIQUE keys.
The columns that compose PK are automatically define NOT NULL, whereas a column that compose a UNIQUE is not automatically defined to be mandatory must also specify the column is NOT NULL.

5. Can a primary key contain more than one columns

Yes

6. How you will avoid duplicating records in a query

By using DISTINCT

1 comment:

mahakk01 said...

This post includes some frequently asked questions and answers on SQL. This post helped me in understanding the difference between alias and rename. I think this is a good way to practice. I am looking forward to see your next post.
sap erp system

Google