solidsnake

MySQL 2/13

Feb 12th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.66 KB | None | 0 0
  1. action          subject     adjectives/conditions
  2. [SELECT * FROM]     [title]     [WHERE title LIKE '%a%']
  3.  
  4. CREATE DATABASE pubs;
  5. INSERT INTO title(col1, col2) VALUES (val1, val2)
  6.  
  7. //inserting something will put it into a new row. if row 2 is deleted, and you insert something to the table, it does not go to that empty row
  8.  
  9. INSERT INTO author(name, address, contract)
  10. SELECT DISTINCT author_name FROM
  11.  
  12. //select allows selection of rows and columns
  13. // use asterisk wildcard (*) to select ALL
  14.  
  15. SELECT title
  16. FROM title
  17. WHERE (title LIKE
  18.  
  19. ORDER BY price DESC <--if you want it to be sorted in descending manner
  20.     default is ASCENDING sort
  21.     ORDER BY always comes after WHERE
Advertisement
Add Comment
Please, Sign In to add comment