Wrox Programmer Forums
|
BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 Databases by Thearon Willis; ISBN: 9780764588945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2006, 02:40 PM
Authorized User
 
Join Date: Jul 2006
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Database Design

I have a question that is not really directly associated with the book but maybe someone can help me. Im trying to decide on a design for my SQL server database. this database will house information about inventory for an IT dept., such as computers, printers, monitors..etc. I was thinking that what I should do is have a table that contains fields such as inventoryid(autoincrement integer),a location field, manufacturer type, and item type(such as printer or monitor)....then have subsequent tables that contain the details on these particular types of inventory like the details that would pertain only to monitor items or computers...considering that the information on these items is quite different. my problem is this...how do i set this up? should i have the inventoryid be the primary key in all tables and then just set up a 1 to 1 relationship between the main items table and each particular item type table (like a 1 to 1 relationship between the main inventory table and the printers table with the inventoryid field being the foreign key in the printers table)? that sounds ok to me but the problem with that is making sure the inventoryid stays unique...the only way i can think to do that is by adding an item to the main table first, then after it is assigned an autoincremented id, somehow select that id and use it to add the details record to the corresponding details table (the monitors table would have fields like size,a boolean to store whether it is a flatscreen or not,etc....the computers tabe will have fields like processor speed, hd size, domain name, etc)......OR should i just have one table that contains fields for every type of item and then just apply nulls to fields that dont apply for particular items?
i hope this made some sort of sense
any suggestions are greatly appreciated
thanks in advance
Justin

 
Old August 2nd, 2006, 03:34 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Justin,

I assume you own the book since you have posted to this forum. Please review Chapter 1. This should help you in your database design. Personally, I would use GUID's as the primary keys. This will help you with your foreign key relationships and also set you up in case you need to do replication down the road.

Thearon
 
Old August 2nd, 2006, 03:45 PM
Authorized User
 
Join Date: Jul 2006
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

im using int's so that i can use those values as lookup indices with comboboxes and listboxes....you cant do this with GUID's correct?

ps yes i do own the book

 
Old August 2nd, 2006, 03:48 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Justin,

You can use GUIDs as the ValueMember for combo boxes and listboxes. The book shows you how and that is all I used throughout the book.

Thearon
 
Old August 2nd, 2006, 03:50 PM
Authorized User
 
Join Date: Jul 2006
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I apologize...i will check it out
thanks
justin






Similar Threads
Thread Thread Starter Forum Replies Last Post
Database design tsimsha Classic ASP Databases 0 February 3rd, 2006 03:28 AM
Database Design Help malhyp BOOK: Access 2003 VBA Programmer's Reference 1 November 3rd, 2005 06:33 PM
Re: Database design malhyp BOOK: Expert One-on-One Access Application Development 0 August 24th, 2005 06:34 AM
Database design, please help! mumick SQL Server 2000 0 January 13th, 2005 02:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.