 |
|
 |
|
Next: Mass-Market Your Website 77150
|
| Author |
Message |
External

Since: Aug 12, 2008 Posts: 2
|
(Msg. 1) Posted: Tue Aug 12, 2008 12:46 am
Post subject: Single or Multiple Tables? Archived from groups: comp>databases (more info?)
|
|
|
Hi
I was wondering which of the design approaches below would be better:
Within the admin section of a website administrators can upload
Resources for inclusion throughout the site. Now, these Resources can
be either images, videos or documents e.g. PDF's, etc.
Which of the following solutions would be best?
1. Creating a single table named Resources into which all resources
would be inserted, then having some way of differentiating between the
different types of resources e.g. a 'resource_type' column; or
2. Creating separate tables for each type of resource e.g. Images,
Videos, Documents and inserting each resource into the appropriate
table.
Any help would be greatly appreciated.
Thanks >> Stay informed about: Single or Multiple Tables? |
|
| Back to top |
|
 |  |
External

Since: Jan 02, 2008 Posts: 152
|
(Msg. 2) Posted: Tue Aug 12, 2008 5:03 am
Post subject: Re: Single or Multiple Tables? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Aug 12, 3:46 am, Ian Oxley wrote:
> Hi
>
> I was wondering which of the design approaches below would be better:
>
> Within the admin section of a website administrators can upload
> Resources for inclusion throughout the site. Now, these Resources can
> be either images, videos or documents e.g. PDF's, etc.
>
> Which of the following solutions would be best?
>
> 1. Creating a single table named Resources into which all resources
> would be inserted, then having some way of differentiating between the
> different types of resources e.g. a 'resource_type' column; or
>
> 2. Creating separate tables for each type of resource e.g. Images,
> Videos, Documents and inserting each resource into the appropriate
> table.
>
> Any help would be greatly appreciated.
>
> Thanks
From the information you gave, there is no clear answer.
A DATABASE is a model of the external world. So the question is: what
are you modeling?
One way to get at the answer is to ask how you would query the
database. Does you plan to search for resources or would you be
searching for images, documents, etc. What would your WHERE clause
look like? You gave no other attributes for these "resources".
Or are you just using the database as an expensive file system?
Ed >> Stay informed about: Single or Multiple Tables? |
|
| Back to top |
|
 |  |
External

Since: Dec 20, 2007 Posts: 184
|
(Msg. 3) Posted: Tue Aug 12, 2008 6:46 pm
Post subject: Re: Single or Multiple Tables? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On 12.08.2008 14:03, Ed Prochak wrote:
> On Aug 12, 3:46 am, Ian Oxley wrote:
>> Within the admin section of a website administrators can upload
>> Resources for inclusion throughout the site. Now, these Resources can
>> be either images, videos or documents e.g. PDF's, etc.
>>
>> Which of the following solutions would be best?
>>
>> 1. Creating a single table named Resources into which all resources
>> would be inserted, then having some way of differentiating between the
>> different types of resources e.g. a 'resource_type' column; or
>>
>> 2. Creating separate tables for each type of resource e.g. Images,
>> Videos, Documents and inserting each resource into the appropriate
>> table.
> From the information you gave, there is no clear answer.
That's true. It sounds as if all these "resources" are treated
uniformly. In that case I'd probably have a single table with a BLOB
for the data and a column for storing the MIME type - along with other
information necessary to identify resources.
> Or are you just using the database as an expensive file system?
Expensive but transaction safe and fully integrated in backup etc.!
Kind regards
robert >> Stay informed about: Single or Multiple Tables? |
|
| Back to top |
|
 |  |
External

Since: Jan 11, 2008 Posts: 1089
|
(Msg. 4) Posted: Wed Aug 13, 2008 7:46 am
Post subject: Re: Single or Multiple Tables? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
From the spec you gave, I would tend to a single table for Resources
qua Resources with dates, sources, descriptions, media type, etc, that
includes a column for the names of the files that contain the actual
images, videos or documents. Then lock or encrypt the files so that
only the Admin can get to them to prevent tampering.
I never liked putting BLOB style data into SQL. It gets too
proprietary, you cannot query it anyway and next week someone invents
a new spiffy media that you cannot handle properly. >> Stay informed about: Single or Multiple Tables? |
|
| Back to top |
|
 |  |
External

Since: Aug 14, 2008 Posts: 1
|
(Msg. 5) Posted: Thu Aug 14, 2008 2:12 am
Post subject: Re: Single or Multiple Tables? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Aug 13, 8:46 pm, --CELKO-- wrote:
> From the spec you gave, I would tend to a single table for Resources
> qua Resources with dates, sources, descriptions, media type, etc, that
> includes a column for the names of the files that contain the actual
> images, videos or documents. Then lock or encrypt the files so that
> only the Admin can get to them to prevent tampering.
>
> I never liked putting BLOB style data into SQL. It gets too
> proprietary, you cannot query it anyway and next week someone invents
> a new spiffy media that you cannot handle properly.
http://arjudba.blogspot.com >> Stay informed about: Single or Multiple Tables? |
|
| Back to top |
|
 |  |
External

Since: Aug 12, 2008 Posts: 2
|
(Msg. 6) Posted: Thu Aug 14, 2008 6:09 am
Post subject: Re: Single or Multiple Tables? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
|
| Back to top |
|
 |  |
External

Since: Jan 02, 2008 Posts: 152
|
(Msg. 7) Posted: Thu Aug 14, 2008 10:54 am
Post subject: Re: Single or Multiple Tables? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Aug 14, 9:09 am, Ian Oxley wrote:
> Thanks to everyone for their answers. I've now got a much clearer idea
> of how to carry this forwards.
And thank you for the feedback. It is good to know our replies are
helpful in some way.
Ed >> Stay informed about: Single or Multiple Tables? |
|
| Back to top |
|
 |  |
| Related Topics: | Single query to find multi-level relationships? - I'm writing some code to suport a contact database, where a contact can be either a person or a group. Groups can contain people directly and can also contain other groups. The (simplified) table structure looks like this: PERSON ------ person_id ..
MySQL Multiple Joins? Having Problem w/ syntax. - Reletive newbie on multiple JOINS... I need to list all rows in KEYWORDS that have a PATH.path containing the string "test". I am at the mercy of MySQL 3.x so nested queries are not allowed. I got to a point where I was getting some erratic ...
execution of multiple DDL statements from .net - hi i want to execute following satement in .net TDStrSQL = "create volatile table tab1(somename varchar(100)) on commit preserve rows;create volatile table tab2(somenames varchar(100)) on commit preserve rows;" 'insert into tab1 values ('a'); ...
"code" tables? - The following is a message from a fellow programmer to a group of use that are involved in table design: "We are planning on creating 'account opening sources' lookup table to store 'account source' codes and corresponding descriptions. Problem wit...
Erwin modeling basic question - Hi, Can anyone tell me when doing db design in ERWin, how do you make the table column area longer so more attributes can be shown in the diagram? I thought it'd be as simple as dragging the lower corner of the table, but it didn't work. And I didn't.... |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|