Analyzing Daily Hospital Admissions and Their Variations
Medium
18
1
78.1% Acceptance
For each day, compute the total number of admissions. Additionally, calculate the difference in the number of admissions from the previous day.
Concepts to understand:

Aggregate Functions: These are SQL functions that perform a calculation on a set of values and return a single value. Examples include
SUM()
,COUNT()
,AVG()
, etc. 
Window Functions: These are special SQL functions that perform calculations across a set of rows related to the current row. An example in this exercise would be
LAG()
, which can fetch data from a previous row.
Your goal is to write an SQL query that accomplishes the given task. Remember, focus on the structure of your query, the use of aggregate functions, and the application of window functions where necessary. Good luck!