Posted By

iloveitaly on 07/07/09


Tagged

sql key Foreign


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

g8rpal
Tyster


Foreign Keys & DB Design


 / Published in: SQL
 

More for me than anything else

  1. SHOW CREATE TABLE `tablename`
  2. DESCRIBE `table`
  3. EXPLAIN SELECT ...
  4. ALTER TABLE playlist_events ADD FOREIGN KEY (playlist_id) REFERENCES playlists (id)
  5. ALTER TABLE playlists CONVERT TO CHARACTER SET utf8
  6. ALTER TABLE tbl_name DROP FOREIGN KEY fk_symbol
  7.  
  8. -- Insert data from other table
  9. INSERT INTO TestTable (FirstName, LastName)
  10. SELECT FirstName, LastName
  11. FROM Contact
  12. WHERE EmailPromotion = 2

Report this snippet  

You need to login to post a comment.