jingo811
June 4th, 2007, 01:57 PM
I'm doing my tables for my database. Now I'm about to assign data types for each field.
I've learnt to do things like this regarding numbers from my teacher:
CREATE TABLE Clothes (
article_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, # PK
...
...
PRIMARY KEY (article_id)
);
Now I want to adjust the situations for certain fields like for my Order_id field. I want to be able to handle numbers beyond the 1 Million mark.
Acording to this google search:
http://dev.mysql.com/doc/refman/4.1/en/numeric-type-overview.html
I can achieve that with this:
INT[(M)] [UNSIGNED] [ZEROFILL]
A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295.
But I don't understand how to use the (M) part in:
INT[(M)] UNSIGNED
Can I just leave the (M) empty? Or should I put in the number 4.294.967.295?
I've learnt to do things like this regarding numbers from my teacher:
CREATE TABLE Clothes (
article_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, # PK
...
...
PRIMARY KEY (article_id)
);
Now I want to adjust the situations for certain fields like for my Order_id field. I want to be able to handle numbers beyond the 1 Million mark.
Acording to this google search:
http://dev.mysql.com/doc/refman/4.1/en/numeric-type-overview.html
I can achieve that with this:
INT[(M)] [UNSIGNED] [ZEROFILL]
A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295.
But I don't understand how to use the (M) part in:
INT[(M)] UNSIGNED
Can I just leave the (M) empty? Or should I put in the number 4.294.967.295?