Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this correct for creating a table with a date field

Status
Not open for further replies.

jewel464g

Technical User
Jul 18, 2001
198
US
CREATE TABLE calendar (id tinyint(4) DEFAULT '0' NOT NULL
AUTO_INCREMENT,
startDate date, endDate date, description blob, PRIMARY KEY (id), UNIQUE id (id)); When faced with a decision, always ask, 'Which would be the most fun?'
 
Sure, except I recommend that you use something larger than a tinyint for your id field. The largest number tinyint can store is 255 when used as an unsigned. Since you're using it a a signed column, the largest number is 127.

I would define the id colum to be:

id int unsigned not null auto_increment ______________________________________________________________________
TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top