What is the average number of bookings for each hotel in August?
What will be an ideal response?
SELECT AVG(X)
FROM ( SELECT hotelNo, COUNT(hotelNo) AS X
FROM Booking b
WHERE (dateFrom <= DATE’2004-08-01’ AND
dateTo >= DATE’2004-08-01’) OR
(dateFrom >= DATE’2004-08-01’ AND
dateFrom <= DATE’2004-08-31’)
GROUP BY hotelNo);
Yes - this is legal in SQL-92!
You might also like to view...
The Office Clipboard only holds a single item
Indicate whether the statement is true or false
The future_value argument of the Pmt Function is the amount that is being borrowed
Indicate whether the statement is true or false
COGNITIVE ASSESSMENT Which of the following is recommended to avoid malware infections?
A. Some software touted as offering malware protection actually installs more malware. B. Flash memory storage from a friend should be safe to use without scanning. C. Malware authors typically avoid social media. D. If a pop-up window warns you that your computer is infected with a virus, follow its instructions.
Which of the following statements is false?
a. When the app first executes, onCreate is called after onStart. b. When the app is running in portrait orientation and the user opens the Set-tings-Activity, the MainActivity is stopped while the SettingsActivity is displayed. When the user returns to the MainActivity, onStart is called again. c. To get a reference to the MainActivityFragment so we can call its methods, use inherited AppCompatActivity method getSupportFragmentManager to get the FragmentManager, then call its findFragmentById method. d. Each of the above statements is true.