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 (3)

0
votes
1answer
109 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: ...
2
votes
3answers
162 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
128 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
165 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
184 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
124 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
77 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
110 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
1answer
243 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
201 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
58 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
367 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
173 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
373 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
230 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
66 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
134 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 ...
6
votes
1answer
1k 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
109 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 ...
3
votes
1answer
206 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
votes
1answer
615 views

Calculating employee's work time

I need to store and analyze employee's work time. Currently, I've developed this table structure CREATE TABLE `hirefire` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `employeeid` int(10) ...
1
vote
1answer
1k 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
371 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
698 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
64 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 ...
-5
votes
4answers
139 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
371 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
252 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
1k 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
362 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
422 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
548 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
2k 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
71 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 ...
5
votes
2answers
6k 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
2k 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
2k 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: ...
3
votes
1answer
160 views

Most efficient ordering post database design

I have posts table that is has post_order column. I store order of each post in it. when I change the order of a row from 25 to 15, I should update all the row from 15 to end. It's good for few rows, ...
1
vote
1answer
98 views

representation in ms-access

I have a database in microsoft access. I want to know how to look up a singular datum from a reference table giving a dynamic set of values. Here is a representation of what I mean: I have the ...
1
vote
3answers
298 views

Is this good/bad database design and why?

I am building a database for a small project. I don't have much experience so I am unsure, but I get the feeling I am not approaching this correctly. I have a system which allows users to create ...
0
votes
2answers
2k views

Order table Database design

I'm in need of some help with the database design of order table of a shopping cart for online food ordering system. I have a design below. Tables about which I'm Concerned are order_details and ...
2
votes
0answers
223 views

Geographic Hierarchies in a OLAP Cube / Data Warehouse

Are the following geographic hierarchies correct? Do any US/Canadian area codes cross state/province lines? Do any US/Canadian counties cross state/province lines? Are there countries with counties ...
0
votes
0answers
513 views

Trouble converting MySql Database to SQL Server

I have an mysql database that contains 38 tables. I used "SQL Server Migration Assistant for Mysql" tool to convert this database to SQL server Database. I successfully converted 37 tables. Only one ...
3
votes
1answer
103 views

Constraint to one of the primary keys as foreign key

Table1: grid_col (col_id,f_id,f_value) (col_id,f_id) is primary key. Table2: grid (grid_id,col_id,text) (grid_id) is primary key. I want to have a constraint for grid that, col_id ...
0
votes
1answer
117 views

Database design in MySQL

I am designing a database for an web application, in this system there are multiple users. Consider, Public (Buyer). Merchant. Tele Marketing Executive(TME). Marketing Executive(ME). Lead ...
1
vote
1answer
79 views

When do you add your foreign keys?

I'm scripting out a fairly simple database so I can simply hand off a script to someone else for an application to use. I'm curious about where best practice/the community stand on this: When should ...
3
votes
2answers
216 views

Scalability: Desiging a message table

This question might be deadly simple but I wanted to make sure I am going through the correct path and not making any simple and irrevertible mistakes. My project will be based on messaging and it ...
-5
votes
2answers
194 views

Inserting images in database [closed]

How can the images be inserted in a table? Var binary is not working in structured query language command prompt,what can be the syntax?
1
vote
1answer
305 views

Storing different countries' administrative divisions

I'm designing a data base which should relate users to their administrative division for statistical purposes, considering that every country has its own type of divisions. Chile, for example, is ...