GithubHelp home page GithubHelp logo

santoshyadav121 / club-operation-sql-frame Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 154 KB

The dataset for these exercises is for a newly created country club, with a set of members, facilities such as tennis courts, and booking history for cd.members cd.bookings cd.facilities Column Name Data Type Column Name Data Type Column Name Data Type memid integer memid integer facid integer surname varchar(200) facid integer name varchar(200) firstname varchar(200) no_of_slots_bookeinteger membercost numeric address varchar(300) starttime timestamp guestcost numeric zipcode integer initialcost numeric telephone varchar(200) monthlymaintenancnumeric recommendedby integer joindate timestamp POINTS TO NOTE Recommendedby is the memid of the person who recommended in cd.bookings, a booking can be made by a guest or by a member. In case of guest, cd.bookings.memid = 0 otherwise it is = memid of cd.members No of hours =( (sum(No of slots) + 10)/20)*10 If booking made by guest then revenue = no_of_Slots_booked * guestcost If booking made by member then revenue = no_of_Slots_booked * membercost Total Revenue of facilities = sum of revenue of all bookings made for that facility Total Revenue on a date = sum of revenue of all bookings made on that date (refer to starttime column)

club-operation-sql-frame's Introduction

Club-Operation-SQL-Frame

The dataset for these exercises is for a newly created country club, with a set of members, facilities such as tennis courts, and booking history for cd.members cd.bookings cd.facilities Column Name Data Type Column Name Data Type Column Name Data Type memid integer memid integer facid integer surname varchar(200) facid integer name varchar(200) firstname varchar(200) no_of_slots_bookeinteger membercost numeric address varchar(300) starttime timestamp guestcost numeric zipcode integer initialcost numeric telephone varchar(200) monthlymaintenancnumeric recommendedby integer joindate timestamp POINTS TO NOTE Recommendedby is the memid of the person who recommended in cd.bookings, a booking can be made by a guest or by a member. In case of guest, cd.bookings.memid = 0 otherwise it is = memid of cd.members No of hours =( (sum(No of slots) + 10)/20)*10 If booking made by guest then revenue = no_of_Slots_booked * guestcost If booking made by member then revenue = no_of_Slots_booked * membercost Total Revenue of facilities = sum of revenue of all bookings made for that facility Total Revenue on a date = sum of revenue of all bookings made on that date (refer to starttime column) Q1 Create a list of start times for bookings made by member named "Darren Smith" Q2 Create a list of all members who have recommended another member? Ensure that there are no duplicates in the list, and that results are ordered by (surname, firstname). Q3 Create a list of all members who have used a tennis court? Include in your output the name of the court, and the name of the member formatted as a single column. Ensure no duplicate data, and order by the member name followed by the facility name. Q4 Count of the number of facilities that have a cost to guests of 9 or more. Q5 Get the total number of slots booked per facility in the month of September 2012. Produce an output table consisting of facility id and slots, sorted by the number of slots. Q6 List each member's first booking after September 1st 2012 Q7 Output the facility id that has the highest number of slots booked. Ensure that in the event of a tie, all tieing results get output. Q8 Produce a list of members, along with the number of hours they've booked in facilities. Rank them by the number of hours producing output of first name, surname, hours, rank. Sort by rank, surname, and first name. Q9 Produce a list of the top three revenue generating facilities (including ties). Output facility name and rank, sorted by rank and facility name. Q10 For each day in August 2012, calculate a rolling average of total revenue over the previous 15 days. Output should contain date and revenue columns, sorted by the date. Remember to account for the possibility of a day having zero revenue.

club-operation-sql-frame's People

Contributors

santoshyadav121 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.