uncfan Posted December 9, 2010 Share Posted December 9, 2010 I am trying to perform these searches within the sample Sakila database that I downloaded from the Mysql website. I am having a hard time with the queries and I would greatly appreciate some help. I need to be able to present the query statements for these following questions. Thank you (1) Which actors were in more then 50 movies? (2) Which actors were in the movies in German language? (3) Which actors were in the horror movies? (4) Which customers did rent more then 10 horror movies? (5) Which customers did see the movie with SCARLETT BENING? (6) Which customers at postal code 62703 saw documentaries? Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/ Share on other sites More sharing options...
fenway Posted December 9, 2010 Share Posted December 9, 2010 Is this homework? Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145054 Share on other sites More sharing options...
Pikachu2000 Posted December 9, 2010 Share Posted December 9, 2010 That would be my guess. Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145065 Share on other sites More sharing options...
uncfan Posted December 9, 2010 Author Share Posted December 9, 2010 Yes it is. I am having problems with trying to find these queries since there are a vast amount of tables in this database. Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145073 Share on other sites More sharing options...
Pikachu2000 Posted December 9, 2010 Share Posted December 9, 2010 Post the queries you've written, and the problems you're having with them. Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145078 Share on other sites More sharing options...
uncfan Posted December 9, 2010 Author Share Posted December 9, 2010 I have been using this picture to help me figure it out but I am starting to go crazy. http://dev.mysql.com/doc/sakila/en/images/sakila-schema.png Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145081 Share on other sites More sharing options...
Maq Posted December 9, 2010 Share Posted December 9, 2010 Whoa. One question at a time. (1) Which actors were in more then 50 movies? Post the table definitions that are needed (probably 'actor' and 'film_actor') and your attempted query, then we will help you. Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145138 Share on other sites More sharing options...
uncfan Posted December 10, 2010 Author Share Posted December 10, 2010 I was trying to join first_name, last_name from actor to film and then something like > 50 but I can't seem to get that to work Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145190 Share on other sites More sharing options...
fenway Posted December 10, 2010 Share Posted December 10, 2010 I was trying to join first_name, last_name from actor to film and then something like > 50 but I can't seem to get that to work Show us the query, and the output. Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145204 Share on other sites More sharing options...
uncfan Posted December 11, 2010 Author Share Posted December 11, 2010 this is what i have.. (2) select film_id, film.title, film.language_id language.language_id, language.name from film join language on film.language_id = language.language_id where language.name = 'German'; (3) select actor.last_name from actor join film_actor on actor.actor_id as film_actor.actor_id join film_actor on film_actor.film_id = film.film_id join film_category on film_category.film_id = film_actor.film_id where film_category.category_id = 'Horror'; Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145868 Share on other sites More sharing options...
uncfan Posted December 11, 2010 Author Share Posted December 11, 2010 and (1) select first_name, last_name from actor join actor_info on actor.last_name = actor_info.last_name where actor_info.film_info > '50'; Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145871 Share on other sites More sharing options...
fenway Posted December 11, 2010 Share Posted December 11, 2010 Good -- now post the output you get from each one, and what you want instead. Quote Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145903 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.