1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to SQL Server

Connected

Exercise

Order by

In this exercise, you'll practice the use of ORDER BY using the grid dataset. It's loaded and waiting for you! It contains a subset of wider publicly available information on US power outages.

Some of the main columns include:

  • description: The reason/ cause of the outage.
  • nerc_region: The North American Electricity Reliability Corporation was formed to ensure the reliability of the grid and comprises several regional entities.
  • demand_loss_mw: How much energy was not transmitted/consumed during the outage.

Instructions 1/2

undefined XP
  • 1

    Select description and event_date from grid. Your query should return the first 20 rows, ordered by event_date.

  • 2

    Select description, nerc_region, and event_date from grid, returning the first 20 rows ordered by nerc_region, affected_customers, and event_date (in that order); event_date should be in descending order.