What's wrong with my code? Followed video

USE sql_invoicing;
select
date,
sum(amount) as total_payments

from payments

group by date
order by date

THE sum is blackened. Problem with it? Error:

0 20 16:32:51 select date, sum(amounts) as total_payments from payments group by date order by date LIMIT 0, 5000 Error Code: 1146. Table ‘sql_store.payments’ doesn’t exist 0.016 sec

Summarising Data - The Group By clause video

It means that MySQL cannot find the table payments in the sql_store database.
This is not a syntax problem with your SUM() query — it’s a missing table/database issue.

  1. Wrong database selected — You might be connected to sql_store, but that database doesn’t have a payments table.

  2. Table name mismatch — The table might have a different name (e.g., payment, customer_payments, orders).

  3. Database not loaded — If you’re following a tutorial (like Mosh Hamedani’s SQL course), the sample database might not have been imported.