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 joining data from multiple tables.
Motivation: Most of the queries into a normalized database require joining data from multiple tables.
Each item in a web shop belongs to a different seller. To ensure service quality, each seller has a rating.
The data are kept in the following two tables:
TABLE sellers id INTEGER PRIMARY KEY, name VARCHAR(30) NOT NULL, rating INTEGER NOT NULL TABLE items id INTEGER PRIMARY KEY, name VARCHAR(30) NOT NULL, sellerId INTEGER REFERENCES sellers(id)
Write a query that selects the item name and the name of its seller for each item that belongs to a seller with a rating of more than 4.
See the example case for more details.
- Example case: Wrong answer
- Single seller with single item: Wrong answer
- Top rated sellers: Wrong answer
- Various sellers: Wrong answer