开发者

Confused on SQL assignment

We are doing a database query in class. And it's using relational keys. I don't know how to get the query to run. Here is what i开发者_如何学JAVAs says.

For each movie, list its number and title, along with the number and name of the actors who appeared in it.

This is what I have, but it doesn't work

SELECT `Movie`,`Movie_ID`,`ActorNum` FROM `Movies` 
Union
Select Actor.Fname, Actor.Lname FROM Actor
;


Im not sure what all the column names are but if ActroName would be the actors name would this be what you are looking for?

SELECT Movies.Movie, 
       Movies.Movie_ID, 
       Movies.ActroNum, 
       Actor.ActroName 
FROM Movies
JOIN Actor ON 
          Actor.ActroNum = Movies.ActroNum
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜