Tasks: Re-Write SQL queries to improve your assignment 3. Write SQL queries to answer the given questions. Submit all the queries in a text file.
Hint: Test your SQL on SQL server i.e. http://sqlfiddle.com/
1. Create a table named: Activity (It is the table that stores general physical activity related information)
- An unique integer id column for each record of the data, which cannot be null (act_id)
- A text column to describe the activity name that cannot be null either (act_name, Size:20 varchar)
- An integer column to indicate the activity hourly calorie consumption (act_cal)
- Create a primary key as the combination of act_id and act_name
Sample data:
act_id | act_name | act_cal
-------|-----------|--------
1 | walking | 60
2 | jogging | 250
3 | meditating| 5
4 | rowing | 420
5 | fencing | 310
6 | tennis | 560
7 | yoga | 180
8 | showering | 60