Click here to Skip to main content
15,905,587 members
Home / Discussions / Database
   

Database

 
AnswerRe: Generating dynamic where clause in stored procedure in sqlserver 2005 Pin
Robin_Roy19-Jul-09 21:32
Robin_Roy19-Jul-09 21:32 
AnswerRe: Generating dynamic where clause in stored procedure in sqlserver 2005 Pin
Blue_Boy19-Jul-09 21:59
Blue_Boy19-Jul-09 21:59 
AnswerRe: Generating dynamic where clause in stored procedure in sqlserver 2005 Pin
--CELKO--20-Jul-09 8:44
--CELKO--20-Jul-09 8:44 
AnswerRe: Generating dynamic where clause in stored procedure in sqlserver 2005 Pin
PIEBALDconsult20-Jul-09 10:44
mvePIEBALDconsult20-Jul-09 10:44 
QuestionUsing Crystal Reprot 10 within MS Access 2003 Pin
aftab8318-Jul-09 0:44
aftab8318-Jul-09 0:44 
AnswerRe: Using Crystal Reprot 10 within MS Access 2003 Pin
Jerry Hammond18-Jul-09 6:34
Jerry Hammond18-Jul-09 6:34 
GeneralRe: Using Crystal Reprot 10 within MS Access 2003 Pin
Mycroft Holmes18-Jul-09 15:23
professionalMycroft Holmes18-Jul-09 15:23 
QuestionStoring an array in a string or ...? Pin
Ehsan Baghaki17-Jul-09 21:36
Ehsan Baghaki17-Jul-09 21:36 
I have a product table with 100000 products and also I have a user table with 5000 records. and suppose a user can give us feedback about any combination of this products. So suppose he chooses to compare products 1,3,100,200,400,500 and so on. (he can send us another feedback about some other products)

So here is my question, I just want to know what an expert database designer would think about this situation where the number of products and users are big. One way to store this ratings are in a single string like: 1#5 3#4 100#5 .... x#y means that he gave y stars to product with id of x. I can load this vote_string in my php script for example and extract the details of it.
So the rating table would likely have this structure: id, user_id, vote_string

Another way is to store this feedback in this structure:
vote Table: id, user_id, date
vote_details Table: vote_id, product_id, vote ==> (vote_id,products_id) as primary key and vote_id is foreign key.

(or may these 2 tables can be compressed in a single table like id,user_id,product_id,vote [id,user_id,product_id] as primary key)

So i guess it's very easier to query in the second design but it consumes more space and time for each query, also in case of product deletion it's quite better to use the second design. What would you do?

Any kind of idea is appreciated.
AnswerRe: Storing an array in a string or ...? Pin
Luc Pattyn18-Jul-09 0:08
sitebuilderLuc Pattyn18-Jul-09 0:08 
AnswerRe: Storing an array in a string or ...? Pin
riced18-Jul-09 0:29
riced18-Jul-09 0:29 
AnswerRe: Storing an array in a string or ...? Pin
Mycroft Holmes18-Jul-09 15:34
professionalMycroft Holmes18-Jul-09 15:34 
GeneralRe: Storing an array in a string or ...? Pin
Luc Pattyn18-Jul-09 18:03
sitebuilderLuc Pattyn18-Jul-09 18:03 
GeneralRe: Storing an array in a string or ...? Pin
Mycroft Holmes18-Jul-09 22:31
professionalMycroft Holmes18-Jul-09 22:31 
GeneralRe: Storing an array in a string or ...? Pin
Luc Pattyn19-Jul-09 2:24
sitebuilderLuc Pattyn19-Jul-09 2:24 
QuestionSQL High Availabilty Pin
Member 259952517-Jul-09 0:08
Member 259952517-Jul-09 0:08 
QuestionDISTINCT and MAX in SQL Query Pin
jishbalan16-Jul-09 20:34
jishbalan16-Jul-09 20:34 
AnswerRe: DISTINCT and MAX in SQL Query Pin
vica dianto16-Jul-09 20:49
vica dianto16-Jul-09 20:49 
AnswerRe: DISTINCT and MAX in SQL Query Pin
abcurl17-Jul-09 10:16
abcurl17-Jul-09 10:16 
GeneralRe: DISTINCT and MAX in SQL Query Pin
jishbalan19-Jul-09 18:27
jishbalan19-Jul-09 18:27 
QuestionChange the dataset name in Typed Dataset Pin
Neeraj Kr16-Jul-09 8:20
Neeraj Kr16-Jul-09 8:20 
AnswerRe: Change the dataset name in Typed Dataset Pin
Adam Maras16-Jul-09 8:23
Adam Maras16-Jul-09 8:23 
GeneralRe: Change the database name in Typed Dataset Pin
Neeraj Kr16-Jul-09 8:44
Neeraj Kr16-Jul-09 8:44 
QuestionPassing Arrays to Stored Proc Pin
ferronrsmith16-Jul-09 7:40
ferronrsmith16-Jul-09 7:40 
AnswerRe: Passing Arrays to Stored Proc Pin
Ashfield16-Jul-09 21:01
Ashfield16-Jul-09 21:01 
QuestionDatetime in sqlserver Pin
kurangu16-Jul-09 6:26
kurangu16-Jul-09 6:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.