Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi tutors, I have attached a few images of these questions. Please help me solve these question. Thank you. I am in a real rush.
Hi tutors, I have attached a few images of these questions. Please help me solve these question. Thank you. I am in a real rush. Thanks. Much appreciated. :)
(a) Consider a 'user-vaccine' database with three tables as given below 1. Vaccine - captures vaccine details vaccine_code vaccine_name | vaccine_for_disease vaccine vacc2ee vacc3e0 vacc4ee ipol typhin vaxchora measles polio typhoid cholera Table 1 2. User-captures user details. user_id | user_name | user_gender | user_age 2ee user1 201 user2 282 | user3 203 1 user4 284 users NNNNN 1 ww Table 2 3. User vaccine - captures details of type of vaccination taken by different users, user vace ld user_ld | vaccine code 200 200 200 201 vace 100 vacc200 vacc 300 Vacc100 vac200 vacc 300 vacch00 vacc 300 vacc 200 Vacc400 vacc 300 vacc100 201 201 202 202 202 203 203 203 8 10 11 12 Table 3 Based on the three (3) tables given above, answer the following questions 1) Write SQL syntax to 1) Create table user_vaccine with all necessary constraints. 2) Alter the table to add the auto_increment constraint to the field user_vacc_id 1) Write SQL syntax to 1) Initialize the auto_increment value for user_id to start from 200 for the user table. iii) Write SQL statements which give below outputs - 1) VaccineName | UserName ipol mmr typhin vaxchora useri, user2,user3 useri, user2,user4 user1, user2, user3, user4 user3, user4 2) Gender | VaccineName | vaxchora, typhin, ipol iv) Write an SQL statement that gives vaccination information for 'user4' FEB 2021 ECB 2253 (BCE/BCVE/ BCHE) 4 iv) Write an SQL statement that gives vaccination information for 'user4' ECB 2253 (BCE / BCVE/ BCHE) FEB 2021 CONFIDENTIAL 5/5 v) Write an SQL statement to 1) change the age of the user5 to 40. 2) change the tablename user to user_details vi) Write an SQL statement to find the total number of 1) vaccines received by 'users'. 2) users who have received the vaccine for 'measles'. (20 Marks) (a) Identify from the above given tables i) the 'surrogate key ii) associative entity and define themStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started