Consider the following ODL schema about DJ's and the songs they mix and play.
CLASS DJ (EXTENT DJs KEY name) {
ATTRIBUTE string name;
ATTRIBUTE int age;
RELATIONSHIP Set<Song> plays
INVERSE Song::playedBy;
RELATIONSHIP Set<Song> mixed
INVERSE Song::mixedBy;
}
CLASS Song (EXTENT Songs KEY name) {
ATTRIBUTE string name;
ATTRIBUTE float length;
RELATIONSHIP Set<Song> versions INVERSE versions;
RELATIONSHIP Set<DJ> playedBy
INVERSE DJ::plays;
RELATIONSHIP DJ mixedBy
INVERSE DJ::mixed;
}
Write OQL queries for each of the following.
- (a)
- Find all songs, as objects, mixed by John Digweed.
- (b)
- Find the names and lengths, without repetitions, of all songs that are mixed and played only by DJs that are 25-35 year old.
- (c)
- Find the total length of versions of songs that are mixed by Sasha.
- (d)
- Find the names of all songs mixed by DJs that play at least two songs that Paul Oakenfold plays.