SH1680
Basic Data Operations in SQL
I. Summarizing Data
A. What is aggregation?
a common programming term associated with the various methods in summarizing
data
means to “combine into groups”
allows data to be manipulated into something that is not merely displayed
transforms data into “real” information: the pattern or context that is used as
requirement in order to transform data into something relevant
II. Eliminating Duplicates
considered the most basic way of summarizing data
done in order to prevent redundancy of data entries in query tables/results
uses the DISTINCT keyword to remove duplicate rows from a query output,
placed immediately after the SELECT keyword
III. Aggregate Functions
A. Aggregate Function Keywords
The SUM keyword will add values of a specified column.
The AVG keyword will find the average of all given values in a specified column.
The MIN keyword finds and returns the lowest value in a column.
The MAX keyword finds and returns the highest value in a column.
The COUNT keyword will count and return the number of records in a column.
References
Coronel, C., Crockett, K., and Rob, P. (2012). Database systems: Design,
implementation & management. USA: Cengage Learning EMEA
Singh, S. K. (2009). Database systems: Concepts, design and applications. India:
Pearson Education.
Adamski, J. and Pratt, P. (2012). Database management systems (7th ed.). USA:
Cengage Learning
Elmarsi, R. and Navathe, S. (2010). Fundamentals of database systems (6th ed.).
Pearson Education South Asia Pte. Ltd.
Rockoff, L. (2011). The language of SQL. Cengage Learning.
Korth, H., Silberschatz, A., and Sudarshan, S. (2011). Database system concepts
(6th ed.). New York. McGraw-Hill.
03 Handout 1 *Property of STI
Page 1 of 1