1. Create table
CREATE TABLE abctable (id integer primary key, name text);
2. Insert into table
INSERT INTO "abctable" VALUES(1,'Kuldeep');
3. Create a view
CREATE VIEW abctable AS select * from testtable;
4. Add index
CREATE INDEX abctable on testtable(name);
5. Select command
SELECT * from abctable;
6. Removing tables, triggers, views, and indexes
7. Export a database
You can export (backup) your database using the command-line program and .dump. It works the same way it does from the SQLite shell. But we are going to want the output to go to a file and not the screen so we will redirect it to a file called dbbackup.
user@host:~$ sqlite3 test.db '.dump' > dbbackup
8. You could also compress the output:
user@host:~$ sqlite3 test.db '.dump' | gzip -c > dbbackup.gz
9. This command will use a file called abc.sql and import them into our test.db file:
user@host:~$ sqlite3 test.db < abc.sql
10. SQLite Data types