MySQL Forums
Forum List  »  Newbie

How do I control how many digits are in a int field?
Posted by: Thomas Mahoney
Date: July 14, 2018 08:12AM

I'm trying to add a release year field to my Movie Collection database. The field must be 4 digits long. I've already checked the tutorials at tutorialspoint.com. They are no help in this matter.

My code is:

Create table Movies (
ID int primary key auto_increment,
Title varchar (30) not null,
...
YearReleased int (4)
);

Will this work?

Options: ReplyQuote


Subject
Written By
Posted
How do I control how many digits are in a int field?
July 14, 2018 08:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.