Based on data from Seattle Public Library, this project studies the relationship between the checkout times and the publish year of books related to seven deadly sins.
Each book is represented as a line in the space, which connects the time axis in the center and one of the seven checkout count axes in the outer area. Each checkout count axis is presenting the range of checkout count of one specific sin, such as greed or sloth, from a one endpoint to the other endpoint. So given one item's checkout count and which sin its topic it is about, a location can be found at that sin's checkout count axis. Connecting this location with the location of publish year at time axis, the line can be drawn.
select distinct
title.title,
(CASE
WHEN substring(itemType.itemType,3,3) = "bk" THEN "Book"
WHEN substring(itemType.itemType,3,3) = "cas" THEN "Audio"
WHEN substring(itemType.itemType,3,3) = "cd" THEN "Audio"
WHEN substring(itemType.itemType,3,3) = "vhs" THEN "Video"
WHEN substring(itemType.itemType,3,3) = "dvd" THEN "Video"
ELSE "OTHERS"
END) as MyType,
(CASE
WHEN keyword.keyword ='Lust' THEN "Lust"
WHEN keyword.keyword ='Gluttony' THEN "Gluttony"
WHEN keyword.keyword ='Greed' THEN "Greed"
WHEN keyword.keyword ='Sloth' THEN "Sloth"
WHEN keyword.keyword ='Wrath' THEN "Wrath"
WHEN keyword.keyword ='Envy' THEN "Envy"
WHEN keyword.keyword ='Pride' THEN "Pride"
ELSE "OTHERS"
END) as MykeyWord,
substring(callNumber,-4) as PubYear,
COUNT(_transactionsExploded.bibNumber) as Counts
from
itemToBib, itemType, keyword, callNumber, title, _transactionsExploded
where
itemToBib.itemNumber = itemType.itemNumber
AND itemToBib.itemNumber = callNumber.itemNumber
AND itemToBib.bibNumber = keyword.bibNumber
AND itemToBib.bibNumber = title.bibNumber
AND itemToBib.bibNumber = _transactionsExploded.bibNumber
AND itemType.itemNumber = itemToBib.itemNumber
AND (keyword.keyword = "Lust"
or keyword.keyword = "Gluttony"
or keyword.keyword = "Greed"
or keyword.keyword = "Sloth"
or keyword.keyword = "Wrath"
or keyword.keyword = "Envy"
or keyword.keyword = "Pride")
AND Cast(substring(callNumber,-4) as UNSIGNED) > 1900
AND Cast(substring(callNumber,-4) as UNSIGNED) < 2015
Group by itemToBib.bibNumber