database-design

Should I make specification table referenceable?

Since I know there are lots of expert database core designers here, I decided to ask this question on stackoverflow. I'm developing a website whose main concern is to index every product that is available in the real world, like digital cameras, printers, refrigerators, and so on. As we know, each product has its own specifications. For...

How does Wikipedia avoid duplicate entries?

How can websites as big as Wikipedia sort duplicated entries out? I need to know the exact procedure from the moment that user creates the duplicate entry and so on. If you don't know it but you know a method please send it. ----update---- Suppose there is wikipedia.com/horse and somebody afterward creates wikipedia.com/the_horse this...

Django unique_together and flagging objects as "deleted"

I'm implementing the first option discussed in "Marking for deletion in Django", that is, when an object is no longer active, I set a boolean to mark it as inactive. The specific reason I'm using this method is that although the object is no longer in active use, it may still be referenced and displayed in various records and reporting ...

database partiton Function (sql server 2008)

HI, I want to write partiton in sql server 2008 for my fleet management system. I want to write a partition function such that --values (vehicle number) like for example mh-30-q-126,mh-30-a-126,mh-12-fc-126 should be moved to respective partiton, depending upon middle values like ,q,a,fc respectively My trial function:- CREATE PA...

How would you design this DB?

Hi, We are launching a website (paid subscription) and the sign up process includes entering an activation code. Activation codes are printed on scratch cards and sold via offline channels. Some of these cards are for 1 month access. Others are for 3 months and 1 year. Activation codes are unique 10-digit random numbers. When the acces...

mysql - storing comma separated string more efficiently

I am working on an application where users 'fight' to own larger parts of the map. Each map is made of a 1000 regions. Now my initial plan was to store the areas a user owns as a comma separated string e.g a user owns regions one to ten 1,2,3,4,5,6,7,8,9,10 Problem is a user could potentially own all 1000 which means it could be a str...

Design of Databases for storing the details of the recurrent occurrence of an event

I need to implement a feature similar to the one provided by Microsoft Outlook to make your meeting appointment recurrent. I am trying to figure out the optimized Database design that I will be requiring for implementing this feature. The requirement is something like that each run or task entered by the user will also be applicable fo...

Efficient storage of external index of strings

Say you have a large collection with n objects on disk and each one has a variable-sized string. What are common practices of efficient ways to make an index of those objects with plain string comparison. Storing the whole strings on the index would be prohibitive in the long rundue to size and I/O, but since disks have a high latency st...

How do you know when an SQL database needs more normalization?

Is it when you're trying to get data and there is no apparent easy way of doing it? When you find something should be a table on it's own? What are the laws? ...

SQL Server Database Design Problem/Challenge

I have a database that has node & nodetype tables. Nodes table NodeID ParentNodeID NodeTypeID NodeName ... NodeType Table NodeTypeID ParentNodeTypeID NodeTypeName ..... Both tables have a relationship to itself. There are different types of node i.e Node Site Building Office These are hierarchical, so information (attributes) th...

Converting xml schema to relational model

Do you guys know, how we can convert XML Schema to relational model? What are the steps involved? More precisely, How can we figure out what the table names, columns names and the relationships on those tables, going to be like on relational model by looking only at the XML Schema? If you have any tutorial links, examples then please sh...

ER Diagram (Drawing)

For a relational database that represents the current term enrollment at a large university, what is the ER diagram for a schema that takes into account all the assertions given: • 100 instructors, 200 courses, and 800 students. • An instructor may teach one or more courses in a given term (average is 2.0 courses). • An instructor mus...

Creating database tables with "either or" type fields.

I have a database that tracks players through their attempts at a game. To accomplish this, I keep a table of users and store the attempts in a separate table. The schema for these tables is: CREATE TABLE users ( id BIGINT PRIMARY KEY, -- the local unique ID for this user name TEXT UNIQUE, -- a self-chosen username for the user ...

Many to many relationship

I have a customers and managers, two tables independently. My customer table have nearly hundred million records whereas manager table have 100 records. Now i am in position to map the customers to manager. Rules are as follows One manager can have multiple customers. One customer may mapped with multiple managers. What is the best D...

Setting up an MS-Access DB for multi-user access

We're thinking of "growing" a little MS-Access DB with a few tables, forms and queries for multiple users. (Using a different back-end is another, but more long-term option that is unfortunately currently not acceptable.) Most users will be read-only, but there will be a few (currently one or two) users that have to be able to do changes...

Database design for write-heavy web application

A lot of the LOB applications we provide to our customers are of a marketing / promotional nature (sweepstakes, event registration, etc...). Most of the applications, while very simple, are very demanding on the database. Imagine a "registration" type site as the backing for a commercial that airs during the superbowl, for example (yes, ...

Should i have a primary ID? i am indexing another field.

Using sqlite i need a table to hold a blob to store a md5 hash and a 4byte int. I plan to index the int but this value will not be unique. Do i need a primary key for this table? and is there an issue with indexing a non unique value? (I assume there is not issue or reason for any). ...

Single or multiple databases

SQL Server 2008 database design problem. I'm defining the architecture for a service where site users would manage a large volume of data on multiple websites that they own (100MB average, 1GB maximum per site). I am considering whether to split the databases up such that the core site management tables (users, payments, contact detail...

Is there a data storage pattern similar to mipmaps in graphics?

We've got a bunch of data the users may want to view windows of and do so quickly. They may want to look at a window of the data that is a day, a week, a month, or an arbitrary beginning and ending data. Sorting and summing up all of this stuff in real time is proving to be painful for us so I got the idea of doing something similar to M...

Should I add a autoinc primary key for the sake of having a primary key?

I have a table which needs 2 fields. One will be a foreign key, the other is not necessarily unique. There really isn't a reason that I can find to have a primary key other than having read that "every single tabel ever needs needs needs a primary key". Edit: Some good thoughts in here. For clarity's sake, I will give you an example t...