You are a Data Analyst working with a SaaS company's Customer Success team. The support engineers need to prioritize their backlog by immediately tackling the most critical, unresolved issues. You are given a support_tickets table containing information about customer issues. Write a SQL query to retrieve all tickets that currently have a status of 'Open' and a priority level of 'High' . Your query should return the ticket_id , customer_id , and issue_description . The results must be ordered by the created_at date from oldest to newest, ensuring the team addresses the oldest critical issues first. Table Schema ( support_tickets ): ticket_id (INTEGER): Unique identifier for the support ticket. customer_id (INTEGER): Identifier for the customer who raised the ticket. issue_description (TEXT): A brief description of the problem. status (VARCHAR): The current state of the ticket (e.g., 'Open', 'In Progress', 'Closed'). priority (VARCHAR): The urgency level of the ticket ('Low', 'Medium', 'High'). created_at (DATE): The date the ticket was submitted.
Table Setup (SQL Schema)
-- DDL: Create tables
CREATE TABLE support_tickets (
ticket_id SERIAL PRIMARY KEY,
customer_id INT NOT NULL,
issue_description TEXT NOT NULL,
status VARCHAR(20) NOT NULL,
priority VARCHAR(20) NOT NULL,
created_at DATE NOT NULL
);
-- DML: Insert sample data
INSERT INTO support_tickets (customer_id, issue_description, status, priority, created_at) VALUES
(501, 'Cannot access billing page', 'Open', 'High', '2023-11-01'),
(502, 'How to change password?', 'Closed', 'Low', '2023-11-02'),
(503, 'System crash on data export', 'Open', 'High', '2023-10-28'),
(504, 'Need help with API rate limits', 'In Progress', 'Medium', '2023-11-05'),
(505, 'Account completely locked out', 'Open', 'High', '2023-11-06'),
(506, 'Typo on the dashboard UI', 'Open', 'Low', '2023-11-07'),
(507, 'Integration failing silently', 'Pending', 'High', '2023-11-04'),
(508, 'Payment gateway throwing 500 error', 'Open', 'High', '2023-10-30');