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)

3
votes
2answers
107 views

How do I deal with items that I need to repeat monthly?

I have a table where users will enter transactions on a weekly basis, these transactions will either be single items or will be recurring i.e. rent would be recurring and should be the same for every ...
3
votes
1answer
329 views

Removing “duplicates” within a time range

I have a table that contains number plate data with a date and time stamp, collected by a plate-reading CCTV camera at a site entrance. Vehicles stopping at the site entrance will create multiple ...
1
vote
1answer
78 views

Should I duplicate the data or have linking table?

We have the following data: Collections of items Individual items These will go into the following tables: ItemCollectionTable (Id, Name, OtherFields (desc, date, etc..)) ItemTable (Id, ...
0
votes
1answer
229 views

How to model medium.com paragraph comment

If you have used medium.com, I am interested to know more about how to model readers' paragraph comments in database. Specifically, how connections between these comments and paragraphs are modeled? ...
1
vote
2answers
325 views

Constant values in columns

I have a SQL Server 2000 database used by our ERP system. There are many columns that always have the same value. A table row is really huge, potentially exceeding the maximum row size in SQL Server ...
1
vote
0answers
170 views

How to store object with property of generic type in DB

In my business domain there exists an entity parameter. Beside other properties which are identical for each parameter, they have values. These values can be of different data types. There might be ...
2
votes
1answer
62 views

How to go about modeling the main object of relationship?

I'm using MySQL and MyISAM tables. I have a bunch of objects that I want to group together 1 object belongs to 1 and only 1 group 1 group can have many objects 1 group has 1 required main object ...
1
vote
2answers
141 views

Designing a user table, FName LName v.s Username

I did some research on different ways of getting user's name. Some database designers prefer to have a username that contains first name and last name with space separator, and some other designers ...
1
vote
0answers
109 views

Are duplicates ever acceptable in a database

A warehouse system I am working on allows inwards consignments [type = 0] and outwards consignments [type = 1]. The user selects multiple products for each consignment and then multiple warehouse ...
1
vote
0answers
67 views

Dynamic form from a database [closed]

I am considering to develop a dynamic form so all the fields and validation type can be stored on the database. For example I could do table design something like this: Field ID | Field title | ...
2
votes
1answer
80 views

Correct database solution?

So I work for a smaller company and currently we need to do our data processing with a desktop solution. We're running into memory limitations and the overall solution in most people's eyes ...
1
vote
0answers
34 views

What database to use for easily handling join-like queries on multiple very large tables? [closed]

I'm currently looking for a database engine than can easily handle queries on multiple collections/tables (at least 5) with aprox 10M entries each. Any advice on what to use?
4
votes
1answer
391 views

How to relate two rows in the same table

I have a table where the rows can be related to each other, and logically, the relationship goes both ways (basically, is directionless) between the two rows. (And if you're wondering, yes, this ...
0
votes
1answer
77 views

Two types of data, so two type of databases?

For a social network site, I need to propose a DB. The application is written in Java & will be hosted on VPS(s) initially. Broadly classified there is two type of data to be stored at backend: ...
1
vote
3answers
98 views

Which of these two methods is standard when creating a 1 to many database relationship?

If I have a customer that can have many addresses, I can create an Address table with columns Street, Town etc. and CustomerId. Then I can insert multiple records to have multiple addresses per ...
0
votes
1answer
118 views

Use surrogate or natural PK if a row is uniquely identified by two or more columns?

I am having a hard time choosing between natural and surrogate PK for my database table. The database is for a ranking system for an MOBA game. Here is more or less what I would do if I were to go ...
0
votes
1answer
121 views

Whether or not to create separate tables

I am working on a project, where I need to store the information related to A and B, the A and B both have identical columns.There might be thousands of As and Bs. Should I use "type" column to ...
2
votes
2answers
159 views

MySQL - unique constraints design

I am using MySQL and looking to solve a problem with relational data. I am not sure it is possible but wanted to ask the community. Please consider the diagram: I would like to add a unique ...
1
vote
2answers
115 views

Relations, dependencies and normal form

I have some issues in understanding about relations and dependencies. I will show two examples and what I want to know: Assume the relation GTX {G,T,X} with the following dependencies: G,X -> T ...
1
vote
1answer
67 views

Query for View with unique entries from Database with repeated entries

I have a table with columns of Hotel names, city name and country name (of the respective hotels). I need to create a view of unique entries which will contain city name and country name columns. Any ...
0
votes
1answer
96 views

Database Structure and Design [closed]

Okay my project in simple words. Multiple shop sites are hosted on different hosting services receiving orders from customers. All the orders are to be directed to the main company website where the ...
3
votes
0answers
211 views

Mathematical method for spotting irregularity in numbers flow

I am trying to build an engine which is going to predict orders for items inside shop. Three main variables are: Time-dates (x-axe etc 1.1.2013,1.2.2013 etc I do calculation one per day) Available ...
1
vote
1answer
162 views

Handling or preventing conflicts in a multi-user system

I have a web application that is accessed by multiple users from different locations worldwide. Let's say I have an "edit" form for a specific document and two (or more) users are editing the document ...
0
votes
1answer
56 views

Creating groups and members [closed]

Is this a good idea to manage members of a group like so: *Assuming members can belong to one group and no other *Simplified model Group: name someid User: name ForeignKey(Group) state ...
6
votes
2answers
260 views

Should I add a column or 1-1 table if property is usualy null

There's a new unique property we need to add, which is relevant only to a specific subset (less than 1%). We thought it's better to add a new table which will be 1-1, than to add a new column which ...
1
vote
1answer
139 views

How to link a customer to a country when the city/state isn't known

We have a situation where medical systems are sold to hospital groups, but at the time of the order, we don't always know into which state and city the system will be installed. We always know the ...
7
votes
4answers
314 views

how to explain indexes

This question is about teaching: When I learned databases, we talked about indexes being like the card catalog in the town library. We had at least an author index, a title index, then the Dewey ...
0
votes
1answer
141 views

store country name or country id [closed]

I am designing a database layout for a site. Agents registering on the site will have to enter their address including the country. Later I will build a dashboard where you would be able to ...
1
vote
2answers
61 views

Managing constants changes to database

Here's the deal, I'm in charge of creating a website that will host small web apps. This apps will be photo contests, creatives sentences and other similar gibberish. The deal is, since apps we'll be ...
0
votes
1answer
110 views

Cardinality showing the nature of relationships among tables

Lets say there's a table named Department and a table named Instructor. We've conditions that says : A Department can have many instructors. An instructor can be associated to only single ...
5
votes
1answer
689 views

Full text search through many tables in MySQL

We have high traffic NEWS websites, I want to add a feature that every user can search through over all content of site, such as news, polls, comments, galleries,etc . Each of contents type has its ...
-2
votes
1answer
88 views

Make “NOT NULL” default in Postgresql 9.2 [closed]

I use NOT NULL a lot when creating columns. Is there a way to make this default when defining columns? In other words, make column is_nullable default to NO. (I realize this would make it harder ...
2
votes
1answer
139 views

DB: Having redundant fields in Table

This is a basic DB design question but I now run multiple times into the same situation which I try to illustrate in the following example. Lets say I have make a DB-system for messaging in a ...
1
vote
1answer
672 views

Need advice for table design for multi-user access

I have an inventory application that needs to support multi-user. As of right now, only one user can access and manage their items. I've gotten a lot of requests to support multiple users so they can ...
0
votes
1answer
311 views

Database design for surveys in MySQL

I'm trying to design an app where users take a new survey everyday (that's not the main part of app but it's an important part). I've never designed a database before so what I'm trying to do might ...
0
votes
1answer
540 views

Need help designing table with list of IDs to store

I have a table that I need to create to hold saved emails for FUTURE delivery (to, from, message, scheduled send date, etc). The catch here is that I don't know who's supposed to receive the email ...
2
votes
1answer
58 views

How to handle “or” possibilities in MongoDB

I'm new to MongoDB and by no means an expert in DB design in general. This feels like a really basic question that's probably been answered a million times, but I'm having a surprisingly hard time ...
-4
votes
4answers
132 views

Is there a DB that will allow the same field name with different cases?

Is there a DB that will allow a user to create a table with two fields, one calls MYFIELD, the other called myfield?
-1
votes
2answers
245 views

Relationship between professor and course [closed]

I'm designing a database where I have a Course table and and Professor table. The business rules are : 1) A professor can teach many courses. (This is obvious). However, I get stuck in the second ...
2
votes
1answer
182 views

One to one mapping vs many to one mapping on data base design

I'm currently doing call detail records (CDR) data analysis as my project. On course of data-base design, I had separated the date (table contain id, day,month,year), time field (table contain id, ...
1
vote
1answer
780 views

Bus time schedule database design

Hi I'm trying to figure out how to design a database for bus time schedule. There are several lines, each line have two routes (forward and back), each route have several stations (stops) and each ...
1
vote
1answer
242 views

Database schema for a variable-level hierarchy with variable types?

A client is asking for a database structure for a medical translation app that involves narrowing down a health issue and then asking specific questions on it. The tricky part of representing this in ...
1
vote
1answer
310 views

Multiple foreign keys with shared columns for weak entities

this is my first question at stackexchange. I have a parent table (P) with two child (CC and CD): CREATE TABLE P ( A CHAR(3), B CHAR(2), CONSTRAINT PK_P PRIMARY KEY(A, B) ) CREATE TABLE CC ...
3
votes
1answer
447 views

Learning to draw entity relational diagram

I am trying to learn entity relationship diagram, following question is the objective. Information consulting firm has number of offices with employees. The employees can move offices depend on the ...
0
votes
1answer
1k views

Oracle db_name, db_unique_name, and ORACLE_HOME

I'm studying Oracle and I would like to understand the uniqueness or constrains when assigning these parameters. Suppose a machine with a single OS (host) and 2 different databases (physical). Are ...
0
votes
1answer
68 views

Modeling a database for easy counting / reporting

I have an app where user is known (user_id) and he can do several actions (action_id). Every time he makes an action I need to save the fact that he made it for reports/analytics. I guess it is ...
4
votes
2answers
3k views

How to choose a collation for international database?

I'm designing a database which will store data in different languages (using UTF-8), so I think the best way to display the queries results is ordering it according to the user's language during the ...
1
vote
1answer
3k views

Get top most parent by nth child id?

Now there is a question we commonly use this technique to maintain the parent child relation i.e we store all the entities in one tables with a parent_id column and all top most parents have 0 in the ...
1
vote
1answer
1k views

School database design

I am trying to design a database management system with my PHP and intermediate MySQL knowledge, keeping normalization in mind. These are the assumptions: The school has many students from grade 1 ...
2
votes
2answers
1k views

Should I use a separate table to store image file names?

I am learning about database design and I'm writing a Java GUI program with a back-end database. The main table in my database stores a different product in each row. I have some columns such as: ...