SQLite¶
Import packages¶
Usage¶
Creating a database¶
Creating a connection¶
Creating a cursor¶
Creating a table¶
Getting table information¶
Inserting data into a table¶
With execute
With execute many.
Query data¶
{'id': 1, 'name': 'John Doe', 'age': 33, 'department': 'Machine Learning Engineering'}
{'id': 2, 'name': 'Jane Smith', 'age': 29, 'department': 'Data Science'}
{'id': 3, 'name': 'Alice Brown', 'age': 40, 'department': 'HR'}
{'id': 4, 'name': 'Michael Johnson', 'age': 45, 'department': 'Finance'}
{'id': 5, 'name': 'Emily Davis', 'age': 27, 'department': 'Marketing'}
{'id': 6, 'name': 'Robert Wilson', 'age': 38, 'department': 'Software Engineering'}
Update table data¶
Check for the updated data.
Delete data from table¶
Check for deleted data.
Make rows behave like dictionaries¶
{'id': 1, 'name': 'John Doe', 'age': 33, 'department': 'Machine Learning Engineering'}
{'id': 3, 'name': 'Alice Brown', 'age': 40, 'department': 'HR'}
{'id': 4, 'name': 'Michael Johnson', 'age': 45, 'department': 'Finance'}
{'id': 5, 'name': 'Emily Davis', 'age': 27, 'department': 'Marketing'}
{'id': 6, 'name': 'Robert Wilson', 'age': 38, 'department': 'Software Engineering'}