Search for question
Question

YOU MAY NEED TO REFER TO THE LECTURE SLIDES TO HELP WITH THIS WORKSHEET WRITE THE SQL STATEMENTS FOR THE FOLLOWING QUERIES 1) Create a database and populate it with data

from all of these people. You should include name, hair colour, eye size and whatever else you think you may need. Also include IDs starting with 1 from the top left of the pictures (Thomas = 1, Daniel = 2 etc). Finally include the persons age (look at the picture and estimate it) and include the number of times they exercise each week (Estimate this. Do they look healthy and fit?). 2) Create a view of the database (use SELECT *). 3) Create list of names of all people with blonde hair. 4) Delete Thomas with blonde hair from the database (you will need his ID number). 5) Update Ryan to have big eyes (You can't see behind his glasses - but he does have big eyes). 6) Create a list of names and show this in order of eye size (small to large), also show hair colour in your list. 7) Reduce this list to include only people that wear glasses. 8) What is the average age of people who have brown hair? 9) Write a query that will select Katie (You can not use her name or ID) 10) What is the sum of the ages for people with each hair colour? 11) Create a list of people names who exercise more than 3 times a week and are over 21 years old. 12) Create a list of people names who exercise more than 3 times a week or are over 21 years old. 13) Alter the above two queries and tell me whether AND has precedence over OR or is it the other way round? The film industry is recruiting people for new movies and is looking for a particular type of person. Create another table which has ID, hair colour and years of acting experience (give people a range of experience from 1 year to 30 years). 14) Write a query to show all the information from the people table who have over 10 vears of acting experience.

Fig: 1