RienSQL
TASK #33 · Medium

Average price of caviar

Your brief
Find the average price of caviar based on the data stored in the Payments table. The database stores data on purchases of red caviar and black caviar. The query result should contain one line with the average price of all caviar ever bought. Compute the simple average of unit_price over all purchases, without weighting by amount.
Expected columnscostFamily
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
family_membersmember_id, status, member_name, birthday
goodsgood_id, good_name, type
good_typesgood_type_id, good_type_name
paymentspayment_id, family_member, good, amount, unit_price, date