Mysql exercises ---- More JOIN operations, ---- moreoperations

Source: Internet
Author: User

Mysql exercises ---- More JOIN operations, ---- moreoperations

This tutorial introduces the notion of a join. The database consists of three tablesmovie,actorAndcasting.

 


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

 

 

 

 

 

 

 

 

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.