SHARE
TWEET

jdbcCommands

a guest Aug 13th, 2016 176 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 ;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top