Create a monthly sales dashboard and top music charts system for Chinook's management team to track business performance and identify trending music content.

## Your Tasks:

1. **Build the monthly sales summary table** — create a table called `monthly_sales_summary` in the `public` schema with:
   * `year_month` (varchar) — format as 'YYYY-MM' (e.g., '2009-01')
   * `total_invoices` (integer) — number of invoices in that month
   * `total_revenue` (decimal) — sum of all invoice totals for the month
   * `total_tracks_sold` (integer) — total quantity of individual tracks sold
   * `average_invoice_value` (decimal) — average invoice amount for the month
   * `unique_customers` (integer) — count of distinct customers who made purchases

2. **Create the music charts table** — build a table called `top_music_charts` in the `public` schema with:
   * `chart_type` (varchar) — either 'top_tracks', 'top_albums', or 'top_artists'
   * `rank_position` (integer) — ranking from 1 to 10
   * `item_id` (integer) — ID of the track, album, or artist
   * `item_name` (varchar) — name of the track, album, or artist
   * `total_revenue` (decimal) — total revenue generated by this item

3. **Populate the monthly sales data**:
   * Calculate metrics for each month that has invoice data
   * Use invoice date to determine the month
   * **Note**: Each invoice can contain multiple invoice lines (tracks)

4. **Generate the top 10 charts**:
   * **Top Tracks**: Rank tracks by total quantity sold across all invoices
   * **Top Albums**: Rank albums by total revenue generated from their tracks
   * **Top Artists**: Rank artists by total revenue from all their tracks across all albums

5. **Business rules to follow**:
   * Only include months where at least one invoice exists
   * For album rankings, sum revenue from all tracks in each album
   * For artist rankings, sum revenue from all tracks across all their albums
   * Handle ties by using item name alphabetically as tiebreaker
   * Exclude any items with zero sales

This system will provide clear, actionable business intelligence for monthly reporting and music trend analysis.