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
3answers
109 views

Entity Relationship Model - double one to many

ERD A customer submits one or many leads. A lead belongs to one customer. A lead is a request or an inquiry. A lead belongs to one manufacturer. A manufacturer has one or many leads. Tables ...
1
vote
0answers
20 views

Optimize finding the next batch of data from A to be crunched and inserted into B

I'm using PostgreSQL to store data produced by a large distributed computation. There are several stages to this computation; the idiom we've settled on is that there's a table containing the results ...
3
votes
6answers
531 views

Database Normalization - Can one field point to another?

This may sound like a dumb question, but I am a software developer new to database design... So the concept makes sense to me, but maybe this doesn't carry-- Is it possible for a field in a record ...
1
vote
2answers
43 views

Designing a Course Equivalency Database

I am trying to create a database to store information regarding equivalent courses transferring from one school to another. I am struggling to conceptualize the relationship in a way that can ...
0
votes
1answer
88 views

Problem creating database using default mdf and ldf path

I'm trying to create a database using the default paths on several SQL Servers at once. To achieve this I'm trying to use a script that should create the database on each server, however I've run into ...
0
votes
1answer
70 views

Creating and designing Air Trafic Control System [closed]

I'm having a class about Database management system, and the prof. gave us a project regarding Air traffic controller system, exact question is "Design and create a system which can manage ...
0
votes
1answer
58 views

Can I get some comments on my database design? [closed]

I have designed a database for my institute. Here I have attached my design for better understanding. I am expecting your reviews who are professional for the database design.
0
votes
1answer
59 views

Normalization of Time Series Data

I have a table containing various a/b test experiment performance on a daily basis. The table structure looks something like this: date | experiment | user_count | user_attr | sales ...
1
vote
2answers
81 views

Best way to store immutable/read-only copies of data for logging?

I'm storing data about tasks like so TASK (id, name, employee_id, machine_id, ...) For logging purposes I would like to store any information about that TASK once it was made. Since the reference ...
1
vote
1answer
60 views

Documenting a collection of databases and their relationships with each other

As part of a project I'm currently involved with we need to identify where various data points are held within existing systems, with a view to integrating them into our central integration engine. ...
1
vote
1answer
207 views

Horizontal schema vs Vertical schema

I am but a modest SQL DBA. I would like to request your advice on the design of the central part of our new proposed database. Brent Ozar had something to say about this: Building A SQL table ...
1
vote
1answer
62 views

Should I use a surrogate key in a mapping table?

I am deploying a mapping table which connects Items to ItemGroups Though an Item will only ever be in a single ItemGroup please accept a priori it is not appropriate in my use case to append a column ...
0
votes
1answer
64 views

Database design Problem for the web-app

Hello I am in a problem of designing a web-app database schema. Suppose I have 10 shops and every shop gives deals on every different day Sunday, Monday and so on and for limited time period like ...
2
votes
0answers
48 views

“Wide” vs “Long” Database Structure - Is there a logic when to use which? [duplicate]

I'm currently setting up a database to house records for an application I'm writing and am trying to come up with the most efficient DB structure to use... Of course I know that there are as many ...
0
votes
1answer
34 views

SQL - Query on table creation, referential integrity

Please let us know what does the below definition means on table creation. CREATE TABLE A(w INT PRIMARY KEY); CREATE TABLE B(x INT PRIMARY KEY REFERENCES A(w) ON SET NULL) As per my understanding, ...
1
vote
3answers
283 views

Postgresql: datatype for email address

What would be the right datatype to store email addresses in PostgreSQL? I can use varchar (or even text), but I wonder if there is a more specific data type for emails.
2
votes
1answer
74 views

Review database schema / thought process

Please review my thoughts below. It is written in an authoritative style because it is the most succinct, not because I am competent. Please poke as many holes as possible. I am trying to create a ...
1
vote
0answers
83 views

“Replicate” Table structures with sp_addscriptexec

In our customers environment is a massive central server (running SQL Server Enterprise 2008R2) and some distributed PCs (running SQL Server Standard 2008R2). The central server has a replication for ...
1
vote
2answers
94 views

Table design for multi-type data

The information model I am modelling from includes an "any type". For example a customer can have zero or more 'entries' each of which can have a number of values. Each value could be a either date, ...
2
votes
0answers
41 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
52 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
214 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
2answers
102 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
73 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
2answers
69 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
38 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
115 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
163 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
195 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
39 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
100 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
35 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
98 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
59 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
235 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
39 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
60 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
44 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 ...
2
votes
2answers
159 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
58 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
67 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
21 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
18 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
72 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
846 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
68 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
109 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
205 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
511 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
110 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 ...