เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Adding row numbers to charging sessions

Throughout the course, you'll build window functions using the charging table in the ELECTRIC_VEHICLES Snowflake schema. Each record in this table contains information about a "charging" session for an electric vehicle.

You'll start by using a window function to add a row number to each record.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Window Functions in Snowflake

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Add to the SELECT statement to return the charging_station_location and user_id fields.
  • Using a window function, assign a row number to each record and sort by charging_cost.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

SELECT
	-- Return the charging_station_location and user_id
    ___,
    ___,
    charging_start_time,
    charging_cost,
    
    -- Assign a row number to each record, ordering by charging_cost
    ___() ___(___ ___ ___)
    
FROM ELECTRIC_VEHICLES.charging;
แก้ไขและรันโค้ด