by carlosjr | Sep 7, 2016 | Functions

All of the database aspects on this site can be used in a variety of database systems and this is intentional. You may recall from the ANSI standard section that most databases support the standard that was created in 1992; and in technology standards, that is ages...
by carlosjr | Sep 7, 2016 | Functions

We can use some of the simple math functions—Min, Max, AVG, and SUM—as basic examples of functions we can use in our queries. Each uses the same format and you will notice we only have one column in our select query. I have also used an alias in each example query...
by carlosjr | Sep 7, 2016 | Math

We use the MIN () function to determine the smallest amount or number in a column. While there may be more than one row with the smallest number, only one row will be returned. Select MIN (MonthsWithOwner) AS LeastTimeWithOwner FROM Cat; OUTPUT LeastTimeWithOwner...
by carlosjr | Sep 7, 2016 | Math

We use the MAX () function to determine the largest amount or number in a column. While there may be more than one row with the largest number, only one row will be returned. Select MAX (MonthsWithOwner) AS MostTimeWithOwner FROM Cat; OUTPUT MostTimeWithOwner...
by carlosjr | Sep 7, 2016 | Math

We use the AVG () function to determine the average of all the values in a column. These examples use the columns MonthsWithOwner and OwnerAge Select AVG (MonthsWithOwner) AS AvgTimeWithOwner FROM Cat; OUTPUT AvgTimeWithOwner —————- 37 (1...
by carlosjr | Sep 7, 2016 | Math

We use the SUM () function to determine the total value of all the rows in a column. This example uses MonthsWithOwner. Select SUM (MonthsWithOwner) AS 'Total Months of Cat Ownership' FROM Cat; OUTPUT MonthsWithOwner —————— 10055 (1...