satish asnani


{ City } bhopal
< Country > india
* Profession * abc
User No # 48244
Total Questions Posted # 0
Total Answers Posted # 4

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 16
Users Marked my Answers as Wrong # 3
Questions / { satish asnani }
Questions Answers Category Views Company eMail




Answers / { satish asnani }

Question { Oracle, 15717 }

What is the difference between CHAR and VARCHAR2? If
VARCHAR2 serves the uses of CHAR why CHAR is still used and
not been discarded yet?


Answer

Technically CHAR has better performance than VARCHAR2.
For CHAR(10) database already knows the length of value in
each record and therefore displays the entire string up till
10 characters. In case of VARCHAR2 the end of string has to
be reached('\0'-NULL) before the database stops displaying
the characters ahead. Each character is compared to NULL
character before it can be determined that end of string has
arrived. Comparing each string character with NULL character
consumes some CPU cycles and hence VARCHAR2 is slower in
performance as compared to CHAR.

Is This Answer Correct ?    6 Yes 0 No

Question { Polaris, 12004 }

Talk about views


Answer

Answer from Santosh Kumar is correct with slight
improvement. The simple views are actually called Updateable
Views and Complex views are called Non-Updateable Views.
Updateable means we can perform DML operations(Insert,
Update & Delete) on such views. Non-Updateable means we
cannot perform DML operations.

Is This Answer Correct ?    5 Yes 1 No


Question { Polaris, 12004 }

Talk about views


Answer

Simple and complex views do not occupy HD space. The data
remains with the base table and views are just stored
queries which fetch data from base tables. But Materialized
Views maintain a copy of the records in their own space.
That is Materialized views as name suggests store a local
copy of the records from base tables and definitely occupy
HD space.

Is This Answer Correct ?    1 Yes 0 No

Question { 5999 }

how to sort records in sql?


Answer

For EMP table
order by deptno asc OR order by deptno desc

Normally records with NULL values are listed at last. We can
change this by using "NULLS FIRST" or "NULLS LAST" along
with order by clause.

Ex: order by deptno nulls first

Is This Answer Correct ?    4 Yes 2 No