Query Results

Run a query to see results.

Database Schema

Schema undefined.
Code Editor
Learn
Date, Number, and String Functions

Numbers II

A couple more useful numeric SQL functions are included below: MAX and MIN.

MAX(n1,n2,n3,...): returns the greatest value in the set of the input numeric expressions MIN(n1,n2,n3,...): returns the least value in the set of the input numeric expressions

In our baked_goods table, in addition to the numeric ingredients_cost we have information about the packaging cost located in the packaging_cost column. We can use the MAX function to determine the overall greatest value of cost for each item using the following query:

SELECT id, MAX(ingredients_cost, packaging_cost) FROM baked_goods;
Report a Bug
If you see a bug or any other issue with this page, please report it here.