SQL Business Analysis Project: Individual Tracks vs Album Tracks

Screen Link:

My Code:

%%sql

DROP VIEW IF EXISTS tracks_grpdby_album_id;

CREATE VIEW tracks_grpdby_album_id AS
    SELECT 
        tr.album_id,
        COUNT(tr.track_id) Tracks_on_Album
    FROM invoice_line il
    LEFT JOIN track tr on tr.track_id = il.track_id
    GROUP BY tr.album_id
    ORDER BY 1;

DROP VIEW IF EXISTS tracks_grpdby_invoice_id;

CREATE VIEW tracks_grpdby_invoice_id AS
    SELECT 
        il.invoice_id,
        COUNT(tr.track_id) Tracks_on_Invoice,
        tr.album_id album_id
    FROM invoice_line il
    INNER JOIN track tr on tr.track_id = il.track_id
    GROUP BY 1,3 ORDER BY 1;

SELECT
    tracks_grpdby_invoice_id.*,
    tracks_grpdby_album_id.Tracks_on_Album
    FROM tracks_grpdby_invoice_id
    INNER JOIN tracks_grpdby_album_id on tracks_grpdby_album_id.album_id = tracks_grpdby_invoice_id.album_id;

DROP VIEW IF EXISTS album_purchase_count;

CREATE VIEW album_purchase_count AS
    SELECT 
        tracks_grpdby_invoice_id.invoice_id, 
        CASE    
            WHEN(
                tracks_grpdby_invoice_id.Tracks_on_Invoice = tracks_grpdby_album_id.Tracks_on_Album
                )THEN 'Album Purchase'       
            ELSE 'Individual Tracks'    
            END
            AS album_purchase_ornot
        FROM tracks_grpdby_invoice_id
        INNER JOIN tracks_grpdby_album_id on tracks_grpdby_album_id.album_id = tracks_grpdby_invoice_id.album_id;

SELECT 
    COUNT(invoice_id) Number_of_Invoices,
    CAST(COUNT(invoice_id) AS FLOAT)/ (Select COUNT(invoice_id)
                       FROM invoice 
                       )
                        Percentage_of_invoices
    FROM album_purchase_count
    WHERE album_purchase_ornot = 'Album Purchase';

What I expected to happen:

I need 18% or ~114 of the invoices to be albums.

What actually happened:

Only 30 invoices matched all tracks on Album