From the course: Fundamentals of Data Transformation for Data Engineering
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
SQL bonus solution - SQL Tutorial
From the course: Fundamentals of Data Transformation for Data Engineering
SQL bonus solution
(upbeat music) - [Instructor] Okay, so we're back and we're going to talk about the solutions to our bonus SQL challenge. This one's more for fun, again, I wouldn't take this one as seriously as the rest of the course, but that's the whole point, right? We're trying to have fun. So if we run this cell, we can see an example of our data frame, and the first question, write a query that splits the winning numbers into separate columns. Your query should return a result with columns. There are the columns, and the way to do this is just to use split_part. This is a DuckDB function that you kind of have to look elsewhere to find, but we're splitting each part of that space-separated list of numbers, so one through six as well as a multiplier that is in its own column, and we can even rename this to multiplier. So there you go. Using the above as a base, we're going to write a new query that returns a table where each drawn number represents a row and each column is the count of…