Company: DocuSign_6april
Difficulty: medium
Problem Description A registrar's control panel keeps track of every domain name it hosts. To help owners plan ahead, write a SQL query that lists each domain alongside today's fixed date, its upcoming renewal date, and how many days remain until that renewal happens. The results should be sorted in ascending order by days_until_renewal , followed by ascending order by name . Schema The domains table is structured as follows: name : VARCHAR(255) - The name of the domain. next_renewal_date : VARCHAR(19) - The date and time when the domain is scheduled for its next renewal (format: 'YYYY-MM-DD HH:MM:SS'). Required Output The query should return a result set with the following columns in this exact order: name - The name of the domain. today_date - The current date, strictly formatted as YYYY-MM-DD (i.e., '2024-04-10'). next_renewal_date - The date of the domain's next renewal, formatted strictly as YYYY-MM-DD (omitting the time component). days_until_renewal - The integer number of full