subject

import sqlite3 from contextlib import closing conn = sqlite3.connect("books. sqlite") conn. row_factory = sqlite3.Row with closing(conn. cursor()) as c: query = '''SELECT * FROM Book WHERE pages > ?''' c. execute(query, (100,)) books = c. fetchall() for book in books: print(book["name"], "|", book["author"], "|", book["pages"]) name = "The Case of the Killer Kangaroo" author = "Jane Doe" pages = 408 genreID = 1 with closing(conn. cursor()) as c: query = '''INSERT INTO Book (name, author, pages, genreID) VALUES (?, ?, ?, ?)''' c. execute(query, (name, author, pages, genreID)) connmit() print(name, "inserted.") author = "Katie Kanga" with closing(conn. cursor()) as c: query = '''UPDATE Book SET author = ? WHERE name = ?''' c. execute(query, (author, name)) connmit() print(name, "updated.")

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:30
What characteristic of long period comets suggest they come directly from the oort cloud?
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Norder to receive financial aid at his vocational school, mario must fill out the fafsa. the fafsa is a form that must be completed to determine . in order to complete a fafsa, you must submit . the fafsa can students obtain
Answers: 2
You know the right answer?
import sqlite3 from contextlib import closing conn = sqlite3.connect("books. sqlite") conn. row_fact...
Questions
question
Mathematics, 19.11.2020 19:00
question
Mathematics, 19.11.2020 19:00
question
Mathematics, 19.11.2020 19:00
question
Chemistry, 19.11.2020 19:00
Questions on the website: 13722367