}
);
while (my $track = $rs->next) {
- print $track->title . "\n";
+ print $track->title . " (from the CD '" . $track->cd->title
+ . "')\n";
}
print "\n";
}
}
);
my $cd = $rs->first;
- print $cd->title . "\n\n";
+ print $cd->title . " has the track '$tracktitle'.\n\n";
}
sub get_cds_by_artist {
}
);
my $artist = $rs->first;
- print $artist->name . "\n\n";
+ print $artist->name . " recorded the track '$tracktitle'.\n\n";
}
sub get_artist_by_cd {
}
);
my $artist = $rs->first;
- print $artist->name . "\n\n";
+ print $artist->name . " recorded the CD '$cdtitle'.\n\n";
}
Dirty Diana
get_tracks_by_artist(Michael Jackson):
- Billie Jean
- Leave Me Alone
- Smooth Criminal
- Beat It
- Dirty Diana
+ Billie Jean (from the CD 'Thriller')
+ Leave Me Alone (from the CD 'Bad')
+ Smooth Criminal (from the CD 'Bad')
+ Beat It (from the CD 'Thriller')
+ Dirty Diana (from the CD 'Bad')
get_cd_by_track(Stan):
- The Marshall Mathers LP
+ The Marshall Mathers LP has the track 'Stan'.
get_cds_by_artist(Michael Jackson):
Thriller
Bad
get_artist_by_track(Dirty Diana):
- Michael Jackson
+ Michael Jackson recorded the track 'Dirty Diana'.
get_artist_by_cd(The Marshall Mathers LP):
- Eminem
+ Eminem recorded the CD 'The Marshall Mathers LP'.
+
=head3 Discussion about the results