Hy Guys,
Starting with mysql. I can not understand the concept of NULL. Check out the screenshot (* declare_not_null, link *). In this case, when I specifically declared the name field so that it was NOT NULL. When I run the desc test table command, the table description shows the default value for the NULL name field. Why is this so?
From what I read about NULL, this means the absence or information that is not applicable. Therefore, when I declare a NOT NULL field, it implies (according to my understanding) that the user must enter a value for the name field, otherwise the database engine must generate an error, that is, the record will not be entered into the database. However, when I run 'insert into test value ();' the database engine enters the record into the table. Check out the screenshot (* empty_value, link *).
LINKS FLICKR
* Declare_not_null *
http://www.flickr.com/photos/ 55097319 @ N03 / 5302758813 /
* empty_values * Check out the second screenshot on flickr
Q.2, what would sql statemetn be to remove the primary key from the table field. If I use "ALTER TABLE test drop key id"; he gives the following:
Error: Invalid
table definition; there can only be one automatic column, and it must be defined as a key.
Thank you for your help.
source
share