Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
