SQLite is a very popular relational database used in a wide variety of applications. Unlike other databases like MySQL, Oracle, etc., SQLite is a transactional SQL database engine that is self-contained and serverless. The entire database is a single file that can be placed anywhere in the file system. To access SQLite from Python, we need an SQLite driver for Python. Fortunately, the SQLite driver for Python is already included in Python standard library so we don’t need to install this.
Now we can create a database and table using SQLite in Python as shown below.
When you run the code, the database and table are created. If you want to see whether the table is created or not, run the code two times because the second time it throws an error that the table already exists as shown above.
Comments (No)