Company: Docusign swe intern
Difficulty: medium
Problem Description You are managing the database for "The Yellow Pages" directory. Your task is to write a query that generates a pivot table showing a list of companies and their summary ratings or contact information across all available categories. Some companies pay for a promoted status ( is_promoted = 1 ), which affects how they are displayed and ordered in the results. Required Columns: company : The display name of the company. If the company is promoted, format as: [PROMOTED] {Company Name} If the company is not promoted, format as: {Company Name} Category Columns (e.g., Electrical , Elevator , etc.): A separate column is required for each unique category name present in the categories table, sorted alphabetically from left to right. The value in each category column depends on whether the company has reviews for that category, along with its promotion status: If the company has no reviews in a category, the value must be NULL (regardless of promotion status). If the company