Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Single-column indexes
Multi-column indexes
Additional options when creating indexes
Summary
11. Summary

Instruction

Awesome! It's time to wrap things up.

  1. To create an index on a single column, use:
    CREATE INDEX points_index
    ON player(current_points);
  2. To create a multi-column index, use:
    CREATE INDEX player_multi_country_points_index
    ON player(country, current_points);
  3. To specify the sorting direction, add ASC or DESC after the column name. To specify the position for NULL values, add NULLS FIRST or NULLS LAST:
    CREATE INDEX player_multi_country_points_index
    ON player(country, current_points DESC NULLS LAST);
  4. To delete an index, use:
    DROP INDEX points_index;

How about a pop quiz before we move on to the next part?

Exercise

Click Next exercise to continue.