Jump to content

SQL query

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
sayhello2ay

sayhello2ay

    Newbie

  • Members
  • Pip
  • 2 posts
Actor (Aname: varchar(40), Ano: varchar(6)) Ano is pk
Movie (Mname: varchar(40),mno: varchar(8)) Mno is pk
PlayIn (Ano, Mno, Pay: Integer) Ano and Mno are fk referencing Acotr and Movie respectively.

Actor(Aname, Ano)
A Bingo, A1
B Castro, A2
C Katie, A3
S Hommy, A4
J Tammy, A5
K loren, A6

Movie(Mname, Mno)
Gladiator, M1
Cast, M2
Dog, M3
Jilters, M4

PlayIn(Ano,Mno,Pay)
A1 M1 800
A1 M2 1500
A2 M2 78
A2 M3 1750
A2 M4 2301
A3 M2 904
A3 M3 629
A4 M2 565
A4 M3 5695
A4 M4 1255
A5 M1 989
A5 M4 238
A6 M2 137
A6 M3 236
A6 M4 545

QUESTION: write SQL query to find the names of actors who earned less than 'B Castro' in each movie that 'B Castro' played in.

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
And what do you have so far - where are you stuck?

#3
sayhello2ay

sayhello2ay

    Newbie

  • Members
  • Pip
  • 2 posts
i got it ...was hoping i could get the relational algebra