From: Bill Guindon Date: 2005-10-29T08:06:32+09:00 Subject: Re: [QUIZ] TumbleDRYer (#53) On 10/28/05, Ruby Quiz wrote: [snip] > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > by Hugh Sasse [snip] > CREATE TABLE `documents` ( > `id` int(11) NOT NULL auto_increment, > `title` varchar(50) NOT NULL default '', > `description` text NOT NULL, > `author_id` int(11) NOT NULL default '0', > `date` date NOT NULL default '0000-00-00', > `filename` varchar(50) NOT NULL default '', > PRIMARY KEY (`id`), > KEY `document` (`title`) > ) TYPE=MyISAM AUTO_INCREMENT=14 ; This looks like a fun one to me, as it's one of the main things I use Ruby for. Looking forward to seeing what others do with it -- and hoping to clean up an example of my own. Since I had to rtfm [1] for a couple simple SQL questions (yeah, my SQL is probably rustier than most), thought I'd save others the time. q) Why doesn't the 'description' field have a 'default'? a) "BLOB and TEXT columns cannot be assigned a default value." q) How should you treat columns that allow NULLs (none of the examples do)? a) "If neither NULL nor NOT NULL is specified, the column is treated as though NULL had been specified." [1] http://dev.mysql.com/doc/refman/5.0/en/create-table.html -- Bill Guindon (aka aGorilla)