Foreign Keys & DB Design


/ Published in: SQL
Save to your folder(s)

More for me than anything else


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.