ddevaudre...@intellicare.com wrote: > PJ <af.gour...@videotron.ca> wrote on 02/10/2009 12:44:04 PM: > > >> -- ----------------------------------------------------- >> -- Table `books` >> -- ----------------------------------------------------- >> CREATE TABLE IF NOT EXISTS `books` ( >> `id` SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT , >> `title` VARCHAR(148) NULL , >> `sub_title` VARCHAR(90) NULL , >> `descr` TINYTEXT NULL , >> `comment` TEXT NULL , >> `bk_cover` VARCHAR(32) NULL , >> `publish_date` YEAR NULL , >> `ISBN` BIGINT(13) NULL , >> `language_id` INT NULL , >> PRIMARY KEY (`id`) , >> INDEX `fk_books_language` (`language_id` ASC) , >> CONSTRAINT `fk_books_language` >> FOREIGN KEY (`language_id` ) >> REFERENCES `biblane`.`language` (`id` ) >> ON DELETE NO ACTION >> ON UPDATE NO ACTION) >> ENGINE = InnoDB; >> >> > May I make one sugggestion? I noticed that the books.id column is defined > as SMALLINT UNSIGNED. Unless your database is going to stay quite small, > that is really going to limit the number of books. This column is used as a > FK in a number of your other tables and if you later on have to change the > data type to make it bigger, you'll have to change all the related tables. > If I remember correctly, I had to drop all the FK constraints that > referenced this column, do the alter tables, and then recreate the FK > constraints. Save yourself the hassle and make it at least an Integer, if > not a BIGINT (unsigned). > > http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html > > Donna > > Thanks for the suggestion. I thought that 32 thousand would probably be enough for books on Egyptology... :-) But you're probably right. I don't imagine the site will ever reach that many, but.. And I'm still struggling to understand how I'm going to deal with inputting all the information ... it looks like I'll have to do some kind of php function to enter all the information in one page and then retrieve it to display it on another...
-- Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org