Re: Database Design Problem...
Posted in 1998
Topics: SQL Development & Query Writing
Just my own two cents worth: book do NOT have unique names across all books. Therefore a unique id is needed. For the person querying the ORDER table, a simple join of ORDER.book_id to BOOK.book_id will let him extract the book_name column as well. Rachel Daniel Pasto wrote: > Jimmy (c6635500@comp.polyu.edu.hk) wrote: > > However, one day, a person ask me, "Why you put book_id in the table > > BOOK? book_name is unique all the time, why you create additional column > > (book_id) in table BOOK? Moreover, I don't know which book is from the > > table ORDER since it contains book_id only. book_id is meaningless. Why > > don't you delete the book_id column in table BOOK and replace book_id > > with book_name in table ORDER?" > > I'll go with the others and say to use the ID and to add a seperate table > for authors and to cross reference authors and books, but also: > > If you are likely to have people like that looking at the database, how about > creating a view to build what he wants while keeping the better design for the > actual data? > > Dan