HW
January 24, 2023
virtualization ( cloud computing)
January 24, 2023

Database SQL

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.QuestionsNOTESQuestions 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 9001rep multiplied by attempts by the weight8 reps x 3 attempts x 15kg = 360 total kg’s liftedThe 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, LightWrite 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 TableOccurrenceIDOcc_DateOcc_PlaceOcc_Start_TimeOcc_Finish_Time114/03/18University_Gym16:00:0016:30:00215/03/18University_Gym16:30:0017:00:00316/03/18University_Gym16:10:0017:20:00417/03/18Home07:00:0008:00:00517/03/18University_Gym17:00:0018:00:00Occurrence_Exercise TableOccExIDExerciseNoOccurrenceIDRepAttempt1Attempt2Attempt3Condition9001001A18151515Light9002002A18707570Medium9003003A212909590Heavy9004004A312200200200Medium9005006A38110110115Heavy9006005A4102025Medium9007001A48101210Medium9008002A588590115HeavyExercise TableExerciseNoExerciseDescriptionExerciseType001ASitupsAbs002ABench PressChest003ADead LiftsBack004ALeg PressLegs005ASeated Shoulder PressShoulders006ASquatsLegs007ALat pull downsLatsCreate the following queries:Find the exercise which contains the maximum total weight liftedShow: Exercise, Maximum weightEnsure you show captions for each of the columnsHint: you would need to consider the number of times the weight is lifted and weighte.g. rep multiplied by attempt multiplied by the weightFind the exercise that the user was not able to complete 3 attempts in, or the exercise that the user has not attempted.Show appropriate columnsList in ascending order exercise typeDo not show repeated namesEnsure you show captions for each of the columns

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.