text
stringlengths
0
300
Find all airlines that have at least one flight out of AXX airport. Report the full name and the abbreviation of each airline
Find all destinations served from the AXX airport by Northwest. Re- port flight number, airport code and the full name of the airport.
Find all airports served by ALL five of the airlines listed below: Delta, Frontier, USAir, UAL and Southwest. Report just the airport codes.
Find all airports that are served by at least three Southwest flights. Report just the three-letter codes of the airports
Find the number of airports from which airport ANP can be reached with exactly one transfer.
Find the number of airports from which airport ATE can be reached with at most one transfer. (make sure to exclude ATE itself from the count). Report just the number.
Find all airports with exactly 17 outgoing flights. Report airport code and the full name of the airport
For each room report the total revenue for all stays and the average revenue per stay generated by stays in the room that originated in the months of September
https://psfotis.github.io/sqlseminar/exercises/
https://psfotis.github.io/sqlseminar/exercises/
https://www.classes.cs.uchicago.edu/archive/2015/spring/23500-1/hw3.html
q5. Retrieve the titles of all papers with a single author.
q6. Retrieve the titles and number of affiliated institutions of all papers with authors from more than one institution.
q7. Retrieve the title(s) and number of authors of the paper(s) with the most authors in the database instance. For example, if there is one paper with three authors in the whole batch, and every other paper has one or two authors (that's the case in the database you are given), identify that paper.
q8. Retrieve the authors' authID, first and last names, in alphabetical order, and the number of papers on which they have authorship.
q9. Retrieve the authID, first and last name of the author(s) and their number of collaborators (shared authorships), in alphabetical order.
http://users.csc.calpoly.edu/~dekhtyar/365-Spring2017/index.html
Find all modern rooms with a base price below $160 and two beds. Report room names and codes
Find all rooms occupied on February 6, 2010. Report full name of the room, the check-in and checkout dates of the reservation.
For each reservation that starts on December 31, 2010 report the room name, nightly rate, number of nights spent and the total amount of money paid.
Find the names of all people1 staying at the inn at the same time as HERBERT FRYDAY.
Find the number of August reservations (both checkin and checkout dates are in August) where two adults are staying with two children.
Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations
Find the room that has been occupied the largest number of days based on the reservations. Report the room name
For each room, report the most expensive reservation. Report the full room name, dates of stay
https://github.com/XD-DENG/SQL-exercise
Who receieved a 1.5kg package?
What is the total weight of all the packages that he sent?
select client.name
from client join Package
on client.AccountNumber = Package.Recipient
where package.Weight = 1.5;
select sum(weight) from Package
where Sender = (
select Recipient from Package where Weight = 1.5
);
SELECT SUM(p.weight)
FROM Client AS c
JOIN Package as P
ON c.AccountNumber = p.Sender
WHERE c.Name = "Al Gore's Head";
http://users.csc.calpoly.edu/~dekhtyar/365-Spring2017/index.html
Find all students who study in classroom 111. For each student list first and last name.
For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.
Find all teachers who teach fifth grade. Report first and last name of the teachers and the room number.
Find all students taught by OTHA MOYER. Output first and last names of students
For each teacher teaching grades K through 3, report the grade (s)he teaches. Each name has to be reported exactly once.
Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names
Find and report the number of students taught by LORIA ONDERSMA.
For each grade, report the number of classrooms in which it is taught and the toal number of students in the grade.
Report the names of teachers who have between seven and eight students in their classes.
For each kindergarden classroom, report the total number of students.
Find the teacher name who teach(es) the largest number of students.
Findallclassroomswhichhavefewerstudentsinthemthantheaverage number of students in a classroom in the school. Report the classroom numbers
For each grade with more than one classroom, report the last name of the teacher who teachers the classroom with the largest number of students in the grade.
*****************************************************
CPE 365 Alex Dekhtyar
Cal Poly Computer Science Department
San Luis Obispo College of Engineering
California dekhtyar@csc.calpoly.edu
*****************************************************
WINE DATASET
Version 1.0
March 27, 2011
************************************************************
Sources: This dataset contains wine ratings from a
collection of 2007-2011 Wine Spectator magazines