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)

0
votes
1answer
144 views

Is it better to use multiple one-to-many relationships, or polymorphic?

I've got the following tables: Clicks table Websites table Ads table Both Ads and Websites have many Clicks (i.e. both models have a one-to-many relation with Clicks). In such cases, is it better ...
-1
votes
2answers
257 views

How to snapshot or version a relational database when data changes?

My system receives data feeds. Each data feed will end up creating inserts and/or updates to most tables in the (relational) database. I need to capture the snapshot of what the entire database ...
2
votes
2answers
203 views

Storing data as rows as opposed to columns

Here's a typical way I would store data (obviously not storing the password in plain text) USER TABLE | UserID | UserName | FullName | EMail | Password | ...
7
votes
4answers
619 views

How to create a database for unknown kinds of data?

I am in the process of designing a database for a new PHP/MySql-based application. My problem is that I do not and cannot represent what should be saved in the database because it is unlimited and ...
1
vote
2answers
292 views

How should I store multiple relationships (many posts to many categories)?

I have posts stored in a posts table and I want each post to have multiple categories, what is the most efficient way to store the categories and their relationships ? I thought of it this way first: ...
1
vote
1answer
125 views

Database design: nested tagging

I have a situation that after an initial thought ended in the following tables: section: id, name section_tag: id, name section_tag_map: section_id, tag_id item: id, name ...
1
vote
3answers
146 views

Help with modeling this table

Thanks for reading my post...I'm new at setting up databases and am working on a simple practice app. I have a table called PhoneNumbers, which hold a list of phone numbers (duh). I have two other ...
3
votes
3answers
716 views

Relational vs Non-Relational Database for Events Database

I'm trying to find out whether an SQL or no-SQL solution would be better for creating an events database. I'm creating a ticketing system, similar to ticket master. I know that for either ...
4
votes
2answers
1k views

Why use separate databases for high traffic/volume tables?

While looking at the database structure of an application I am using I recognized that it uses 3 different databases on the same SQL Server instance for different things. The first one contains the ...
0
votes
0answers
78 views

In regards to GS1 barcode - what size DB field are used?

In regards to GS1 barcode - what size DB field is used or is the entire GS1 typically not stored in database, but rather processed in the application layer and stored in the database as a collection ...
1
vote
4answers
493 views

Unsure how to implement certain constraints and relations in this relational database schema

I am in the middle of designing the dB for school project- airline ticketing database.(Using MySQL workbench) So far, I came up with the following design: Here are couple things I can't figure out: ...
2
votes
2answers
105 views

Should I create an enumeration or individual flags?

I'm creating a new database table which will be used to store pictures of products. I'd like to identify the product "type" represented in the picture. Say we have 3 general categories for all the ...
1
vote
2answers
253 views

Unique Constraint with multiple null columns

I have two tables PC(Id,EmpName Not NULL, PCName NULL, HostName NULL,.... PhysicalLocation NULL, PCType Not NULL) PCNetwork(Id, EmpName Not NULL, PCName NULL, HostName ...
1
vote
1answer
298 views

Referencing multiple tables from a single table and store additional data

I have a database where I want to store lap time information from a racing game. I have tables for car, track, game, tuning and upgrade data and want to put all these together to create a single ...
0
votes
1answer
259 views

Database schema design help needed

I am developing a PHP application expecting millions of records both parent and children. My goal is to design an optimized database design to achieve high speed and performance. This application ...
1
vote
1answer
97 views

Approach for a 2,000 table migration

What might be the best approach when converting or migrating a database containing over 2,000 tables? Where would you begin to tackle such an issue? Steps to take in the first weeks of designing? ...
1
vote
2answers
105 views

database design- diagrams

I'm trying to derive an Entity Relation diagram from a class diagram. In the class diagram, I have a class Player with one to many relationship to another class Payment. In Payment there is no ...
7
votes
5answers
1k views

Database design: Dividing multiple identical tables, good or bad?

I am very new at SQL and databases in general. I only use them for the occasional homework so I haven't even tried to master them. I have seats at a theater, the seats are divided into 4 main areas ...
3
votes
1answer
672 views

Db design for historical option data (~200GB)

I need some help determining how to best design my tables. I have about 200GB worth of data I wish to place in a table (historical option price data). The table looks something like: String symbol ...
1
vote
1answer
77 views

Game database- many to many relationship

I am designing a simple relational database about a game that can be played by 2 players each time. I have these tables: Player, Game, PlayerPlaysGame, Payment. I recognize there is a ...
14
votes
11answers
1k views

Why are constraints applied in the database rather than the code?

Why are constraint applied in Database? Will it not be more flexible to be in code? I'm reading a beginners book on implementing databases, so this is a beginner's question! Let's say I design a ...
2
votes
2answers
305 views

How to implement posts with “seen by” like facebook?

Inside a Facebook group there is a feature when every time see the group newsfeed it mark all posts as seen by me. And if I see a specific post inside a group thought a url ...
-1
votes
2answers
68 views

Column or new table [closed]

I am working on a student management system for a private school. In the table "student" I need to indicate which public school the student came from. Can I just keep this information as a column ...
0
votes
2answers
233 views

“Variant” values structure and their use for multiple columns

note to the edit: the question originally was only about the opportunity of using a single "variant" structure for multiple columns, but all initial comments asked clarifications about the actual ...
5
votes
1answer
962 views

How to determine if there are [idle connections with] uncommitted transactions in PostgreSQL?

According to a comment on this question I asked about idle connections in PostgreSQL 9.2, some uncommitted transactions (possibly related to some of those idle connections) might cause some ...
1
vote
3answers
155 views

How to handle update or insert situations

From time to time my stored procedures looks like create procedure handle_data @fk int ,@value varchar(10) as begin if exists (select * from my_table ...
5
votes
1answer
2k views

Could too many idle connections affect PostgreSQL 9.2 performance?

Some queries on my database server seem to take a long time to respond, and I believe the CPU usage is high. When running ps aux, I see ~250 "idle" connections (which I believe to be too many). I ...
0
votes
3answers
101 views

Column partially determining accepted values of another column, should be somehow normalized?

I have a table that describes a set of properties (yes it's metadata, in this case there's a valid reason to have it in the database); among other things I tell the type of the data that can be ...
6
votes
3answers
678 views

Should I seperate frequently updated columns

I have a users table that contains users' information and a column named credits that is frequently updated. On index page I'm showing list of users with basic user information but I don't need ...
0
votes
1answer
175 views

Trying to create a Data Model

It may sound stupid but it's my first experience ever with databases. It's a simple database for a car accessories store. I was hoping when making a sale on a certain item it effects the quantity of ...
1
vote
1answer
462 views

Unique index for subquery with RANK() function

I have the following tables: CREATE TABLE Revision ( RevisionId INT PRIMARY KEY IDENTITY, UserName NVARCHAR(256) NOT NULL, DateTime DATETIME NOT NULL DEFAULT GETDATE() ) CREATE TABLE ...
1
vote
1answer
51 views

Adding users to a list and sort by category?

I'm using SQL-Server 2012 and I would like to know how to solve this program. So: I want to create a page that allows admins to manage a project, and part of it, would be to add members/employees to ...
5
votes
3answers
18k views

How to Handle TimeZone Properly in SQL SERVER?

I have some issue which needed to be fixed quickly. My local development server is in middle east. But my production server is in UK. Now, I need to show the date to user to thier timezone. For ...
1
vote
1answer
453 views

good practices of creating tables in mysql [closed]

Hi I was thinking of developing an web apllication using php and mysql. Application will give a professor the required data about the student. i want to design application considering Engineering ...
-1
votes
1answer
82 views

Research studies on electronic vs paper record keeping accuracy [closed]

Does anyone know of any research studies to test whether electronic or paper record keeping is more accurate than the other? Obviously electronic record keeping is more efficient, but efficient ...
-1
votes
1answer
90 views

Database theories possible topics to research through [closed]

I need to conduct a research on database theories. I want to know what possible questions should I research on which is believed to be suitable when researching database topics for a online assessment ...
1
vote
2answers
129 views

Handling expiration in a course registration or ticketing system

I want to restructure the database for a web application I inherited for handling summer camp registrations, but my question is relevant to any event registration or ticketing system. My question is ...
2
votes
0answers
158 views

How to execute a non-table-locking update operation on PostgreSQL? [closed]

Looking for a good way to update the value on a column for all the rows in a database (not huge, but big enough - about 10M records), without locking the whole table, so operations can continue while ...
6
votes
3answers
977 views

Foreign keys - link using surrogate or natural key?

Is there a best practice for whether a foreign key between tables should link to a natural key or a surrogate key? The only discussion I've really found (unless my google-fu is lacking) is Jack ...
0
votes
1answer
168 views

Foreign Keys with Composite Key

Imagine I have a table with the following dependency: (Name, BoughtFrom, TimeBought) --> Cost Where the three attributes in bold form a composite primary key for the table. Now then, I want to ...
6
votes
2answers
1k views

Bitmask Flags with Lookup Tables Clarification

I've received a dataset from an outside source which contains several bitmask fields as varchars. They come in length as low as 3 and as long as 21 values long. I need to be able to run SELECT queries ...
1
vote
0answers
116 views

Real Time data collection - Help select Database

My Scenario: I want to collect data from various sensors[for now I have 600 sensors sending data, but this may have to scale up to 3000 more data sensors, all sensors send real time data] Now I have ...
0
votes
1answer
151 views

List partitioning or filtering a non-partitioned table, which incurs lower cost?

Consider a list partitioned table PARTITIONED__SOURCE_TBL on column period, and non-partitioned table SOURCE_TBL also having the same columns. Assume all tables are adequately indexed. Set 1: ...
1
vote
2answers
465 views

How do I design a database for a resource scheduling and allocation application?

I have two entities: Resource and Project. A Project runs for a certain amount of time (in calendar days), and I need to allocate several Resources to it (allocation interval - 1 work day, not an ...
0
votes
2answers
139 views

Database design - do I need another table?

I am trying to make a database that follows a form that the company uses. When a client walks in the membes of staff have to fill in a form and the data is recorded. The form on paper is 10 pages ...
1
vote
1answer
130 views

Best way to set up database tables

I have 1 user table and want to associate it with multiple other tables depends on if user have added such information (modules) and want to know what is the best way to do it. main table ...
0
votes
0answers
88 views

Database Schema/Structure advice

Well i am reconstructing an already created application and was looking to improve this, especially with in the database structure. I want to start off with probably the biggest section and that is ...
5
votes
1answer
336 views

How does PostgreSQL physically order new records on disk (after a cluster on primary key)?

Need to know how PostgreSQL orders records on disk. In this case, I would like to take advantage of index combination as stated in the docs, which as I understand uses bitmaps to get matching rows ...
1
vote
1answer
306 views

Record with variable number of columns?

I am trying to model a cable mapping for devices. Each device has multiple cards, and each of those cards has multiple ports. Since both the number of cards and ports vary, I am confused on how to ...
2
votes
3answers
375 views

How can I improve my table design for different types of an entity?

Consider an accounting system as an example. I have an Entity called Client. Client can be of different types, with different fields applicable to different types. I consider creating separate tables ...