Two quick questions RE: creating a table

I’m creating a table for the first time.
The instructions I have are pretty clear, but I have two questions.

Below are the table instructions. My question #1 is, for NOT NULL, I see two possible places. Once is a little tick box that is labeled NULL. Does NOT NULL mean I should leave that unticked?

CREATE TABLE IF NOT EXISTS oto_autotrack (
id int(11) NOT NULL AUTO_INCREMENT,
timehit int(11) NOT NULL DEFAULT 0,
ipaddress varchar(40) NOT NULL,
srtrkdm varchar(200) NOT NULL,
srtrkid int(11) NOT NULL,
landing int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (id),
KEY timehit (timehit),
KEY ipaddress (ipaddress),
KEY landing (landing)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Secondly, it says for a couple of them: DEFAULT 0. Default is where the other NULL is. Am I to make sure that isn’t NULL for “NOT NULL”? (I don’t think so). If I set Default to “as defined” and type in 0, it won’t let me save it. Says there is an error. So do I just set that to None to indicate zero? But if I do, then it’s identical to the ones that don’t say DEFAULT 0

Yes, the checkbox is for allowing nulls. You can verify this by clicking on the Preview SQL button.

You want ‘NOT NULL’ Default 0. If you are getting an error, what is the error?

And, if you have the sql query, why are you using the UI to create the table? It is cleaner and faster to just write out the create table sql, and you will also start to use that more than a GUI as you grow more comfortable.

Sponsor our Newsletter | Privacy Policy | Terms of Service