If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Student needs a little help for inheritance

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-02-08, 21:07
sonnymac70 sonnymac70 is offline
Registered User
 
Join Date: Oct 2008
Posts: 1
Student needs a little help for inheritance

First of all hi everyone, that's my first post in the forum after having read it for a while.
I am preparing a little project for uni, I need to provide and build a db with Access 2003 and then build a little vb.net 2005 project to manage data.
Here is the topic. there is a small library that could lend books,magazine,videos

I read about inheritance so, one solutions I came up with is creating a Item table with common fields and three sub tables for books, magazines and videos. Now I joined these three tables by linking 1:1 with the PK of the Item table. I can't figure out how then to simple add a new book, new magazine and new videos. I know I could put all the fields in a table to make things easier, but I think that my solution is more scalable and it will allow to have for example other kind of items in the future. I am stubborn and I want to try to make it work, can anyone give me an help.
I attached a relationship img
Maybe if someone could send me a little db in Access 2003 with just a couple of fields for each sub table will help me to try these solutions

Please this stuff is quite urgent, all the help is appreciate
Attached Thumbnails
Student needs a little help for inheritance-solutiontwo.jpg  
Attached Files
File Type: zip newLibrary.zip (144.4 KB, 25 views)
Reply With Quote
  #2 (permalink)  
Old 10-03-08, 02:10
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
Good Lord. Make your life easier and combine those into a single "Media" table.
How would you extend your design to allow them to loan CDs, scripts, newspapers, public documents, etc?
Do not be overly concerned with leaving nulls in columns that do not apply to all media. The last time disk utilization was an important factor was about 20 years ago.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On