Exercise - Return a specific number of rows by using the take operator

Completed

You can use a Kusto query to explore datasets and gain insights. Recall that you have an unfamiliar meteorological dataset and want to explore what you can learn from this data.

Here, you'll look at the data's structure to understand what kinds of questions you can ask about these storm events.

Write your first query

Let's look at a sample of the data so you can get to know the columns and types of data in the table. You don't need to see all rows, just a few examples.

The take operator is perfect for this task, because it returns a specific number of arbitrary rows.

  1. Copy this query to your clipboard:

    Run the query

    StormEvents
    | take 5
    
  2. Paste the query into the query editor that you set up earlier.

  3. Notice that the query begins with a reference to the data table, StormEvents. This data is piped into the first and only operator, which then selects five arbitrary rows.

  4. Run the query by either selecting the Run button above the query window or selecting Shift + Enter on the keyboard.

  5. Check that your results are similar to the following example. The actual data in the rows might differ, because the rows are selected arbitrarily.

    Screenshot of query output with five arbitrary rows.

Explore the results

What do you notice about the results? Scroll to view the whole dataset. Here are a few takeaways:

  • Each event has a start and end time from the year 2007.
  • The EventType column shows different kinds of storms.
  • The state (in the State column) where each storm occurred is written in all capital letters.
  • The damages associated with each storm are found in two separate columns: DamageProperty and DamageCrops.