LoslegenKostenlos starten

Marketing the right vehicles

Your marketing team is interested in identifying the vehicles with greatest battery capacity. This will allow for them to work with car manufacturers to market these vehicles at various charging stations. Your job is to create a ranking for these vehicles, based on the battery capacity of each vehicle.

Diese Übung ist Teil des Kurses

<Kurs>Window Functions in Snowflake</Kurs>
Kurs ansehen

Übungsanweisungen

  • In the SELECT statement, retrieve the fields storing vehicle_model and battery_capacity from the ELECTRIC_VEHICLES.charging table.
  • Use a window function to return a ranking without gaps.
  • Determine the ranking by battery_capacity, from greatest to least.

Interaktive praktische Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

SELECT

	-- Return the vehicle model and battery capacity
    ___,
    ___,
    
    -- Use a window function to return a ranking without gaps
    ___() OVER(
      	-- Battery capacity from greatest to least
        ___
    ) AS battery_capacity_rank
    
FROM ELECTRIC_VEHICLES.charging;
Code bearbeiten und ausführen