hello,
I am learning how to create a database driven site for one of my classes, and i am a total newbie.
I am creating a database with mysql, however I don't understand how to use NULL and NOT NULL and would like somebody to explain to me and give me example.
I have something like that
CREATE TABLE classroom (
id int(11) NOT NULL auto_increment,
name varchar(250) default NULL,
city varchar(50) default NULL,
states varchar(20) default NULL,
zip varchar(20) default NULL,
PRIMARY KEY (id)
)
my question is when to use NULL and when to use NOT NULL. why are they important? i will create more fields such as datejoin, hobby, and so on, how do i know if i should assign NULL or NOT to the fields?
thank you