AI Features

Question: Using FIRST_VALUE(), LAST_VALUE(), and NTH_VALUE()

Check your understanding of using FIRST_VALUE(), LAST_VALUE(), and NTH_VALUE() window functions in SQL.

Question

Consider the following Sales table structure:

SalesID

Month

SalesAmount

1

January

1500

2

February

1400

3

March

1200

4

April

1600

5

May

800

6

June

6400

7

July

2400

8

August

2100

9

September

700

10

October

1000

11

November

5400

12

December

7400

As a ...

Ask