From the course: Advanced SQL for Application Development

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Solution: How to write a parameterized query in Python

Solution: How to write a parameterized query in Python

From the course: Advanced SQL for Application Development

Start my 1-month free trial

Solution: How to write a parameterized query in Python

(bright upbeat music) - [Instructor] Let's take a look at the solution to the challenge. Here, I've created a function called, get product orders by type two. Now this looks similar to the get product orders by type that we created earlier. But I want to point out a difference. Here in the sequel string, we have our select and we're selecting start from our product order. We're using an inner join, remember we don't want to do than N+ 1 query and we still have the same on clause because the keys in product order and product are the same, the only difference is, is that we add another condition. We say and product order or PO.quantity is greater than three. So let's execute this, let's define that and let's actually execute it. So we'll say, get product orders and one nice thing about Jupiter if you hit tab, it'll give you the Command complete and I'm going to say order by two, I'm not going to pass in our…

Contents