Advertisement
Guest User

jdbcCommands

a guest
Aug 13th, 2016
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nagios 0.83 KB | None | 0 0
  1. SQLite commands
  2. ----------------
  3.  
  4. # to create a database
  5. C:/> sqlite3 database_name.db        
  6. this is typed in the command prompt
  7.  
  8. # to create tables
  9. sqlite>CREATE TABLE table_name(
  10.     no INT,
  11.     item TEXT,
  12.     price REAL
  13.     );
  14.  
  15. # to enter values
  16.  
  17. if entered randomly          // here COMPANY is the table name.
  18. -----------------------
  19. sqlite> INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)
  20.          VALUES (1, 'Paul', 32, 'California', 20000.00 );
  21.  
  22. if entered in order
  23. --------------------------
  24. sqlite> INSERT INTO COMPANY VALUES (7, 'James', 24, 'Houston', 10000.00 );
  25.  
  26. # to view the database table
  27.  
  28. sqlite>.headers on
  29. sqlite>.mode columns
  30. sqlite> SELECT * FROM tablename;
  31. sqlite> SELECT ID, NAME, SALARY FROM COMPANY;
  32. sqlite> SELECT * FROM COMPANY WHERE salary>5000 ;
  33. sqlite> SELECT * FROM COMPANY WHERE salary=5000 ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement