The testing process: Selecting queries which correctly perform a given task.
Motivation: SQL is the dominant technology for accessing application data and is more and more becoming a performance bottleneck when it comes to scalability.
The testing process: Analyzing database queries using aggregate functions.
Motivation: A good programmer should be skilled at using aggregate functions when interacting with databases.
App usage data are kept in the following table:
TABLE sessions id INTEGER PRIMARY KEY, userId INTEGER NOT NULL, duration DECIMAL NOT NULL
Write a query that selects userId and average session duration for each user who has more than one session.
See the example case for more details.
- Example case: Wrong answer
- Users with several sessions: Wrong answer
- Various users: Wrong answer