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 procedure called CustomerLookupSurnamePlease do not change the signature preloaded in the answer box!
Your procedure should do the following:
For the given Surname you should query the database and retrieve any Customers where the customer LastName or part of it matches the surname given as parameter. Please note that the case of the input SMITH vs "smith" vs "Smith" will not matter if the correct SQL statement is used. You can completely ignore case and just focus on using the correct SQL in your WHERE clause.
Print a line stating "All possible matches"
Print the data for each matching record found one line at a time using the format
'Name: FirstName Surname: LastName Phone: Phone'
Please see examples below:
For example:
Test Result
CustomerLookupSoap
All possible matches
CustomerLookupriot
All possible matches
FirstName: Pdef CustomerLookupSurname:
import sqlite
conn sqliteconnectNorthwinddb
# Your code goes here
cursor conn.cursoraul LastName: Henriot Phone:
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
