Mysql exercises ---- More JOIN operations, ---- moreoperations
This tutorial introduces the notion of a join. The database consists of three tablesmovie
,actor
Andcasting
.
Movie |
Actor |
Casting |
Id |
Id |
Movieid |
Title |
Name |
Actorid |
Yr |
|
Ord |
Director |
|
|
Budget |
|
|
Gross |
|
|
|
|
|
Movie
Field name |
Type |
Notes |
Id |
INTEGER |
An arbitrary unique identifier |
Title |
CHAR (70) |
The name of the film-usually in the language of the first release. |
Yr |
DECIMAL (4) |
Year of first release. |
Director |
INT |
A reference to the actor table. |
Budget |
INTEGER |
How much the movie cost to make (in a variety of currencies unfortunately ). |
Gross |
INTEGER |
How much the movie made at the box office. |
Example
Id |
Title |
Yr |
Director |
Budget |
Gross |
10003 |
"Crocodile" Dundee II |
1988 |
38 |
15800000 |
239606210 |
10004 |
Until There Was You |
1997 |
49 |
10000000 |
|
Actor
Field name |
Type |
Notes |
Id |
INTEGER |
An arbitrary unique identifier |
Name |
CHAR (36) |
The name of the actor (the term actor is used to refer to both male and female thesps .) |
Example
Id |
Name |
20 |
Paul Hogan |
50 |
Jeanne Tripplehorn |
Casting
Field name |
Type |
Notes |
Movieid |
INTEGER |
A reference to the movie table. |
Actorid |
INTEGER |
A reference to the actor table. |
Ord |
INTEGER |
The ordinal position of the actor in the cast list. Star of the movie will have ord value 1 the co-star will have Value 2 ,... |
Example
Movieid |
Actorid |
Ord |
10003 |
20 |
4 |
10004 |
50 |
1 |