Link to home
Start Free TrialLog in
Avatar of Sreejith22
Sreejith22Flag for India

asked on

Help required writing join query

I need to get name(of a collection) from Table1 and name of all the songs in that collection from table 3 . Table 2 is the connection between table 1 and table 3. music_playlist_id connects table 2 to table 1. tbl_content_common_id connects table 2 with table 3.

Table 1

CREATE TABLE IF NOT EXISTS `music_playlists` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `collection_id` int(10) NOT NULL,
  PRIMARY KEY (`id`)
)

Open in new window


Table 2

CREATE TABLE IF NOT EXISTS `playlist_song_mappings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `music_playlist_id` int(11) NOT NULL,
  `tbl_content_common_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
)

Open in new window



Table 3

CREATE TABLE IF NOT EXISTS `tbl_content_commons` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `content_common_code` varchar(20) CHARACTER SET utf8 NOT NULL,
  `content_common_name` varchar(100) CHARACTER SET utf8 NOT NULL
)

Open in new window


Any help is much appreciated
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial