You are on page 1of 3

Database testing questions

1. What do you mean by Normalization and What is the use of normalized


database?
Answer: Read definition of first normal form, second normal form, third normal
form, fourth normal form, fifth normal form,

2. Give me the complete syntax of Select command?


Answer:

SELECT [ DISTINCT | ALL ]


column_expression1, column_expression2, ....
[ FROM from_clause ]
[ WHERE where_expression ]
[ GROUP BY expression1, expression2, .... ]
[ HAVING having_expression ]
[ ORDER BY order_column_expr1, order_column_expr2, .... ]
column_expression ::= expression [ AS ] [ column_alias ]
from_clause ::= select_table1, select_table2, ...
from_clause ::= select_table1 LEFT [OUTER] JOIN select_table2 ON expr ...
from_clause ::= select_table1 RIGHT [OUTER] JOIN select_table2 ON expr ...
from_clause ::= select_table1 [INNER] JOIN select_table2 ...
select_table ::= table_name [ AS ] [ table_alias ]
select_table ::= ( sub_select_statement ) [ AS ] [ table_alias ]
order_column_expr ::= expression [ ASC | DESC ]

3. What is the basic difference between where and having clause?


Answer:

4. What are the outputs of the following operations: NULL*5 and NULL+5?
Answer:

5. Can you give me the command to create a new table on the basis of an existing
table?
Answer:

6. You have employee table with a ‘joining date’ field. Can you give me a query
which shows all the records which are sorted according to day wise; means all
‘Sunday’ records comes first then ‘Monday’ records and so on?
Answer:

7. What is the difference between ‘Left outer join’, ‘Right outer join’, ‘Full outer
join’ and ‘Self Join’? Explain them with example using emp & dept tables.
Answer:

8. Give a query through which top 5 records can fetched on the basis of ‘Sal’ field of
EMP table.
Answer: select top 5 * from emp order by emp.sal desc

9. Fetch the 5th highest sal record from the emp table.
Answer:

10. Suppose you have a table with 3 columns:

Write a query through which you show the sum of amount of quarters of each
year in the separate quarter columns.
Answer:

11. What do you mean by D/W house?


Answer:

12. What is difference between OLAP and OLTP?


Answer:

13. Explain ETL process?


Answer:

14. What do you mean by Star Schema?


Answer:

15. Can you explain me DTS process in SQL server?


Answer:

16. Can SQL Servers linked to other servers like Oracle?


Answer: SQL Server can be lined to any server provided it has OLE-DB provider
from Microsoft to allow a link. E.g. Oracle has a OLE-DB provider for oracle that
Microsoft provides to add it as linked server to SQL Server group.
What is OLTP(OnLine Transaction Processing)?
In OLTP - online transaction processing systems relational database design use the
discipline of data modeling and generally follow the Codd rules of data normalization in
order to ensure absolute data integrity. Using these rules complex information is broken
down into its most simple structures (a table) where all of the individual atomic level
elements relate to each other and satisfy the normalization rules.

What is DataWarehousing?

• Subject-oriented, meaning that the data in the database is organized so that all
the data elements relating to the same real-world event or object are linked
together;
• Time-variant, meaning that the changes to the data in the database are tracked
and recorded so that reports can be produced showing changes over time;
• Non-volatile, meaning that data in the database is never over-written or deleted,
once committed, the data is static, read-only, but retained for future reporting;
• Integrated, meaning that the database contains data from most or all of an
organization’s operational applications, and that this data is made consistent.

You might also like