tailieunhanh - PHP and MySQL Web Development - P43

PHP and MySQL Web Development - P43: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | Web Database Architecture 177 BOOKS ISBN Author Title Price Review 0-672-31687-8 Michael Morgan Java 2 for Professional Developers 0-672-31745-1 Thomas Down Installing Debian GNU Linux 0-672-31509-2 Pruitt et al. Teach Yourself GIMP in 24 Hours BOOK_REVIEWS ISBN Review Figure To add reviews we can either add a Reviews column to the Books table or add a table specifically for reviews. Having many null values in your database is a bad idea. It wastes storage space and causes problems when working out totals and other functions on numerical columns. When a user sees a null in a table they don t know if it s because this attribute is irrelevant whether there s a mistake in the database or whether the data just hasn t been entered yet. You can generally avoid problems with many nulls by using an alternate design. In this case we can use the second design proposed in Figure . Here only books with a review are listed in the Book_Reviews table along with their review. Note that this design is based on the idea of having a single in-house could just as easily let customers author reviews. If we wanted to do this we could add the CustomerlD to the Book_Reviews table. Summary of Table Types You will usually find that your database design ends up consisting of two kinds of tables Simple tables that describe a real world object. These might also contain keys to other simple objects where there is a one-to-one or one-to-many relationship. For example one customer might have many orders but an order is placed by a single customer. Thus we put a reference to the customer in the order. Linking tables that describe a many-to-many relationship between two real objects such as the relationship between Orders and tables are often associated with some kind of real-world transaction. Web Database Architecture Now that we ve discussed the internal architecture of your database we ll look at the external architecture of a Web database system

TỪ KHÓA LIÊN QUAN