Topfolio
Career TracksMicro Free CoursesTask CoursesPracticeInterview PracticeWork ExperienceProjects
Career TrackBlog
Support
Dashboard
Career TracksMicro Free CoursesTask Courses
SQL & Python
Interview Prep
Work ExperienceProjectsResume Feedback
CertificatesMy OrdersRefer & Earn
Join Community

Navigation

Dashboard
Learn
Career TracksMicro Free CoursesTask Courses
Practice
SQL & PythonInterview Prep
Career
Work ExperienceProjectsResume Feedback
My Stuff
CertificatesMy OrdersRefer & Earn
Join Community
Topfolio

Learn data analytics online. Real skills, real projects, real community.

courses

  • Career Tracks
  • Work Experience
  • Best Data Analyst Course in India
  • SQL Fundamentals
  • SQL Advanced
  • Python for Data
  • Micro Free Courses

practice

  • SQL Fundamentals Interview Test
  • SQL Advanced Coding Test
  • All Practice Tests

resources

  • How to Become a Data Analyst
  • SQL Interview Questions
  • Data Analyst Salary Guide
  • Free Datasets for Practice
  • SQL vs NoSQL Guide
  • Data Analyst vs Data Engineer vs Data Scientist

employers

  • Enterprise Screening
  • AI Proctoring Demo
  • Volume Pricing
  • Employer Portal

company

  • About
  • Terms
© 2026 Topfolio. All rights reserved.Made with ❤️ for aspiring analysts
Topfolio
Career TracksMicro Free CoursesTask CoursesPracticeInterview PracticeWork ExperienceProjects
Career TrackBlog
Support
Dashboard
Career TracksMicro Free CoursesTask Courses
SQL & Python
Interview Prep
Work ExperienceProjectsResume Feedback
CertificatesMy OrdersRefer & Earn
Join Community

Navigation

Dashboard
Learn
Career TracksMicro Free CoursesTask Courses
Practice
SQL & PythonInterview Prep
Career
Work ExperienceProjectsResume Feedback
My Stuff
CertificatesMy OrdersRefer & Earn
Join Community

Standard vs. Premium Priced Tracks by Genre (Pivot)

intermediate~7 min25 pts
📊 View Insights

Problem

Pricing wants a per-genre breakdown of how many tracks are sold at the standard $0.99 rate versus the premium rate (UnitPrice above $0.99). For every genre, produce one row with a count for each price tier, using conditional aggregation.

Return GenreId, Name, StandardPriceCount (tracks priced at exactly $0.99), and PremiumPriceCount (tracks priced above $0.99), ordered by GenreId ascending.

Note: in this catalog, pricing splits cleanly by genre -- music genres are entirely standard-priced, while video/TV genres (Science Fiction, TV Shows, etc.) are entirely premium-priced. Seeing an all-zero column for a given genre is expected, not a bug.

Schema: Genre

ColumnType
GenreIdINTEGER (Primary Key)
NameTEXT

Schema: Track

ColumnType
TrackIdINTEGER (Primary Key)
GenreIdINTEGER (Foreign Key -> Genre.GenreId)
UnitPriceNUMERIC(10,2)
PivotConditional AggregationFlipkart
📊
📊 View Question Telemetry & Insights
Failure rate, silent bug autopsy & optimal query construction
Inspect →

Master SQL & Data Analytics

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.

Explore the 12-Week Data Analyst Career Track

Related questions

  • CASE: Create Price Tiersbeginner
  • Customer Lifetime Value with Tier Classificationadvanced
  • Catalog Snapshot Reportintermediate
  • Regional Revenue Slice (2012–2013)intermediate
  • Tracks That Never Soldintermediate
  • Top Genres by Revenueintermediate
  • Genres With Above-Average Pricingintermediate
  • First-Purchase Cohort Count by Monthintermediate
SQL Editor

Run your code to see the result here.

Topfolio

Learn data analytics online. Real skills, real projects, real community.

courses

  • Career Tracks
  • Work Experience
  • Best Data Analyst Course in India
  • SQL Fundamentals
  • SQL Advanced
  • Python for Data
  • Micro Free Courses

practice

  • SQL Fundamentals Interview Test
  • SQL Advanced Coding Test
  • All Practice Tests

resources

  • How to Become a Data Analyst
  • SQL Interview Questions
  • Data Analyst Salary Guide
  • Free Datasets for Practice
  • SQL vs NoSQL Guide
  • Data Analyst vs Data Engineer vs Data Scientist

employers

  • Enterprise Screening
  • AI Proctoring Demo
  • Volume Pricing
  • Employer Portal

company

  • About
  • Terms
© 2026 Topfolio. All rights reserved.Made with ❤️ for aspiring analysts