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

Describe four proven data protection strategies a company can use

 Describe four proven data protection strategies a company can use to protect their data stored in the cloud. Use your textbook and quality external resources for your writing assignment. Remember to cite your sources. APA format is preferred. However, MLA or Chicago (Turabian) would be fine as well. The important

Final Project Case Studies Case 1. Hot burglary At 16,

  Final Project Case Studies Case 1. Hot burglary At 16, Ray seemed to have a good life. He had a high IQ and a 4.0 GPA. He had lots of friends, and they enjoyed hanging out. What no one knew was that Ray’s home life was miserable. His stepfather,

In this course, you will progressively work on a system

 In this course, you will progressively work on a system implementation process in six stages: Week 1: System planning Week 2: System analysis Week 3: System selection Week 4: System implementation Week 5: User training and system maintenance  This week you will start with system planning  while considering the following components:

Personal brand development project

Demonstrating a command of all of the branding concepts taught via this class, develop and describe your personal brand. Specifically, your Personal Brand Development Project paper should, at least, address these topics: What brand elements are descriptive of you now? What other brand elements do you desire to develop and

Leadership Book Review – BUSI 1200 (Spring 2019)

Choose a book about leadership from the list provided. If you would like to write about a book not on the list, it must be approved to receive credit. Before you read your book look at the following instructions for completing your written book report. Points are lost anywhere you

Theoretically, how is working memory similar to and different from

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.

Only 2-4 paragraphs Spirit Airlines presently has a daily flight

Only 2-4 paragraphs Spirit Airlines presently has a daily flight from Minneapolis to Green Bay which accommodates presently the many Packer fans that live in both cities! The flight runs peak especially on weekends when the Packers have a football game at home on Lambeau Field! (Note that Lambeau Field

1. Review the Profile of a Graduate Download Profile of

 1. Review the Profile of a Graduate Download Profile of a Graduatedocument. 2. Choose two characteristics to focus your research on. 3. Download the Research Log form to use as you begin your research. 4. Using library resources and research techniques and complete rows on page 1/Week 6 of the

This is the culmination of your work in the first

This is the culmination of your work in the first year of the Healthcare Informatics program. You will each write an integrated, comprehensive, professional document detailing your complete plan for implementing a new EMR at your hospital that replaces an old one that was not successful. It will include your

Perform an Internet search to identify and research and a situation where a health care organization or individual provider in your field of allied health was sanctioned by The Joint Commission or oth Nursing Assignment Help

Perform an Internet search to identify and research and a situation where a health care organization or individual provider in your field of allied health was sanctioned by The Joint Commission or other regulatory body for a violation of one or more of The Joint Commission workplace safety, risk management,

After studying Module 7: Lecture Materials & Resources, discuss the

  After studying Module 7: Lecture Materials & Resources, discuss the following: Select one of the 2022 National Patient Safety Goals. Share your thoughts about the opportunities and challenges related to achieving the goal in your work environment. 2022 National Patient Safety Goals: https://www.jointcommission.org/standards/national-patient-safety-goals/ (Links to an external site.) Submission Instructions:

After reading the following chapters, answer the questions below. Please,

After reading the following chapters, answer the questions below. Please, give your answers in your own words, do not copy and paste from the textbook or another source.Chapter 10: Leadership1. In what way does a first-level supervisor play an important leadership role in the organization? Give two examples.2. Which of

CCC Pharmacology hyperthyroidism Essay Nursing Assignment Help

Expert Solution Preview Introduction: As a medical professor responsible for creating college assignments and assessing student performance, I understand the importance of providing accurate and informative answers to content-related questions. In response to the given content, I will provide an answer that aligns with my expertise and knowledge in the

Discussion READ CHAPTERS: Chapter 29: Barrett’s Theory of Power as

Discussion READ CHAPTERS:  Chapter 29: Barrett’s Theory of Power as Knowing Participation in Change Chapter 30: Marlaine Smith’s Theory of Unitary Caring Chapter 31: Kristen Swanson’s Theory of Caring                 1)  After reviewing our three nursing theorists presented this week in chapters 29, 30, and 31. Let us reflect upon the

“How can Health Informatics help in the detection, treatment,

provide 20 referenced citations in APA format.  “How can Health Informatics help in the detection, treatment, prevention efforts related to opioid use disorder (OUD) and addiction?” – What happens to a patient w/Opioid Use Disorder at each stage along the continuum of care? How are they triaged, tracked, managed? Is

Discuss the following: 1. What are the stages of blockchain

 Discuss the following: 1. What are the stages of blockchain maturity and explain which stages have the most potential for human resource management application. You are required to cite this week’s assigned readings in your paper. You may also cite prior week’s reading assignments and external sources if you wish.

Submit your completed Job Description, Resume & Cover Letter Assignment

Submit your completed Job Description, Resume & Cover Letter Assignment + the completed Check List to this dropbox Job Description, Resume & Cover Letter Assignment Review the following: Tips for Success: Make sure that you read and view all the information provided above to help guide you in completing this

The data if any needed for this assignment is posted

The data if any needed for this assignment is posted on eLearn. If after giving some thought, you have problems doing this assignment, do not hesitate to email or meet with me. You can discuss with each other, but please finish and write up the answers independently. Please submit a