Database design is the process of specifying the logical and/or physical parts of a database. The goal of database design is to make a representation of some "universe of discourse" - the types of facts, business rules and other requirements that the database is intended to model.

learn more… | top users | synonyms (2)

1
vote
2answers
126 views

Two possibilities of primary key

I have a table: all_info, where it holds the users identification. This id can be of two types (just one or another, never both), suppose: int and varchar, but one table can't have two primary keys, ...
0
votes
1answer
137 views

Review my simple database tables

Hey trying to create a simple database table for a small beer review project, it been awhile since i have created db's so could anyone just tell me if i am totally wrong here? Especially my use of ...
2
votes
1answer
172 views

Data Model: Parent, Child, Grandchild with Child Being Optional

I posted the question in another forum and I was suggested to re-post it here which may be more appropriate. Thank you in advance. My organization structure:    Department -- has ...
1
vote
1answer
143 views

Help designing tables for storing lab test results: values include numbers, <number, >number

We're using MySQL 5.5 and attempting to design tables to store the results from tests run in a lab. The results of some of the tests can be either a plain number, e.g. "5", or a range such as "< 5" ...
0
votes
0answers
75 views

Database design: Modifying an open source database without a lot of changes

I am adding more functionality/features to an open source project. The project is about a forum where each post can be given a specific list of tags. The tags are homogeneous. I.e they are of similar ...
-1
votes
1answer
48 views

One or two tables (for two things: cancellations and moves)?

A lesson may be canceled, moved to an other time, and possibly switched to an other teacher. In other words, we have lessonid INT UNSIGNED canceled BIT(1) time TIME teacherid INT UNSIGNED Should ...
2
votes
1answer
127 views

ER relation with unique key

I've a problem about my ER diagram. Assume that I want to draw a diagram with student, member and team. Here is my specs: A student does not have to be a member of any team. A student could be a ...
0
votes
0answers
2k views

Multi user messaging database design

I'm designing a database for a new project and I'm looking for some feedback on the design before I start to implement. It basically consists of secure messaging system with those abilities : One ...
3
votes
2answers
366 views

E/R diagram for sports league database

I am attempting to create a data model for a sports league There are two entities in my domain. The first entity is a Manager and the second is a Team. A Manager has personnel id first name last ...
5
votes
2answers
3k views

Composite Primary Key efficiency as a Foreign Key

I have a table with a Composite Primary key (consisting of 4 columns) which is used to ensure no duplicates are entered into the table. I am now in need of a new table which will need to reference the ...
3
votes
1answer
89 views

How to design database for polymorphic relationships

I have the following scenerio: There are some categories Each category has attributes An attribute could be of free text or collection of options There is a product which is assigned to category ...
-2
votes
1answer
178 views

message table schema - body TEXT or varchar [closed]

I want to make a small social network. For messaging body which one is more suitable? VARCHAR or TEXT? if VARCHAR how long is efficient?
3
votes
1answer
73 views

Storing statistic results

I'm doing a small database for statistics, it's a really simple statistic like calculating the cost of an event and divide it by the amount of people that went to get the cost per attendee, but it can ...
0
votes
1answer
89 views

How to create properly tree-hierarchy

I'm using web2py to create an application I've got 2 different roles: client and referents. Every client can have multiple referents. Both client and referent can insert row in a table, called ...
0
votes
1answer
168 views

Entity with >150 attributes: One table or many tables with relationships

I have entity with 170 attributes. It's data from vehicle monitoring. Every entity has datatime label and unique id of gps terminal. Datetime and id of terminal - these are conditions for GROUP BY ...
3
votes
2answers
135 views

Simple table normalisation

In raw form, I have data with 2 columns: skills in welsh and stats for that skill. For storing these information in a database, would it be best to combine the stats with the categories, or split ...
6
votes
5answers
1k views

Sharing a single primary key sequence across a database?

Is it an acceptable practice to use a single sequence as a primary key across all tables (instead of a primary key being unique for a given table, it is unique for all tables)? If so, is it ...
0
votes
2answers
112 views

Configuration Table

Can someone explain what is the difference between a Configuration table and a Data table in a database? And how to design or implement Configuration table? I'm using MySQL and the requirement is to ...
2
votes
2answers
205 views

Storing revisions in SQL Server (simply much like TFS)

So, what I've got so far: Table: ChangeSets Columns: Id | Comment | Committer Table: Customers Columns: Id | Name Table: CustomerChangeSets Columns: Id | CustomerId (FK) | ChangeSetId (FK) So ...
6
votes
2answers
809 views

Increase all primary key values by 1

How do I increase all of my EmployeeID values by one if it is the primary key?
0
votes
1answer
97 views

How to reduce table duplication, while ensuring integrity of the database?

For example, in my app I have some class called Contact: case class Contact(name: String, email: String, phone: String) And several other classes have one-to-many relation to that contact (for ...
0
votes
2answers
53 views

What should we call a table that stores changes to another table? [closed]

At the moment, we have a Persons Table. But we also need another table to store changes made to that Persons Table. But, my question is, what naming convention is used for tables that store changes ...
1
vote
2answers
186 views

How can I integrate a new system to a design scheme I previously created?

This is a follow-up to a question I wrote a while ago, for reference, you can look it up here. I've developed a curriculum based database scheme that looks like this(Thanks Joel Brown) Now that a ...
2
votes
2answers
83 views

Several stays: many-to-many relationship

Could you please help me with the following problem? I'm a total novice in DB design. I have a table with researchers who visit our university. They come for some period of time (from, till). Now, ...
1
vote
0answers
26 views

Optionally free-form reference

I've seen a few instances of entities which have a field which can be either a reference to another entity or free text. You typically represent this in the UI by having a dropdown widget which can ...
0
votes
1answer
286 views

How to design DB for statistics service? [closed]

I'm going to create statistics on RoR. I have 3 models: User, Project and Channel. User owns Projects, whereas Projects have many Channels. Now I'm designing all these models using MySQL. The goal ...
3
votes
2answers
98 views

What is the correct way to specify a record as the *current* record?

The two options I have thought of is either to add a column boolean column called Current onto the table; but I'm sure that would violate some level of normalisation due to more than one record being ...
4
votes
1answer
153 views

Probable circular dependency, but query still runs

I built this ER diagram in MySQL Workbench and it will run and generate the database. My concern is that the relationship between the employees, departments, positions, and employment_statuses is a ...
1
vote
1answer
163 views

Enforce a constraint problem

This business model is for a case management database. This is closely modeled on the idea of a file folder representing the phase and a sequential checklist representing the stages. A case consists ...
1
vote
0answers
91 views

The correct way of representing folders

I'm trying to kind of emulate a folder structure in my application. Now I've thought of two ways to achieve this, but what is the best practice for that? Table: Attachments Columns: Id (PK), ...
2
votes
1answer
238 views

SQL table architecture

I'm looking for a SQL architecture solution for the following problem. The idea is that I have a validation form that contains the client's data. Each client can log in to his account and edit his ...
0
votes
1answer
74 views

Multiple values for unique id? [closed]

I have two tables: customer and boxes in one-to-many relationship. The structure of the tables is in addition : Customer table : id#| name | date_purchased | address | 1 John ...
0
votes
1answer
64 views

What do you call numerical coding systems that are left-aligned?

I'm writing an importing mechanism for the NAICS database. I have a few questions about this code-format. I've seen it before and I like it the setup. I'm going to ask some other questions about ...
0
votes
1answer
257 views

How to handle versions of an Entity in Database Design

I am working on a new project. The domain logic of the project is as follows: A user uploads a file (Document) and gives a title, then another user comes along and (s)he also tries to upload a file ...
-3
votes
1answer
647 views

How to retrieve a query from 3000 tables in SQL? [closed]

I have plan to create 3000 tables for my database. But I am afraid how will I retrieve some data from those many tables. Eg: Select * from table1, table2, table3.... table3000 where ...
0
votes
1answer
347 views

Accumulo table design methodology

I am just getting started with Accumulo and NoSQL databases and I am looking for some discussion on table design. I get the key value structure that is seen in the manual. However, if I am trying to ...
1
vote
1answer
56 views

Is it always bad to have an own table for value objects?

I know that value objects should be embedded in the table of the object they belong to but what if the value object is more than a simple object and contains many fields/columns or even sub-objects? ...
0
votes
1answer
172 views

To EAV or not to EAV?

I am working on an application which records data from different forms. New forms can (and will be) constructed dynamically by an admin. I am wondering what would be the correct way to save this data ...
2
votes
1answer
774 views

Classifieds Database Design

I have always worked with CMSs, but I am trying to get into using frameworks like Laravel and Yii. My main issue is when working with CMSs, I didn't have to think much about the database design since ...
2
votes
2answers
157 views

Normalizing nearly identical tables

Background I'm managing a relatively small database project in which we are adding support for reporting involving status updates for items in out product table. I was bit thrown into this and I've ...
2
votes
1answer
89 views

Constrains relationship

I have the following design. Each user has it's own contacts, it's own hosts and assign those to a domain which belongs only to him. I want to insure that the host you assign to the domain belongs ...
1
vote
1answer
732 views

Database Design for lookup tables

I have a transaction table called questionnaire and a question lookup table called question_codes. questionnaire qst_id - number (primary key) question_type - number (foreign key) ...
1
vote
4answers
99 views

Better Indexing for MySQL?

Is it better to index each column individually with it's own key or to index multiple columns under the primary key? I've seen it done both ways in many different applications and I don't see a clear ...
0
votes
2answers
574 views

Which schema is better for a shopping project? [closed]

I'm working on a business-to-customer project that has variety of product types. There are a few properties like name, description, brand_id that each product has but there are also many specialized ...
0
votes
2answers
133 views

To normalize or not

I'm scraping data from a website and they have pages for Users and Groups. The pages are pretty similar; id, name, description, created date, number of elements and custom background. They also have a ...
0
votes
3answers
105 views

Design concerns for using 3x bit or one char(1) or one integer in table for holding status of item

I need to extend my existing table with status column. I am in doubt how to do that in most appropriate way regarding of future use of that status and performances of existing table. My table is ...
0
votes
0answers
149 views

Import only selected column from tsv into mongodb

Edit I am uploading very big tsv file thats why i dont want to import unnecessary column in mongodb, I know how to upload file into mongodb(just as attachment) as:- mongoimport --db xyztsv--c ...
0
votes
2answers
98 views

Best way to handle temporary data

Say I have a table prices. Users can see the prices of this table (I'm simplifying it). Users also can send prices to the server, so the server is going to collect these data in another table ...
1
vote
1answer
2k views

Postgresql vs MySQL - Which is better for join queries & writing data(inserts) [closed]

I have to design a database which will end up with 50M records in a single table(there will be other tables with lesser number of records). I'm more concerned with join queries & writing ...
0
votes
1answer
148 views

Can I design this database better? [closed]

I have the following database design: Script to reproduce: /* DROP TABLE [dbo].[feedback] DROP TABLE [dbo].[action] DROP TABLE [dbo].[download] DROP TABLE [dbo].[user] DROP ...