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)

2
votes
0answers
39 views

Constrain referenced rows to two different tables to belong to the same row in another table

Apologies for the potentially confusing question title. I struggled to make it generic! I am designing a wildlife recording database. An observer goes to a site and records the occurences of species ...
1
vote
2answers
43 views

Is there a reason to store currency amounts as fractions instead of decimals?

I've been reviewing GnuCash's DB design and I found that they are storing amounts as two 64-bit integers, the numerator and denominator of a fraction. Is there some advantage from a DB perspective to ...
2
votes
2answers
205 views

Design of an application log database

We are generating logs like following example(this is a table no actual pipes): 2014-06-10 09:00:03.457 | Channel1 | Operation3 | Function15 | 15ms 2014-06-10 09:00:08.245 | Channel2 | Operation5 | ...
1
vote
1answer
35 views

Should a ledger DB store a separate line for each side of a transaction?

I'm working on a database that needs to do manage transfers between several accounts. We are considering using a simple ledger system for this (like what you find in Quicken). I have two concerns ...
0
votes
1answer
53 views

Need some expert eyes to look at my schema

I am trying to make an online site for local movies. Will be written in PHP and will be using MySQL as the database. What I want is to create a mini IMDB type site, with movies, people(casts/crew), ...
0
votes
1answer
48 views

Train Fare Database Normalisation

I have a database to normalize. The database has details of train ticket fares. The trains have different fares depending on the distance and I have to store these fares in the database It is not an ...
0
votes
2answers
36 views

Does this break normalization?

I have an order table, and in the order table I have a contact_id. Now, each contact is linked to an account. For my order table, should I have both contact_id and account_id? If I wanted to say, ...
2
votes
0answers
72 views

Database Design - Multiple Dbs or Single - Security & Data

I've hit a brick wall with this and just cannot make a decision so want to throw this out there and see if there are any issues I have'n't considered. Basic Topography I have a system that currently ...
0
votes
1answer
57 views

Split MySql table into two tables with One to many Relationship

I have an old database table in MySql. It is used to store the orders from online ecommerce. Simplified diagram looks like this: +----+------+-----------------------+-------+--------------+ | id | ...
0
votes
1answer
73 views

Best way to store country and city information

I always wondered what is more efficient between two. There is one "main" table where I store all user related informations. Also, there are two more tables, country and city tables. city table ...
0
votes
0answers
21 views

Performance and maintainablity of a large MySQL table with hundreds of columns

For a project of mine I need to have a table with around 400 hundred columns of type nullable indexed VARCHAR(128), this table is going to store at least 50 million rows and has one column of type ...
1
vote
1answer
42 views

Import using pgAdmin3 produces ERROR: duplicate key value violates unique constraint

I am importing from the GUI a CSV file into a table. I have created the following table: CREATE TABLE jira_tickets.daqa_rpt_tbl ( daqa_report_id bigint NOT NULL DEFAULT ...
0
votes
1answer
27 views

What table should I host data linking two objects from separate tables?

I've tried searching around, but I'm not too sure how to correctly formulate this question, and found nothing. Could be a duplicate. What is the best way (most efficient way) to host data that will ...
1
vote
0answers
73 views

Postgresql - How to Convert all Column Names to Lowercase

I have a travel survey with a series of tables (lots and lots of columns) that I exported from MS Access into a postgres database. I've search around a lot for an explanation of how to convert all the ...
1
vote
2answers
54 views

compound primary key with separate id field for reference

I am trying to build locations into a database like so: Country -> Region -> Town Countries will be populated with a list of pre-defined worldwide countries, regions & towns are input by users. ...
1
vote
1answer
96 views

Slow delete caused by many foreign keys

My DB has about 90 tables. Most of the tables have an UpdatedBy and AddedBy column that have foreign keys pointing back to the user table. With even moderate amounts of data spread throughout the ...
2
votes
0answers
33 views

Database for temporary data with 2^20 variables [closed]

I'm building a site to display graphs based on a data set with 1024^2 different variables (columns, traditionally) per point (record). That is to say, the points are in 1048576-space. The data is ...
1
vote
1answer
57 views

Delete and Update of Foreign keys [closed]

I'm working on a school project. And I'm required to implement it using Java-EE and SQL Server. I want the design to withstand any kind of faulty user requests. My questions are how should I design ...
2
votes
0answers
31 views

Proper design of routes in Database MySQL

I'am trying to find out the best database design and try to stick with data integrity by using Foreign Keys. But I'm stuck right at the beginning because of limit relations between tables with FK to ...
0
votes
2answers
79 views

What is the advantage of using numeric primary keys in a relational database?

Many tables in a relational database system (in my admittedly limited experience) have this sort of structure (Oracle syntax as that's what I'm used to): create table widgets ( widget_id number ...
0
votes
1answer
33 views

Foreign key double inheritance SQLITE

I'm designing a domotic system database and I'm trying to figure out how to represent two foreign keys. This is the cardinality I want. Consider 1...N Areas (rooms, halls, kitchens, etc.): Area 1 - ...
1
vote
1answer
55 views

Get data from Berkeley DB with Java [closed]

I have a basic Java program which can list data from Berkeley DB database. The question is how I can list the database scheme to see what object are available? Unfortunately I don't have information ...
1
vote
0answers
20 views

What is the best type of database for numerous multi-threaded access? [closed]

I am developing a simulation and have limited experience working with databases (very limited SQLite3 exposure). Here is my task: Server that stores a potentially large database (no size requirement ...
1
vote
0answers
16 views

Modeling for inclusion of two different entities

What I Have I am currently hashing out the data model for an application that will utilize MongoDB. In my setup, users or members (as they are called in the schema) will be created and then assigned ...
1
vote
3answers
66 views

How to store list of unknown size in database

I have trouble with database design and don't know how to overcome this. The problem is with list of cities between two chosen city. User chooses start and finish city, and OPTIONALLY, user can write ...
0
votes
0answers
191 views

Need help to create chat application database schema?

I am developing a chat application in asp.net using SignalR. Client requirements are: Admin can create different chat rooms e.g. (News Room, Sports Room, Android Room etc) Registered users can ...
0
votes
2answers
64 views

Is this database design correct?

I'm trying to represent this: A message can be sent to one or more recipients. A user (recipient) can receive zero or more messages (but he/she could receive a message only once). Is my database ...
3
votes
1answer
96 views

Is this a step in the right direction for normalization? SQL 'inheritance' and Many-to-Many relationships

Context: So, this is kind of a compound question, but they go together, and definitely wouldn't make sense split up into separate questions. I've been working on a new database for what will end up ...
1
vote
2answers
124 views

When normalizing a relational database, should multiple “type” tables be combined into one?

Before making substantial changes to the content, functionality and design of my website (I'll be refactoring everything, almost a complete rewrite), I'm setting up a new PostgreSQL database to hold ...
0
votes
1answer
115 views

Storing multidimensional array in MongoDB

I am attempting to convert a large MySQL database of product information (dimensions, specifications, etc) to MongoDB for flexibility and to move away from the restriction of a column based table. I ...
3
votes
1answer
79 views

Optimum design / structure for product data database?

What would be the optimum design/structure for product data database, where each product have many variations and many attributes? Attribute sets vary between products, and some attributes have values ...
1
vote
2answers
109 views

Oracle 11.2 using too few memory

it is about one year that I have changed my server from Oracle 10g to 11.2g (and also changed the hardware and Windows from 2003R2 to 2012). The problem is that with more than doubled cpu power, ...
0
votes
1answer
52 views

Is array serialization always bad idea?

I'm making form-generating app in php. I have Widget table with type_id (html input) field, and I would like to add options field, like width/height, step, range, etc. Different widgets do have ...
0
votes
0answers
69 views

Is there better way to design SQL tables

I need to design a quick application for small warehouse. I just want to check if there is a better design approach. I am using polymorphic associations for comments tables. Business Rules If ...
1
vote
2answers
35 views

Keywords - column or separate table

I am building a website on MySQL with php, and I have 400+ products in a table. I have three columns with comma separated values, each has 1-3 values separated by commas in each row. I was wondering ...
0
votes
1answer
50 views

Storing a music playlist, best approach?

I am working on a web project that creates playlists online based on youtube links. My question is how do I store a playlist on MYSQL. What I was thinking about doing was having a table with ...
-1
votes
1answer
27 views

Lookup tables and performance

I am using 6 lookup tables in my mysql database. There will be frequent insert,update and delete queries in the db. Will that badly affect the performance. Do I need to save the data as it is without ...
3
votes
1answer
172 views

Is this many to many relationship correct? [duplicate]

I'm reading this tutorial, and I have question about it. Look at this picture: 'Reading' the logical Relationship I read that a Project must have one or more Employee. But the physical ...
2
votes
1answer
119 views

Should I split these fields or leave as one?

I want to create a database listing characters in each book of the A Song of Ice and Fire series, listing the name of the character and the page in which they appear. I could just use three fields ...
1
vote
0answers
27 views

Preventing unique key constraint violation when pre-existing row has 'expired' [duplicate]

I have the following table schema; CREATE TABLE LOCKS ( lock_uid INTEGER NOT NULL, file_uid VARCHAR2(32 char) NOT NULL UNIQUE, owner VARCHAR2(255 char) NOT NULL, expires DATE NOT ...
1
vote
1answer
33 views

How to represent a many to many relationship with Crow Feet diagram

I'm designing a database and I want to represent the relationship between users and groups: A user can be on zero or more groups. A group can have one or more users. Using Microsoft Visio 2013 I've ...
1
vote
2answers
50 views

I don't know how to read many to many relationships

I'm reading this tutorial, and I have question about it. Look at this picture: Looking at Physical Many-to-Many Implementation I read the relationship this way: 'A user can be in zero or more ...
1
vote
1answer
100 views

Why do we not store names in a separate table?

Practically, I would never store names for customers in a separate table. But why not? It's a one to many relationship (a person can have one name but that name can be used by multiple people). ...
0
votes
1answer
35 views

Schema for dynamic number of attributes

I am implementing an application where users can save alerts for different services. Each service can have multiple types of alerts and each alert has X number of attributes to form a predicate. So ...
5
votes
1answer
130 views

HStore vs. multiple tables with inheritance - do I have a good use case for HStore?

My broader question here has to do with when it is appropriate to use HStore vs. multiple tables vs. one table for storing document-like objects. Now, for my localized example: I’m designing a ...
2
votes
1answer
37 views

Peer review database design for various reports

I'm currently trying to redesign a poorly thought out database for a peer review system that we use internally at my workplace. Employees can log on and submit a review about another employee who ...
0
votes
0answers
10 views

Removing a large amount of data from a workbench model

In MySQL Workbench you have the ability to add data (inserts) to tables you are designing. Currently I have a model with some tables, and I have added a lot of test-data to one of the tables. This ...
0
votes
1answer
71 views

How do I connect my MS Access database to the LAN? [duplicate]

I wrote a database program in MS Access a couple of years ago, and it is used to keep track of some personal stuffs. I now want to expand this personal project and allow several computers to have ...
0
votes
0answers
21 views

ER Studio Data Architect - Deleted relationship in sub model - need to sync up in main model

I have Main Model where I have few entities and relationships. I had pulled out few entities from the Main model into a submodel and was working on the sub model. whereby I had to delete few ...
0
votes
1answer
51 views

desing the database for survey app with various types of answers

I have to create a survey app for which answers should be stored in the database. I created an html form containing some questions (about 30) with various types of answers (check boxes, radio buttons, ...