Guest User

Untitled

a guest
Jan 4th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. ### SQL
  2.  
  3. Log into database: `mysql [db_name]`
  4.  
  5. View a table: `SELECT * FROM table_name;`
  6.  
  7. Update a record in a table:
  8.  
  9. `UPDATE [table_name] SET [table_column] = NOW() WHERE id = 1;`
  10.  
  11. For Action Plans
  12.  
  13. table_name = `users_tasks`
  14.  
  15. Order table view
  16.  
  17. `SELECT * FROM users_tasks ORDER BY timestamp_due ASC;`
  18.  
  19. Change the time for a task
  20.  
  21. `UPDATE users_tasks SET timestamp_due = NOW() - INTERVAL 8 HOUR + 200 WHERE id = 7`
Add Comment
Please, Sign In to add comment