Saturday, March 29, 2008

FAQ - Database Testing ( 01 to 10 )

1. What is the use of CASCADE CONSTRAINTS?

When this clause is used with the DROP command, a parent table can be dropped even when a child table exists.

2. What are the different categories of SQL statements?

DDL, DML, DCL, Session Control, System Control.

3. What are the wildcards used for pattern matching?

Underscore (_) for single character substitution & % for multi-character substitution.

4. Why does the following command give a compilation error?
DROP TABLE &TABLE_NAME;

Variable names should start with an alphabet. Here the table name starts with ‘&' symbol. Any table name must start with alphabet. Table names starting with special characters are considered to be invalid hence give error.

5. How can I hide a particular table name of our schema?

You can hide the table name by creating synonyms.(e.g.) You can create a synonym y for table xcreate synonym y for x;

6. What is the parameter substitution symbol used with INSERT INTO command?

&

7. What will be the output of the following query?

SELECT REPLACE (TRANSLATE (LTRIM (RTRIM ('!!ATHEN!!','!'),'!'),'AN','**'),'*','TROUBLE') FROM DUAL;

Ans: TROUBLETHETROUBLE.

8. Difference between VARCHAR and VARCHAR2?

Varchar means fixed length character data (size) i.e., min size-1 and max-2000.

Varchar2 means variable length character data i.e., min-1 to max-4000.
Varchar assigns total length to data. Suppose we have name [20], now with the case of if we entered NARINDER, totally 20 cells will be occupied. But in case of varchar2, 8 cells of memory coz there are 8 elements in that data.

9. What is the difference between DBMS and RDBMS?

1. RDBMS = DBMS + Referential Integrity2. An RDBMS is one that follows 12 rules of CODD.

10. When we give SELECT * FROM EMP; How does oracle respond?

When u give SELECT * FROM EMP; the server check all the data in the EMP file and it displays the data of the EMP file. When we give select * from emp it will shows the records of table emp if the table contain records. If it hasn't any records then it will shows no rows selected.

No comments: