Use a scalar subquery in the SELECT clause to add computed values. Show each artist alongside the total number of artists in the database.
Write a query that shows each artist name with the total artist count as a reference.
| Column | Type |
|---|---|
| ArtistId | INTEGER (Primary Key) |
| Name | TEXT |
SELECT column, (SELECT COUNT(*) FROM table) AS Total FROM table;
Ready to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.