Create Table Users


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

Splitting table users in frequently and infrequently accessed attributes


Copy this code and paste it in your HTML
  1. CREATE TABLE Users (
  2. email VARCHAR(80) NOT NULL,
  3. display_name VARCHAR(50) NOT NULL,
  4. PRIMARY KEY (user_id),
  5. UNIQUE INDEX (email)
  6.  
  7.  
  8. CREATE TABLE UsersExtra (
  9. user_id INT NOT NULL,
  10. first_name VARCHAR(25) NOT NULL,
  11. last_name VARCHAR(25) NOT NULL,
  12. address VARCHAR(80) NOT NULL,
  13. city VARCHAR(30) NOT NULL,
  14. province CHAR(2) NOT NULL,
  15. postcode CHAR(7) NOT NULL,
  16. interests TEXT NULL,
  17. bio TEXT NULL,
  18. signature TEXT NULL,
  19. skills TEXT NULL,
  20. PRIMARY KEY (user_id),
  21. FULLTEXT KEY (interests, skills)
  22. ) ENGINE=MyISAM;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.