Untitled

 avatar
unknown
plain_text
a year ago
613 B
4
Indexable
-- 1. Update the payment status for a particular CustomerID
UPDATE bills
SET payment_status = 'paid' -- or 'unpaid', depending on the desired status
WHERE reservation_id = (
    SELECT reservation_id
    FROM reservations
    WHERE CustomerID = 1234567890123 -- Replace with the actual CustomerID
);

-- 2. Display the details from the bills table for the updated reservation
SELECT b.bill_id, b.reservation_id, b.total_amount, b.additional_charges, b.payment_status
FROM bills b
JOIN reservations r ON b.reservation_id = r.reservation_id
WHERE r.CustomerID = 1234567890123; -- Replace with the actual CustomerID
Editor is loading...
Leave a Comment