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
1answer
49 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
47 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
32 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
2answers
57 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
50 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
55 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
77 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
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
60 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
76 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
22 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
44 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
74 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
100 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
80 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
34 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
67 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
206 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
128 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
117 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
80 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
113 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
70 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
37 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
120 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
34 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
52 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 ...