From the course: Advanced SQL for Application Development

Unlock the full course today

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

Challenge: Write a parameterized query in Python

Challenge: Write a parameterized query in Python

From the course: Advanced SQL for Application Development

Start my 1-month free trial

Challenge: Write a parameterized query in Python

(upbeat music) - Here's a challenge to practice your own skills at writing SQL queries using Python. So, this challenge is to write a function that executes a SQL query that retrieves all product orders. And for this example, I want you to pass in as a parameter the product type, and specify "fryer" instead of "oven," which we did earlier. Also, I want this query to return only product orders where the order quantity is greater than three. Now, don't use an N plus one query. You can specify three directly in the SQL string for that greater than three condition.

Contents