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? 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? 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. 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. 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. 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 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. Quote (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. 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 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 Quote 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. 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'; 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'; 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. Link to comment https://forums.phpfreaks.com/topic/221143-mysql-sakila-database-help/#findComment-1145903 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.