In this week’s puzzle we are going to try to figure out how many uppercase, how many lowercase characters are in a column, we are also interested in how many are neither uppercase or lowercase
Here is the table and the data
CREATE TABLE Puzzle
     (Col1 varchar(10));
 
INSERT INTO Puzzle (Col1)
SELECT 'ABCD01234Z'
UNION ALL
SELECT 'AAAAAAAAAA'
UNION ALL
SELECT 'aaaaaaaaaZ'
UNION ALL
SELECT 'a&a&a&a&aA'
UNION ALL
SELECT '1234Tt7890'
This is the expected output
Col1 UpperCase LowerCase Neither ABCD01234Z 5 0 5 AAAAAAAAAA 10 0 0 aaaaaaaaaZ 1 9 0 a&a&a&a&aA 1 5 4 1234Tt7890 1 1 8
For bonus points, you can add 3 more columns to the output, one column will hold only uppercase characters, one column will hold only lowercase characters, one column will hold only characters that are neither uppercase or lowercase

 Denis has been working with SQL Server since version 6.5. Although he worked as an ASP/JSP/ColdFusion developer before the dot com bust, he has been working exclusively as a database developer/architect since 2002. In addition to English, Denis is also fluent in Croatian and Dutch, but he can curse in many other languages and dialects (just ask the SQL optimizer) He lives in Princeton, NJ with his wife and three kids.
Denis has been working with SQL Server since version 6.5. Although he worked as an ASP/JSP/ColdFusion developer before the dot com bust, he has been working exclusively as a database developer/architect since 2002. In addition to English, Denis is also fluent in Croatian and Dutch, but he can curse in many other languages and dialects (just ask the SQL optimizer) He lives in Princeton, NJ with his wife and three kids.