IPB

Google Frontpage Forums Unattended CD/DVD Guide
 
Reply to this topicStart new topic
> Advice on Database Design
iceangel89
post Jun 4 2007, 08:54 AM
Post #1


Advanced Member
***

Group: Members
Posts: 383
Joined: 10-February 07
From: Singapore
Member No.: 125966
Country Flag


I am thinking of doing a fake PC company site for my ASP project. so what they will have is a chat, products with reviews, and users can have "Buddies".

So my DB so far (Tables):
  • ProductPC - ID, Processor, RAM, HDD, Graphics, LCD ...
  • ProductHardware - ID, Title (Like "Intel C2D E6600"), Description, Price, Rating (0-5 stars, so integer), Category (CPU, HDD, Graphics)
  • ProductSoftware - ID, Title (eg. "Adobe CS3"), Description, Price, Rating, Category (eg. Design, Programming)
  • Reviews - ID, ProductID, Title, Content, Date
  • Chat - ID, TopicID, Title, Content, Date
  • Users - ID, Username, Password,
The problem, how do i connect Reviews to the products since they are from diff tables.
How do i get the "buddy" system working
Chat i think its not as simple as that

But i just need a simple ASP project, so no need to get too complex, but i still hope to learn as much.
Go to the top of the page
 
+Quote Post
RedArrow7997
post Jun 4 2007, 09:24 AM
Post #2


Newbie


Group: Members
Posts: 10
Joined: 29-August 03
Member No.: 6040
Country Flag


Combine your three product tables together into one table, if you don't then you are going to need to create three reviews table. because if some one does a review for "intel c2d e6600" which as an id of 1 and "adobe cs3" which also has an idea of one then which of the two does the review go with.

i would make one large table with all of the information need for three product types. that way if will be easy on you when you are asked to do search for different products. microsoft doesn't only make software they also make some hardware.

with the chat subject, are you talking about a forum instead of chat. chat will be hard to for a class project.

the idea you have for user is about right, i would add a couple more fields like first name, last name, email and maybe some of the im services(aim, yahoo, msn).
Go to the top of the page
 
+Quote Post
ripken204
post Jun 4 2007, 10:08 AM
Post #3


The Hardware Guy
**********

Group: Members
Posts: 6144
Joined: 23-December 04
From: Rochester, New York
Member No.: 39158
OS: Vista Ultimate x64
Country Flag


what type of database are you using?
Go to the top of the page
 
+Quote Post
RedArrow7997
post Jun 4 2007, 12:08 PM
Post #4


Newbie


Group: Members
Posts: 10
Joined: 29-August 03
Member No.: 6040
Country Flag


QUOTE (ripken204 @ Jun 4 2007, 10:08 AM) *
what type of database are you using?


i am think it is either access or sql server seeing that it is asp project.
Go to the top of the page
 
+Quote Post
iceangel89
post Jun 4 2007, 06:05 PM
Post #5


Advanced Member
***

Group: Members
Posts: 383
Joined: 10-February 07
From: Singapore
Member No.: 125966
Country Flag


i am using SQL Server from Visual Studio 2005.

But if i combine all products, what happens is PCs have more fields that usually Hardware & Software, like they have a Processor, RAM while HW/SW don't have. then many fields will be NULL. will that be OK or Good?

As for the Chat it will be a simple 1. like user can post ...

I was thinking the ChatPost Table or Forums: (if its possible)

- TopicID
- PostID
- UserID
- TopicTitle
- Content
- Date
Go to the top of the page
 
+Quote Post
ripken204
post Jun 4 2007, 08:38 PM
Post #6


The Hardware Guy
**********

Group: Members
Posts: 6144
Joined: 23-December 04
From: Rochester, New York
Member No.: 39158
OS: Vista Ultimate x64
Country Flag


well you can leave them in separate tables. i only have experience with mysql and im assuming it is almost identrical as mssql. all you would need to do is:

CODE
SELECT * FROM Reviews,ProductHardware WHERE Reviews.ID=ProductHardware.ID AND Review.ID="whatever_id_i_want"


this is assuming that the ID's all corrisbond with eachother. is that how your keeping track of things? or are the ID's specific to that table, such as a key?

what this will do tho, is take those 2 table and take the id u want to find, then take that single if from both tables. then you call call whatever data u want from those 2 tables. you could do a left join if u want, knd of compine the tables that way.

This post has been edited by ripken204: Jun 4 2007, 08:39 PM
Go to the top of the page
 
+Quote Post
RedArrow7997
post Jun 5 2007, 05:19 AM
Post #7


Newbie


Group: Members
Posts: 10
Joined: 29-August 03
Member No.: 6040
Country Flag


QUOTE (iceangel89 @ Jun 4 2007, 06:05 PM) *
i am using SQL Server from Visual Studio 2005.

But if i combine all products, what happens is PCs have more fields that usually Hardware & Software, like they have a Processor, RAM while HW/SW don't have. then many fields will be NULL. will that be OK or Good?

As for the Chat it will be a simple 1. like user can post ...

I was thinking the ChatPost Table or Forums: (if its possible)

- TopicID
- PostID
- UserID
- TopicTitle
- Content
- Date


maybe you should have a one many table with
id
description
type of product

then use it to link to other tables with more related to the type of product, software, hardware and computers. i assume that you will have sort of search in this app, with out a some sort of central table that search will be really hard to complete.
Go to the top of the page
 
+Quote Post
iceangel89
post Jun 5 2007, 06:55 AM
Post #8


Advanced Member
***

Group: Members
Posts: 383
Joined: 10-February 07
From: Singapore
Member No.: 125966
Country Flag


ripken204 that helps, and i am using the IDs as a key.
but i didn't get the part:
QUOTE
"this is assuming that the ID's all corrisbond with eachother"


RedArrow7997
, i understood u as :
have a central table: for ProductType
- ID
- Description (eg. This table is for PCs)
- Type (eg. PC, Hardware ...)
am i right?
Then, connect them to PC, Software tables
but to me (as a learner), how do i do that (Search)? i was thinking few tables are easier? like if the page is for Adding PCs then in the VB i just need to add to the appropriate table? but if i do your method, i need to chk
If ProductType = ??? Then
Insert into This table.
No offense just want to clarify.
Go to the top of the page
 
+Quote Post
ripken204
post Jun 5 2007, 08:34 AM
Post #9


The Hardware Guy
**********

Group: Members
Posts: 6144
Joined: 23-December 04
From: Rochester, New York
Member No.: 39158
OS: Vista Ultimate x64
Country Flag


by that quote i mean, do the ids match? are the ids product numbers?
like if you have an e6600 in ProductHardware, it may have an id of 1232 for example.
would it also have an id of 1232 in Reviews?


i'll need you to clarify first tho. what exactly do you want to do with all of this date? i was thinking that you just wanted to retrieve it?
Go to the top of the page
 
+Quote Post
RedArrow7997
post Jun 5 2007, 11:41 AM
Post #10


Newbie


Group: Members
Posts: 10
Joined: 29-August 03
Member No.: 6040
Country Flag


QUOTE
RedArrow7997, i understood u as :
have a central table: for ProductType
- ID
- Description (eg. This table is for PCs)
- Type (eg. PC, Hardware ...)
am i right?
Then, connect them to PC, Software tables
but to me (as a learner), how do i do that (Search)? i was thinking few tables are easier? like if the page is for Adding PCs then in the VB i just need to add to the appropriate table? but if i do your method, i need to chk
If ProductType = ??? Then
Insert into This table.
No offense just want to clarify.


i think you are trying to create a bigger project then you can handle right now, you should start maybe with just a single product, lets say computers. get everything to work that you want. then add the other stuff. that way your are only dealing with one set of tables for your products.
Go to the top of the page
 
+Quote Post
iceangel89
post Jun 5 2007, 06:02 PM
Post #11


Advanced Member
***

Group: Members
Posts: 383
Joined: 10-February 07
From: Singapore
Member No.: 125966
Country Flag


ripken204, i didn't intend for the (Review)IDs to match, to search i would use the ProductID Foreign Key in Reviews table, so ProductID would match. reviewID would be just a Key just for nothing for now.

RedArrow7997, i think u are right, i seem to always expand of my projects LOL, really, 1/3 my class does that actually, top class u see. but the competition makes things tough. i guess if i am in a lousier class all my Bs would become As and As become Distinction. LOL biggrin.gif anyways i think its good to learn more than u are taught.
Go to the top of the page
 
+Quote Post
RedArrow7997
post Jun 6 2007, 05:24 AM
Post #12


Newbie


Group: Members
Posts: 10
Joined: 29-August 03
Member No.: 6040
Country Flag


i am not saying that it is a bad idea to do those three things, but start out with one then add another one when you have work out all of the bugs form the first one. if you try to add all three together then you will never finish your project.
Go to the top of the page
 
+Quote Post
ripken204
post Jun 6 2007, 01:00 PM
Post #13


The Hardware Guy
**********

Group: Members
Posts: 6144
Joined: 23-December 04
From: Rochester, New York
Member No.: 39158
OS: Vista Ultimate x64
Country Flag


ya its really hard to start off with a s*** load of material and trying to make something of it.

anyways, you still havnt described your project that much.
it is extremely easy to connect your hardware table with the reviews table since you will have the hardware id can = the review product id
Go to the top of the page
 
+Quote Post
iceangel89
post Jun 16 2007, 05:32 AM
Post #14


Advanced Member
***

Group: Members
Posts: 383
Joined: 10-February 07
From: Singapore
Member No.: 125966
Country Flag


Is it ok to have a DB Structure like this where Hardware from PC comes from a Hardware table? i will have many Foreign Keys in the PC table. eg. ProcessorID - HWID, HDDID - HWID... etc. then to select the item, i can do something like

CODE
SELECT * FROM Hardware, Category
WHERE
   Hardware.CategoryID = Category.CategoryID AND
   Category.Title LIKE 'Processor'


I hope the code is right i hand typed it
Attached File(s)
Attached File  Products.jpg ( 27.38K ) Number of downloads: 10
 
Go to the top of the page
 
+Quote Post

Google Frontpage Forums Unattended CD/DVD Guide

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 8th January 2009 - 03:29 AM
All trademarks mentioned on this page are the property of their respective owners
MSFN is not affiliated with Microsoft
Copyright © 2001-2008 msfn.org
Privacy Policy