Whats wrong with this SQL Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thomasjonesmona
    New Member
    • May 2010
    • 3

    Whats wrong with this SQL Query

    I am trying to get the top-rated films involving people (in any role) who have
    received a Best Actor Oscar? For ‘top-rated’ assume a film rating of at
    least 8 out of 10.


    Code:
    SELECT     FilmID, FilmTitle, FilmRating
    FROM         Film
    Where
    	FilmRating > 7.9
    GROUP BY FilmID, FilmTitle, FilmRating
    Code:
    SELECT     Person.PersonID, Person.FirstName, Person.Surname, AwardType.AwardTypeDescription
    FROM         Person CROSS JOIN
                          AwardType
    WHERE     (AwardType.AwardTypeDescription = 'Oscar')
    GROUP BY Person.PersonID, Person.FirstName, Person.Surname, AwardType.AwardTypeDescription
    tables
    Code:
    RoleType(RoleTypeID, RoleTypeDescription)
    Film(FilmID, FilmTitle,Release Date, GenreID, StudioID, FilRating, Plot)
    Role(RoleID, RoleTypeID, PersonID)
    Person(PersonID, FName, Sname, NationalityID, GenderID, GenderDescription)
    Award(AwardID, RoleID, AwardDEscription, AwardType, YearAwarded)
    AwardType(AwardTypeID, AwardTypeDescription)
    AwardCategory(AwardCategoryID, AwardTypeDescription)
    Last edited by Atli; May 17 '10, 12:01 AM. Reason: Added [code] tags.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Looks like you don't have a link between Film and Person. You must have a table with the filmId and all the cast on it via personid.

    Good Luck!!!

    ~~ CK

    Comment

    Working...