-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueryresult.py
More file actions
68 lines (53 loc) · 2.22 KB
/
Copy pathqueryresult.py
File metadata and controls
68 lines (53 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
class QueryResult:
class ResultQ1:
def __init__(self, isbn, first_publish_year, page_count, publisher_name):
self.isbn = isbn
self.first_publish_year = first_publish_year
self.page_count = page_count
self.publisher_name = publisher_name
def __str__(self):
return f"{self.isbn}\t{self.first_publish_year}\t{self.page_count}\t{self.publisher_name}"
class ResultQ2:
def __init__(self, publisher_id, average_page_count):
self.publisher_id = publisher_id
self.average_page_count = average_page_count
def __str__(self):
return f"{self.publisher_id}\t{self.average_page_count}"
class ResultQ3:
def __init__(self, book_name, category, first_publish_year):
self.book_name = book_name
self.category = category
self.first_publish_year = first_publish_year
def __str__(self):
return f"{self.book_name}\t{self.category}\t{self.first_publish_year}"
class ResultQ4:
def __init__(self, publisher_id, category):
self.publisher_id = publisher_id
self.category = category
def __str__(self):
return f"{self.publisher_id}\t{self.category}"
class ResultQ5:
def __init__(self, author_id, author_name):
self.author_id = author_id
self.author_name = author_name
def __str__(self):
return f"{self.author_id}\t{self.author_name}"
class ResultQ6:
def __init__(self, author_id, isbn):
self.author_id = author_id
self.isbn = isbn
def __str__(self):
return f"{self.author_id}\t{self.isbn}"
class ResultQ7:
def __init__(self, publisher_id, publisher_name):
self.publisher_id = publisher_id
self.publisher_name = publisher_name
def __str__(self):
return f"{self.publisher_id}\t{self.publisher_name}"
class ResultQ8:
def __init__(self, isbn, book_name, rating):
self.isbn = isbn
self.book_name = book_name
self.rating = rating
def __str__(self):
return f"{self.isbn}\t{self.book_name}\t{self.rating}"