Company: Docusign swe intern
Difficulty: medium
Problem Description You maintain the database behind a business directory called "The Yellow Pages." Write a query that builds a pivot table listing every company alongside its rating summary (or contact info) for each category it has been reviewed under. Some companies pay for promoted placement ( is_promoted = 1 ), which changes both how their row is formatted and where it lands in the sort order. 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.): Produce one column per distinct category name found in the categories table, ordered alphabetically left to right. What goes in a company's cell for a given category depends on whether it has reviews there and on its promotion status: If the company has no reviews in that category, the cell must read NULL regardless of promotion status. If it has reviews a