首页 > 代码库 > mysql练习----More JOIN operations

mysql练习----More JOIN operations

This tutorial introduces the notion of a join. The database consists of three tables movie , actor and casting .

 


movie
actorcasting
ididmovieid
titlenameactorid
yr ord
director  
budget  
gross  
   

 

技术分享

 

movie

Field nameTypeNotes
idINTEGERAn arbitrary unique identifier
titleCHAR(70)The name of the film - usually in the language of the first release.
yrDECIMAL(4)Year of first release.
directorINTA reference to the actor table.
budgetINTEGERHow much the movie cost to make (in a variety of currencies unfortunately).
grossINTEGERHow much the movie made at the box office.

Example

idtitleyrdirectorbudgetgross
10003"Crocodile" Dundee II19883815800000239606210
10004‘Til There Was You19974910000000 

actor

Field nameTypeNotes
idINTEGERAn arbitrary unique identifier
nameCHAR(36)The name of the actor (the term actor is used to refer to both male and female thesps.)

Example

idname
20Paul Hogan
50Jeanne Tripplehorn

casting

Field nameTypeNotes
movieidINTEGERA reference to the movie table.
actoridINTEGERA reference to the actor table.
ordINTEGERThe ordinal position of the actor in the cast list. The

star of the movie will have ord value 1 the co-star will have

value 2, ...

Example

movieidactoridord
10003204
10004501
 
 

 

技术分享

 

 

 技术分享

技术分享

 

 技术分享

技术分享

技术分享

技术分享

 

 技术分享

技术分享

技术分享

 

 技术分享

 

 技术分享

技术分享

技术分享

技术分享

mysql练习----More JOIN operations