Introducing: sum()
This simple query will display the time spent out on all all the walks.
select minutestaken from walk
Think about this requirement:
Some people have been out on all the walks; how long did they spend walking all together? A calculation which adds up the all the minutes taken column value in every row is needed. Using the sum() aggregate function
Here is how the SQL sum() function could be used to produce the total.
select sum(minutestaken) as "walking time total" from walk
take care not to confuse SUM and COUNT .. select count(minutestaken) as "walking time total" from walk
.. this query would simply return 8, can you explain why? Using sum() aggregate function
save your working code in application express Try a simple version first, like: display all rows and columns. Then introduce sum(), then add an alias some queries will need a where clause
How many people have walked in the rain? How far did a walker go if they completed all the coastal routes? How long would it take to walk all the hill and mountain routes?