ABCDEFGHIJKLMNOPQ
1
TitleAvg number of months checked outNumber of checkoutsTotal Available Items for Checkout
2
Ramadan2.183527846
3
Desire of the everlasting hills the world before and after Jesus2.111817012
4
Amazing grace a vocabulary of faith2.430316519
5
Egyptian gods and goddesses2.05561627
6
Egyptian mythology2.047614711
7
Killing the Buddha a heretics Bible2.13891448
8
Celebrate Diwali2.097914318
9
Jesus2.521114226
10
Covenant marriage building communication intimacy2.04351386
11
St Francis of Assisi a life of joy2.204513211
12
How we believe science skepticism and the search for God3.03331206
13
new Jewish wedding revised and updated2.38331208
14
knock at midnight inspiration from the great sermons of Reverend Martin Luther King Jr2.12512024
15
case for faith a journalist investigates the toughest objections to Christianity3.70591199
16
Hanukkah2.126111931
17
Diwali Hindu festival of lights3.739111512
18
One world many religions the ways we worship2.165211511
19
first Rasta Leonard Howell and the rise of Rastafarianism2.24111126
20
Christianity2.816510931
21
Buddha in your backpack everyday Buddhism for teens2.03771069
22
Wide awake a Buddhist guide for teens2.21059
23
Muhammad a biography of the prophet2.00951055
24
Enchanted love the mystical power of intimate relationships2.56311034
25
golden fleece and the heroes who lived before Achilles2.01941039
26
27
Script
28
SELECT title, AVG(TIMESTAMPDIFF(MONTH, ckoutDateTime, ckinDateTime)) AS timeOut, count(barcode) AS checkouts, count(DISTINCT(barcode)) AS totalItems FROM transactionsall WHERE DATE_FORMAT(ckoutDateTime, '%Y') > '2004' AND deweyClass >= 200 AND deweyClass < 300 GROUP BY title HAVING AVG(TIMESTAMPDIFF(MONTH, ckoutDateTime, ckinDateTime)) > 2 AND count(barcode) > 100 ORDER BY checkouts DESC;
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100