1. What are the grouping function in SQL ?

2. If base table of a view deleted means, what will happen
while we querying on view ? will give any error ?

3. Difference between DROP, DELETE, TRUNCATE table ?

4. What is constraints and types ?

5. What is max size of nchar & nvarchar ?

6. Define ROLLBACK, COMMIT, SAVE POINT

7. How non-clustered better ? or rank the Clustered,
Non-Clustered and Table scan in performance wise

8. Select 10 rows from a table ?

9. Define DML, DDL, DCL, DTL commands ?

10. What is mean by NULL value ? NULL means "" or 0 or
undefined ?

11. Default constraints ?

12. Can we have more then primary Key in table ?

13. Type of integrity ? Entity, Referential, Domain ?

Answer Posted / srivas

What is the difference between DROP,DELETE,TRUNCATE table ?
Delete:It's an DML command which is used for deleting
particular table in the database...even though we delete the
data we can regain it by rollback command.

Example:SQL> SELECT COUNT(*) FROM emp;

COUNT(*)
----------
14

SQL> DELESQL> SELECT COUNT(*) FROM emp;

COUNT(*)
----------
14

SQL> DELETE FROM emp WHERE job = 'CLERK';

4 rows deleted.

SQL> COMMIT;

Commit complete.

Truncate:This command is a DDL Command which is used to
delete a table...I Just Conclude it as
Truncate=Delete+Commit...once u applied this on table u
can't get the data back...but the structure will be there..

Example:

SQL> TRUNCATE TABLE emp;

Table truncated.

SQL> SELECT COUNT(*) FROM emp;

COUNT(*)
----------
0

Drop:It is used to destroy entire structure of a
table...once we apply this command on any particular table
we can't get it in anyway...so be cautious while applying
this command.

Example:

SQL> DROP TABLE emp;

Table dropped.

SQL> SELECT * FROM emp;
SELECT * FROM emp
*
ERROR at line 1:
ORA-00942: table or view does not exist

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to update the views? If yes, how, if not, why?

537


explain different types of cursors? : Sql server database administration

559


Explain the difference between delete,drop and truncate in SQL Server?

588


Explain what are page splits? : SQL Server Architecture

650


What part does database design plays a role in performance of an sql server-based application?

511






I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?

593


What are data driven subscriptions?

79


what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration

505


How to use old values to define new values in update statements in ms sql server?

675


What are the components of sql server service broker?

507


What are the approximate numeric data types?

527


What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?

577


Can a database be shrunk with users active?

596


What are different type of Collation Sensitivity?

551


How to change a login name in ms sql server?

556