SQL is the dominant technology for accessing application data. It is increasingly becoming a performance bottleneck when it comes to scalability. Given its dominance, SQL is a crucial skill for all engineers.
A normalized database is normally made up of multiple tables. Joins are, therefore, required to query across multiple tables.
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
Information about pets is kept in two separate tables:
TABLE dogs id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(50) NOT NULL TABLE cats id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(50) NOT NULL
Write a query that select all distinct pet names.
See the example case for more details.
- Example case: Wrong answer
- Unique names: Wrong answer
- Cats have the same names as dogs: Wrong answer
- Various duplicate names: Wrong answer