From the course: Advanced SQL for Application Development
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Challenge: Write a parameterized query in Python
From the course: Advanced SQL for Application Development
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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Designing an ecommerce application database6m 5s
-
(Locked)
Creating tables and loading data4m 12s
-
(Locked)
Using environment variables for connection parameters3m 57s
-
Connecting to a database2m 28s
-
(Locked)
Parameterizing SELECT statements3m 37s
-
(Locked)
Avoiding N+1 queries7m 18s
-
(Locked)
Challenge: Write a parameterized query in Python43s
-
(Locked)
Solution: How to write a parameterized query in Python2m 21s
-
(Locked)
-
-
-
-
-
-