DynamikArray / Ciima

Comic Issue Inventory & Media Application
0 stars 0 forks source link

UPC Codes - Review with Bobby #84

Open DynamikArray opened 4 years ago

DynamikArray commented 4 years ago

Right now the only UPC Codes that we accept are 17 characters long.

SELECT   
    upcLength,
    COUNT(upcLength) AS totalUpcs
FROM (
        SELECT  
            LENGTH(i.upc) AS upcLength
        FROM slc_issues i 
            WHERE 
                i.upc is not null 
                    AND 
                i.upc <> ''
        ) lengths
GROUP BY 
    upcLength

Gave Us:

Length | Count 
"7" "4"
"8" "3"
"9" "4"
"10"    "250"
"11"    "51"
"12"    "5966"
"13"    "8977"
"14"    "19292"
"15"    "3613"
"16"    "162"
"17"    "124054"
"18"    "38436"
"19"    "33"
"20"    "4"
DynamikArray commented 4 years ago

18 Characters Length

SELECT  
    i.Title,
    COUNT(i.Title) AS issuesCount
FROM slc_issues i 
WHERE LENGTH(i.upc) = 18
GROUP BY
    i.Title
ORDER BY issuesCount DESC
SELECT  
    i.Title,
    i.IssueNum,
    i.FullIssue,
    i.upc,
    i.Variation,
    i.ComicType,
    DATE(i.CoverDate) AS coverDate
FROM slc_issues i 
WHERE LENGTH(i.upc) = 18
ORDER BY i.Title ASC

18 & 14 UPC Character Titles and Issues Lists https://docs.google.com/spreadsheets/d/1v49KTaZ8icRyjDguexFZXbvYdyleg2lJ35PYOPAzB9U/edit?usp=sharing