News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

How to do joins.

Started by sukishan, Aug 12, 2009, 04:00 PM

Previous topic - Next topic

sukishan

The Music database
This tutorial introduces the notion of a join. The music has two tables: album and track.

album(asin, title, artist, price, release, label, rank)
track(album, dsk, posn, song)

How to do joins.

The phrase FROM album JOIN track ON album.asin=track.album represents the join of the tables album and track. This JOIN has one row for every track. In addition to the track fields (album, disk, posn and song) it includes the details of the corresponding album (title, artist ...).

select a1.title title,a1.artist artist from album a1,track a2 where album.asin=track.album
like song 'Alison'
A good beginning makes a good ending