Sie sind auf Seite 1von 1

SQLite Snapshots

Please note the following steps to work with SQLite on Linux. The two scripts courses.sql and
teachers.sql are available separately. The python source code is referred by example_db.py.
After the DB gets created the python source code can be invoked using python interpreter.
bash-4.1$ ls -l
total 3
-rw-r--r-- 1 user_1 trg 560 Nov 3 2015 courses.sql
-rw-r--r-- 1 user_1 trg 685 Nov 3 2015 example_db.py
-rw-r--r-- 1 user_1 trg 270 Nov 3 2015 teachers.sql
bash-4.1$ sqlite3 school.db
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .read courses.sql
sqlite> .read teachers.sql
sqlite> .tables
course teacher
sqlite> select * from course;
SDV100|College Success Skills|1|dm112
ITD110|Web Page Design I|3|je232
ITP100|Software Design|3|je232
ITD132|Structured Query Language|3|cm147
sqlite>.exit
bash-4.1$
Reference:
1. https://www.sqlite.org/cli.html

Das könnte Ihnen auch gefallen