Skip to content
C

Products Table CRUD

Easypython

Using sqlite3, create a products table (id, name, price), insert the given products, then query and print all of them.

Approach: connect to an in-memory SQLite database, CREATE TABLE, INSERT each product with a parameterized query, then SELECT * (ordered by id for a predictable order) and print each row.

Input: First line: the number of products n. Next n lines: name,price.

Output: n lines: each product as a tuple (id, name, price).

Input (stdin)

Output

Run your code to see output here...