🔼 MAX() – Find the Largest Value in SQL

🔧 Quick Syntax

SELECT MAX(column_name)
FROM table_name;

This tells SQL:

“Go through this column and tell me the biggest value you see.”

🧾 Here’s the Table You’re Working With

Your table is called orders:

order_id customer_name total_amount
1Fenn Rask10.00
2Milo Kresh45.00
3Sora Dune15.99
4Lexa Vohn72.50
5Tovi Glint29.99

✅ Suppose You Want the Highest Order Value

SELECT MAX(total_amount)
FROM orders;

💡 Output:

72.50

SQL checked the total_amount column and gave you the largest value it found — Lexa’s big order.


✅ MAX() Works with Dates Too

If your table had an order_date column, you could find the most recent order like this:

SELECT MAX(order_date)
FROM orders;

SQL would return the latest date — perfect for dashboards and time-based reports.


✅ Suppose You Want the Max From Orders Below $50

SELECT MAX(total_amount)
FROM orders
WHERE total_amount < 50;

💡 Output:

45.00

SQL filtered the rows first, then told you the max from the remaining group. Efficient and flexible.


🧃 Recap – What You Learned

  • MAX() finds the largest value in a column
  • Works with numbers, dates, and text
  • NULL values are skipped
  • Use WHERE to apply conditions before finding the max
  • Great for top sales, latest activity, or biggest scores

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top