Skip to content
SQLSimplified
BackendQuestion 49 of 52

Optimizing Lookups with Indexes

Problem

Customers are complaining that logging in by email is extremely slow. The database is doing a full table scan on millions of users just to find one email. Write a DDL statement to create an index named idx_emp_salary on the employees table for the salary column to speed up compensation reports.

Database Schema

This problem acts as a scratchpad. You will write your own DDL/DML or conceptual queries, so there is no predefined schema.

Try It

Loading playground environment...

Hint

Solution