Page 101 - CITS - Computer Software Application -TT
P. 101

COMPUTER SOFTWARE APPLICATION - CITS




































           3  MAX: The MAX function returns the maximum value in a specified column. It is useful for finding the highest
              value in a dataset.
              SELECT MAX(score) FROM exam_scores;
           4  MIN: The MIN function returns the minimum value in a specified column. It is used to find the lowest value in
              a dataset.
              SELECT MIN(price) FROM product_prices;
           5  COUNT: The COUNT function counts the number of rows that meet certain criteria. It can be used to count all
              rows in a table or to count rows that meet specific conditions.
              SELECT COUNT(*) FROM employees;-- Count all employees
              SELECT COUNT(*) FROM order WHERE sus = ‘Shipped’; -- Count shipped orders

              Certainly!  Here  are  some  common  SQL  functions  used  in  queries  like  SUM, AVERAGE,  MAX,  MIN,  and
              COUNT, along with examples using a hypothetical table called sales:
           Assume the sales table has the following structure:
































                                                           88

                              CITS : IT&ITES - Computer software application - Lesson 18 - 36
   96   97   98   99   100   101   102   103   104   105   106