Skip to main content

Posts

Showing posts from February, 2010

Database Knowledge for a Tester Part V

Hi Readers, this is the last series of DataBase Knowledge for a Tester. I hope you people must enjoyed the reading and gained database knowledge. Soon I will come with some more stuffs on Technology Knowledge for Tester. 1. GROUPING DATA FROM TABLES IN SQL Apart from SELECT, WHERE, DISTINCT, ORDER BY etc, there are 2 more clauses which facilitate selective retrieval of row. These are the GROUP BY and HAVING clauses. These are same as ORDER BY and WHERE clauses, except that they act on recordsets, and not on individual records. 1.1 CONCEPT OF GROUPING 1.1.1 Group By clause The GROUP BY clause creates a data set, containing several sets of records grouped together based on a condition. Syntax: SELECT (colname1),(colname2),(colnameN), AGGREGATE_FUNCTION(expression) from TABLE NAME where (condition) GROUP BY (colname1),(colname2),(colnameN); For e.g. Consider we want to find out how many employees are there in each department. Select DEPT_NAME, COUNT(EMP_NO)”No. of Employ