Add new customers

Report a typo

In this task we'll work with the Customers table. Below you can see an example of its structure. In the input you'll get information about 3 new customers (CustomerName, Address, City, PostalCode, Country). Put all customers in a list and use executemany() to insert the data in the table. Finally, commit the changes.

CustomerID CustomerName Address City PostalCode Country
1 Gerhard Häring Rosenweg 20 Berlin 97215 Germany

The information of each client is separated by semicolons.

Sample Input 1:

Jean-Guy Lauzon;2960 Rue St. Laurent;Montréal;84100;Canadá
Beatriz Pinzón;Calle 56 no 4-82;Bogotá;11011;Colombia
Elio Rossi;Viale Dante 75;Ravenna;48100;Italy

Sample Output 1:

3
Write a program in Python 3
# Put your code here

cursor.executemany('INSERT INTO customers(CustomerName, Address, City, PostalCode, Country) VALUES (...)
con.commit()
___

Create a free account to access the full topic