Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SQLite commands
- ----------------
- # to create a database
- C:/> sqlite3 database_name.db
- this is typed in the command prompt
- # to create tables
- sqlite>CREATE TABLE table_name(
- no INT,
- item TEXT,
- price REAL
- );
- # to enter values
- if entered randomly // here COMPANY is the table name.
- -----------------------
- sqlite> INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)
- VALUES (1, 'Paul', 32, 'California', 20000.00 );
- if entered in order
- --------------------------
- sqlite> INSERT INTO COMPANY VALUES (7, 'James', 24, 'Houston', 10000.00 );
- # to view the database table
- sqlite>.headers on
- sqlite>.mode columns
- sqlite> SELECT * FROM tablename;
- sqlite> SELECT ID, NAME, SALARY FROM COMPANY;
- sqlite> SELECT * FROM COMPANY WHERE salary>5000 ;
- sqlite> SELECT * FROM COMPANY WHERE salary=5000 ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement