-- name: CreateTicket :one
INSERT INTO tickets (amount, total_odds)
VALUES ($1, $2)
RETURNING *;

-- name: GetAllTickets :many
SELECT * FROM tickets;

-- name: GetTicketByID :one
SELECT * FROM tickets WHERE id = $1;

-- name: DeleteTicket :exec
DELETE FROM tickets WHERE id = $1;

-- name: DeleteOldTickets :exec
Delete from tickets where created_at < now() - interval '1 day';
