-
Notifications
You must be signed in to change notification settings - Fork 1
/
dashboards.json
60 lines (60 loc) · 3.33 KB
/
dashboards.json
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
{
"Travel - 1": {
"class": "mysql",
"credentials": {
"host": "localhost",
"user": "root",
"password": "root",
"database": "Travel_01"
},
"schema_description": "Each user can book one or more flights and hotels. Flights have different classes, and hotels offer various room types...",
"dashboards": {
"dashboard - 1": {
"Number of bookings for each hotel": {
"sql_query": "SELECT `hotels`.`hotel_name`, COUNT(*) as `number_of_bookings` FROM `hotel_bookings` LEFT JOIN `room_types` ON `hotel_bookings`.`room_type_id` = `room_types`.`room_type_id` LEFT JOIN `hotels` ON `room_types`.`hotel_id` = `hotels`.`hotel_id` GROUP BY `hotels`.`hotel_name` ORDER BY `number_of_bookings` DESC",
"plot_params": {
"plot_title": "Number of Bookings for Each Hotel",
"axis_names": [
"Hotel",
"Number of Bookings"
],
"graph_type": "bar"
}
},
"Total revenue generated from hotel bookings in each city": {
"sql_query": "SELECT hotels.city, SUM(hotel_bookings.price) AS total_revenue FROM hotel_bookings JOIN room_types ON hotel_bookings.room_type_id = room_types.room_type_id JOIN hotels ON room_types.hotel_id = hotels.hotel_id GROUP BY hotels.city",
"plot_params": {
"plot_title": "Total revenue generated from hotel bookings in each city",
"axis_names": [
"City",
"Revenue"
],
"graph_type": "bar"
}
},
"Total revenue generated from flight bookings on every flight route": {
"sql_query": "SELECT flights.source, flights.destination, SUM(flight_bookings.price) as revenue FROM flights INNER JOIN flight_bookings ON flights.flight_id = flight_bookings.flight_id GROUP BY flights.source, flights.destination",
"plot_params": {
"plot_title": "Total Revenue Generated from Flight Bookings on Every Flight Route",
"axis_names": [
"Flight Route",
"Revenue (in USD)"
],
"graph_type": "bar"
}
},
"Revenue contributed by travel packages, flight bookings, and hotel bookings": {
"sql_query": "SELECT 'Travel Packages' AS category, SUM(price) AS revenue FROM travel_packages UNION SELECT 'Flight Bookings' AS category, SUM(price) AS revenue FROM flight_bookings UNION SELECT 'Hotel Bookings' AS category, SUM(price) AS revenue FROM hotel_bookings",
"plot_params": {
"plot_title": "Revenue contributed by travel packages, flight bookings, and hotel bookings",
"axis_names": [
"Booking Type",
"Revenue"
],
"graph_type": "bar"
}
}
}
}
}
}