This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: returns the average of the Salary Feld in a relation Employee(ID, Name, Salary, Dept) . COUNT. COUNT has more interesting syntax. The two traditional forms of the COUNT() operator are COUNT(*) COUNT([DISTINCT] <ColumnName>) 1 COUNT(*) form counts the number of tuples returned by the rest of the query. SELECT COUNT(*) FROM Employee; returns the number of employee records. Similar result can be achieved by replacing * with an column name: SELECT COUNT(Name) FROM Employee; returns the same result as the previous query. DISTINCT qualiFer allows us to count only unique values found in the column: SELECT COUNT(DISTINCT Salary) FROM Employee; returns the number of di±erent salary levels recorded in the Employee table. 2...
View Full Document
- Spring '08
- Databases, Relational model, Database management system, Query language, Aggregate Operation COUNT