Load data from a list into the Table
Using the multiple insert pattern, in this exercise, you will load the data from values_list into the table.
Bu egzersiz, kursun bir parçasıdır
Introduction to Databases in Python
Egzersiz talimatları
- Import
insertfromsqlalchemy. - Build an insert statement for the
censustable. - Execute the statement
stmtalong withvalues_list. You will need to pass them both as arguments toconnection.execute(). - Print the
rowcountattribute ofresults.
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
# Import insert
# Build insert statement: stmt
# Use values_list to insert data: results
# Print rowcount
print(____)