Skip to content

Instantly share code, notes, and snippets.

@jzaefferer
Created May 29, 2011 21:25
Show Gist options
  • Save jzaefferer/998151 to your computer and use it in GitHub Desktop.
Save jzaefferer/998151 to your computer and use it in GitHub Desktop.
table track {
id pk
artist string
title string
}
table rating {
track fk
name string
value int (1-10)
}
-- select speed range of 1 to 5
select from track, rating where id = track and name = 'speed' and value > 1 and value < 5;
-- select clean to agressive vocals with low pathos
select from track, rating where id = track and name = 'vocals' and value <= 5
union?
select from track, rating where id = track and name = 'pathos' and value <= 2;
-- select mix of clean and growling vocals, nothing inbetween please - would require
select from track, rating where id = track and name = 'vocals' and value <= 3
union?
select from track, rating where id = track and name = 'vocals' and value >= 8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment