Note that there are some explanatory texts on larger screens.

plurals
  1. POOptimized datatypes + simple database design
    text
    copied!<p>i am using a simple database design and i think the best database example is e-commerce, because it does have a lot of problems, and its familiar to cms. </p> <pre><code>USERS TABLE UID |int | PK NN UN AI username |varchar(45) | UQ INDEX password |varchar(100) | 100 varchar for $6$rounds=5000$ crypt php sha512 name |varchar(100) | 45 for first name 45 for last 10 for spaces gender |bit | UN ,0 for women 1 for men, lol. phone |varchar(30) | see [2] email |varchar(255) | see RFC 5322 [1] verified |tinyint | UN INDEX timezone |tinyint | -128 to 127 just engough for +7 -7 or -11 +11 UTC timeregister |int | 31052010112030 for 31-05-2010 11:20:30 timeactive |int | 01062010110020 for 1-06-2010 11:00:20 COMPANY TABLE CID |int | PK NN UN AI name |varchar(45) | address |varchar(100) | not quite sure about 100. email |varchar(255) | see users.email, this is for the offcial email phone |varchar(30) | see users.phone link |varchar(255) | for www.website.com/companylink 255 is good. imagelogo |varchar(255) | for the retrieving image logo &amp; storing imagelogosmall |varchar(255) | not quite good nameing huh? let see the comments yahoo |varchar(100) | dont know linkin |varchar(100) | dont know twitter |varchar(100) | twitter have 100 max username? is that true? description |TEXT | or varchar[30000] for company descriptions shoutout |varchar(140) | status that companies can have. verified |tinyint | UN INDEX PRODUCT TABLE PID |int | PK NN UN AI CID |int | from who?santa? FK: company.cid cascade delete name |varchar(100) | longest productname maybe hahaha. description |TEXT | still confused useing varchar[30000] imagelarge |varchar(255) | for the retrieving product image &amp; storing imagesmall |varchar(255) | for the retrieving small product image &amp; storing tag |varchar(45) | for tagging like stackoverflow ( index ) price |decimal(11,2) | thats in Zimbabwe dollar. </code></pre> <ol> <li>see <a href="https://stackoverflow.com/questions/201323/what-is-the-best-regular-expression-for-validating-email-addresses">Using a regular expression to validate an email address</a></li> <li>see <a href="https://stackoverflow.com/questions/723587/whats-the-longest-possible-worldwide-phone-number-i-should-consider-in-sql-varch">What&#39;s the longest possible worldwide phone number I should consider in SQL varchar(length) for phone</a></li> </ol> <p>why innodb specific ? please see quote <a href="https://stackoverflow.com/questions/3286738/how-to-choose-optimized-datatypes-for-columns-innodb-specific">How to choose optimized datatypes for columns [innodb specific]?</a></p> <p>its getting of the topic so i have to create another question and it people doent understand what im trying to say, or maybe i cant explain what i want there . this time its + database design.</p> <p>so again please <strike>copy the example above and put your changes + comments just like the example</strike>. give an advice about it.</p> <p>Remember for INNODB mysql. read the quote on above link. thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload