A support team's tickets table contains the following complete data. attempts counts contact attempts, and resolved is 1 for resolved tickets and 0 otherwise.
ticket_id
priority
attempts
resolved
801
high
1
0
802
4
803
normal
804
2
805
3
806
SELECT ticket_id FROM tickets WHERE resolved = 0 AND (priority = 'high' OR attempts >= 3);
How many rows does this query return? Answer as an integer row count, to zero decimal places.
Unlock full course notes by signing up
Trace filtered and sorted inventory values
A retailer's products table contains the following complete data. Unit prices are in USD per item, and stock values are item counts.
Complete the three result rows in their returned order. Enter product identifiers and inventory values as exact integers; inventory values are in USD.
Keep distinct delivery combinations
A delivery company stores the following seven records in delivery_options. Fees are exact whole numbers of US dollars, and every value is non-NULL.
The company runs this single-table query:
Complete the four output rows in their returned order. Enter each zone exactly as shown and each fee as an exact integer in US dollars.
Repair a balance-report condition
A club stores member_id, active, and balance in members. Active members have active = 1; inactive members have active = 0. Balances are USD amounts, and NULL means the balance is unrecorded. A balance of zero means nothing is owed.
The report must return active members whose balances are either positive or unrecorded. Which WHERE clause meets that requirement for every possible row?
Trace pages after order totals change
A dashboard uses pagination to display orders from a PostgreSQL table. Initially, orders contains exactly these seven records. Each order_id is unique, and total_usd is an exact order total in US dollars.
The first page is fetched with:
After the first page is fetched, two orders are added: order 508 with a total of 200 USD and order 509 with a total of 150 USD. Order 507 is also changed from 100 USD to 175 USD. No other records change, and no records are deleted.