Text Practice Mode
sql_cte_chatgpt
created Mar 17th, 13:52 by SergelenZorigt
0
29 words
20 completed
0
Rating visible after 3 or more votes
saving score / loading statistics ...
00:00
SELECT
c.CustomerID,
c.FirstName,
c.LastName,
SUM(o.OrderTotal) AS TotalSpent
FROM
Customers c
JOIN
Orders o ON c.CustomerID = o.CustomerID
GROUP BY
c.CustomerID, c.FirstName, c.LastName
ORDER BY
TotalSpent DESC
LIMIT 5;
c.CustomerID,
c.FirstName,
c.LastName,
SUM(o.OrderTotal) AS TotalSpent
FROM
Customers c
JOIN
Orders o ON c.CustomerID = o.CustomerID
GROUP BY
c.CustomerID, c.FirstName, c.LastName
ORDER BY
TotalSpent DESC
LIMIT 5;
