Question: For my middleware programming class, I'm trying to code so my python code will use database from mysql. I don't need help creating the query

For my middleware programming class, I'm trying to code so my python code will use database from mysql. I don't need help creating the query in SQL.

Here are the tables I'm trying to add. Any help will be appreciated. Here's an example the professor used to code:

conn = MySQLdb.connect( host=DB_HOST, user=DB_USER, passwd=DB_PASSWORD, db=DB_NAME) cur = conn.cursor() cur.execute(""" select * from manufacturer where name="%s" and registered_country="%s" """, (name, country, ) );

cur.execute(""" insert into manufacturer (name, registered_country) values (%s,%s) """, (name, country,) );

Manufacturer

name:String

registered_country:String

contact_person: User

+ add the relevant setters and getters methods

TestResults

dataSource: TestLab

product: Product

reportingCondition:String

testSquence:String

testDate:date

isc:float

voc:float

imp:float

vmp:float

pmp:float

ff:float

noct:float

+ add the relevant methods

User

username:String

password: String

first name:String

middle name:String

last name:String

address:String

officePhone:String

cellphone:String

email:String

+ add the relevant methods

TestLab

name:String

address:String

contact_person: User

+ add the relevant methods

Product

modelNumber:String

manufacturer: Manufacturer

manufacturingDate: date

length:float

width:float

weight: float

cell area: float

cell technology: String

total number of cells: int

number of cells in series: int

number of series strings: int

number of bypass diodes: int

series fuse rating: float

interconnect material: String

interconnect supplier: string

superstrate type: string

superstrate manufacturer: string

substrate type: string

substrate manufacturer: string

frame material: string

frame adhesive: string

encapsulant type: string

encapsulant manufacturer: string

junction box type: string

junction box manufacturer: string

junction box adhesive: string

cable type: string

connector type: string

maximum system voltage: float

rated voc: float

rated isc: float

rated vmp: float

rated imp: float

rated pmp: float

rated ff: float

+ add the relevant methods

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!