[thelist] [mysql] table structure review request

Hassan Schroeder hassan at webtuitive.com
Tue Aug 17 09:03:28 CDT 2004


Tom Dell'Aringa wrote:

> Hello, another mySQL question - this time on the structure of my table/db. This is going to be a
> long term project, so I want to make sure I've got a good structure from the start. The table is
> for a certain type of book. Here it is:

> CREATE TABLE `book` (
>   `bookID` int(5) NOT NULL auto_increment,
>   `booktitle` varchar(75) NOT NULL default '',
>   `publisherID` int(5) NOT NULL default '0',
>   `stripyears` varchar(10) NOT NULL default '',
>   `printings` varchar(5) NOT NULL default '1',
>   `yearprinted` varchar(4) NOT NULL default '',

Are you sure you'll never want to do date math with that last one?
"all books printed since ______" ?? If there's any chance of that,
the column would be better as a DATE, even if they're all entered
as YYYY-01-01.

Also, a look at the DocBook DTD might give you some ideas about
general book metadata considerations.

FWIW,
-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.




More information about the thelist mailing list