The questions are broken into: Q1 (4 marks), Q2 (3

The questions are broken into: Q1 (4 marks), Q2 (3 marks), Q3 and Q4 (3 marks). For all questions, provide the answer in the form of a SQL statement, with description before as necessary.

Questions

NOTES

Questions 1 and 2 require you to answer in the form of a SQL statement to create a table and insert data into it. The question and answer is only about the statements to create and put data into the

`Occurrence_Exercise` table, however it is recommended that you create the statements to create and insert data into all 3 tables, so that you can test that your statements are correct. Please only provide in your answer the SQL statement for the `Occurrence_Exercise` table.

To understand the terminology:

  • A rep is a number of times you do an attempted weight.
  • A set is an attempt and in this case, there are 3 attempts (attempt 1, attempt 2, attempt 3).
  • An attempt contains the weight.

So to understand the weight you would lift for a single exercise in the Exercise attempt table you would need to consider the rep multiplied by attempts by the weight. So for a single attempt:

e.g. for 9001

rep multiplied by attempts by the weight

8 reps x 3 attempts x 15kg = 360 total kg’s lifted

  • The following Gym application database for weight session recording is as follows. Write and run SQL statements for creating the Occurrence_Exercise table.
    • Include constraint values for the Condition Column: Heavy, Medium, Light
  • Write an SQL statement that will insert the data into Occurrence_Exercise table only.
    • Definition of rep stands for repetition.
    • Each exercise attempt has the rep number as indicated in the occurrence table.

Occurrence Table

OccurrenceID

Occ_Date

Occ_Place

Occ_Start_Time

Occ_Finish_Time

1

14/03/18

University_Gym

16:00:00

16:30:00

2

15/03/18

University_Gym

16:30:00

17:00:00

3

16/03/18

University_Gym

16:10:00

17:20:00

4

17/03/18

Home

07:00:00

08:00:00

5

17/03/18

University_Gym

17:00:00

18:00:00

Occurrence_Exercise Table

OccExID

ExerciseNo

OccurrenceID

Rep

Attempt1

Attempt2

Attempt3

Condition

9001

001A

1

8

15

15

15

Light

9002

002A

1

8

70

75

70

Medium

9003

003A

2

12

90

95

90

Heavy

9004

004A

3

12

200

200

200

Medium

9005

006A

3

8

110

110

115

Heavy

9006

005A

4

10

20

25

Medium

9007

001A

4

8

10

12

10

Medium

9008

002A

5

8

85

90

115

Heavy

Exercise Table

ExerciseNo

ExerciseDescription

ExerciseType

001A

Situps

Abs

002A

Bench Press

Chest

003A

Dead Lifts

Back

004A

Leg Press

Legs

005A

Seated Shoulder Press

Shoulders

006A

Squats

Legs

007A

Lat pull downs

Lats

Create the following queries:

  • Find the exercise which contains the maximum total weight lifted
    • Show: Exercise, Maximum weight
    • Ensure you show captions for each of the columns
    • Hint: you would need to consider the number of times the weight is lifted and weight

e.g. rep multiplied by attempt multiplied by the weight

  • Find the exercise that the user was not able to complete 3 attempts in, or the exercise that the user has not attempted.
    • Show appropriate columns
    • List in ascending order exercise type
    • Do not show repeated names
    • Ensure you show captions for each of the columns

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

If you are looking for a way to reduce your

  If you are looking for a way to reduce your bookkeeping and accounting tasks, then QuickBooks is here to help you do that. Also, QB is software available with many advanced features and advantages. However, it also has lots of errors. One of them is QuickBooks Installer Encountered Error

Explain the “Communication Process” and the “Six Parts of the

Explain the “Communication Process” and the “Six Parts of the Model” as stated in the textbook. Instructions: You must provide the textbook chapter with your answer (.25 points will be deducted if not provided). Your initial post must be at least 150 words. You will be deducted .25 points if not provided. 

Best buy Future Analysis – Premium Paper Help

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.

Discuss the major barriers to entry into an industry. Explain

Discuss the major barriers to entry into an industry. Explain how each barrier can foster monopoly. Can any barrier be socially justifiable?  Your initial reply should be no less than 200 words. Then Reply to the two peers below. 1. When first entering into industry there are barriers that companies

This assignment relates to the following Course Learning Requirements: CLR

  This assignment relates to the following Course Learning Requirements: CLR 3: Discuss what it means to conduct business ethically and responsibly. Identify programs to aid a small Canadian business achieve its responsibilities to the various stakeholders.CLR 2: Explain how events external to a business can influence business decisions, and

Read Chapter: Populations Health Care (9th edition) of Nursing Assignment Help

Read Chapter: Populations Health Care (9th edition) of Saunders Comprehensive Review for the NCLEX-RN Examination Using Microsoft Word Document complete the following assignment: Specifics: 12 font; double space;  minimum of one and one half pages, and a Reference page Cultural Awareness includes learning about the cultures of clients with whom you may

Create a Power Point Presentation to discuss the followingSgt. Eddie Johns leaned back against the chair in the outpatient orthopedic clinic. His head was killing him! He wasn’t sure which was worse, Nursing Assignment Help

Create a Power Point Presentation to discuss the following Sgt. Eddie Johns leaned back against the chair in the outpatient orthopedic clinic. His head was killing him! He wasn’t sure which was worse, the “morning after” headache or not being able to sleep at night. At least when he had

Prepare a paper on cost effectiveness models: Briefly describe two

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.

Chilcote & Warner: Chapter 13: 1. “What, according to the

  Chilcote & Warner: Chapter 13: 1. “What, according to the New Testament, is the gospel?” (p. 190). Is his view biblically correct, if so why, if not, why not? Chapter 14: 1. How does this author define worship, evangelism, and ethics within the mission of the church? Do you agree

1- During the rise and fall of Rome, significant cultural

  1- During the rise and fall of Rome, significant cultural contributions would emerge from this empire. In a well constructed paragraph, discuss two of the contributions and why they were important  2- During the readings, the rise of the biblical tradition and islam emerged. These two beliefs would lead

Creativity in later adulthood. The textbook authors provide a brief

Creativity in later adulthood. The textbook authors provide a brief overview of creativity in later adulthood, but there is much more to expand upon! According to classic research by Simonton (1988), creative contributions in literature, science, math, music, and other areas decline with age. His data show that the peak of

What is knowledge discovery in databases (KDD)? Review section 1.2

What is knowledge discovery in databases (KDD)?  Review section 1.2 and review the various motivating challenges.  Select one and note what it is and why it is a challenge. Note how data mining integrates with the components of statistics and AL, ML, and Pattern Recognition. Note the difference between predictive

1. Assessment can take place informally through what process? 2.

1.  Assessment can take place informally through what process? 2.  Assessment can take place formally by what avenues? 3.  Who can refer a student to the school social worker? 4.   What reasons can a student be referred to the school social worker? 5.   Define assessment. 6.  Name 3

Part 2: Project Planning Imagine that you are the DashMart

  Part 2: Project Planning Imagine that you are the DashMart Site Manager for the site whose data you just analyzed. Your overall site INF (Item Not Found – Inventory Control) was 7.41% for last week, and our current target for this metric is 1.8%. Your manager asks you to

Environment in History: How did environmental factors play a significant

Environment in History:  How did environmental factors play a significant role in this week’s period of study?  Select and explain two different environmental aspects from the assigned videos and readings.  Which was more important?   Purpose in Life:   Select one or two passages from Gilgamesh that present Mesopotamian perspectives on