Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A query of the table information for table Supplier returns the following information: cid name type notnull dflt _ value pk 0 Id INTEGER 0
A query of the table information for table Supplier returns the following information:
cid name type notnull dfltvalue pk
Id INTEGER None
CompanyName TEXT None
ContactName TEXT None
ContactTitle TEXT None
City TEXT None
Country TEXT None
Phone TEXT None
Fax TEXT None
A query of the table information for table Customer returns the following information:
cid name type notnull dfltvalue pk
Id INTEGER None
FirstName TEXT None
LastName TEXT None
City TEXT None
Country TEXT None
Phone TEXT None
A query of the table information for table Product returns the following information:
cid name type notnull dfltvalue pk
Id INTEGER None
ProductName TEXT None
SupplierId INTEGER None
UnitPrice REAL
Package TEXT None
IsDiscontinued INTEGER
A query of the table information for table Order returns the following information:
cid name type notnull dfltvalue pk
Id INTEGER None
OrderDate TEXT None
OrderNumber TEXT None
CustomerId INTEGER None
TotalAmount REAL
A query of the table information for table OrderItem returns the following information:
cid name type notnull dfltvalue pk
Id INTEGER None
OrderId INTEGER None
ProductId INTEGER None
UnitPrice REAL
Quantity INTEGER
Your Task
Write a function called BoxedProductIDPlease do not change the signature preloaded in the answer box!
Your function should do the following:
Query the database to retrieve data about the product whose Id is supplied as the ProductID parameter.
If the package field for the specific product contains the text "box" anywhere in its text, either as a whole word or a substring, the function should return the value True otherwise the function should return the value False.
You may assume only lowercase letters is used in the package field.
For example:
Test Result
printBoxed
True
printBoxed
False
EKS:
def BoxedProductID:
import sqlite
conn sqliteconnectNorthwinddb
#Your code goes here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started