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
2answers
176 views

Implementation Idea for login structure (login id with two different tables)

I am creating a sample web application for a business and I am stuck at the login implementation. There is supposed to be two different users (login types?). I will have employees and customers. I ...
5
votes
3answers
972 views

Separate archive tables or soft delete for inventory database

I'm building an inventory database that tracks computer equipment and other hardware devices. At some point in any device's life it is retired and gets archived. After it becomes archived it needs to ...
0
votes
2answers
1k views

help in multi-language medical database?

My project is to design a medical database for many countries. This database contains many parts: medicines, medical centers, patients, etc. for every country with its own language. I started my ...
3
votes
2answers
420 views

Help with a multi-language medical database

My project is to design a database for medicines in many countries. Medicines have various criteria like composition, price, manufacturer. Database will be multi-language; related to each country. ...
1
vote
1answer
422 views

ORDER BY on aggregate field on a closure table giving unexpected results

I am updating my companies product database and I'm looking into different ways to do design our faceted navigation "selector" tables. The idea of faceted navigation might look like this: It's ...
1
vote
2answers
59 views

How to change type from one owner to two different types of owners

I currently have (tables changed): User UserID uniqueidentifier, CompanyID uniqueidentifier, (for future reference) .. more unrelated fields (PK: UserID) UserRating UserID uniqueidentifier, ...
5
votes
3answers
5k views

Visio 2010 and SQL 2012 - Reverse Enginnering

We have upgraded to SQL 2012 and Am trying to reverse engineer our Dbs into Visio 2010. I setup a connecting using SQL 11 driver and Visio complains that that driver is not supported. Any one run ...
4
votes
2answers
1k views

How to store formula method in the table

I am trying to figure out how to store formula method in the table (I could create category_formula table). Each category will have different way of formula method to calculate the point and I need ...
9
votes
1answer
664 views

Choice of authentication approach for financial app on PostgreSQL

First some background. The LedgerSMB project is an open source financial accounting software project that runs on PostgreSQL. We implement a very large amount of business logic in user defined ...
4
votes
4answers
621 views

Applying Single Table Inheritance

From that StackOverflow's question: Summarizing: My CRUDs are: customers, employees and branches. Customers and Employees are associated with one Person, one Individual (fields related to the ...
5
votes
2answers
3k views

Allowing Foreign Key to be Null

I'm trying to create a relationship between two tables where one column in TABLE A is the foreign key for a column in TABLE B. However, there is one row in TABLE B that is currently null in that ...
4
votes
3answers
691 views

Lookup table for a one-to-many relationship

I have a tickets table with an id that I need to associate to a lookup table where the counterpart of that data is another id that is controlled from an outside source. tickets - id - sutff lookup - ...
1
vote
1answer
92 views

What is the best relationship model for high performance?

I want to model a relationship between Customer and Transaction. However, because Customer is only described by a unique string and no extra info, I have two possibilities to implement it in the ...
1
vote
1answer
126 views

Database Design - When to use “attributes” rather than additional columns

I'm wrestling with a schema design issue. I'm attempting to determine when I should add another column instead of making it an "attribute". Rather than adding a numerous columns to a table, I ...
1
vote
3answers
136 views

Database schema - performance v correctness information

I have a database that stores information about the users of my website (username, password, etc). I also store information about their activity on the site. For example, I have a large number of ...
2
votes
2answers
503 views

Closed loops in database model, does it affect the performance?

I have heard that having loops in the database relational model should be avoided. From what I can think of, it is not a good practice, because there will be more than one different pathes to get the ...
1
vote
1answer
859 views

How to design tables for dynamic payroll items

I have to design a database for the payroll system. The requirements are as follows: Admin can create payment items, such as Basic Salary, Overtime, Housing, Allowances at run time. Each payment ...
3
votes
2answers
869 views

Index max row size error

Is there a upper bound for an array column? I am getting this error when inserting into the array field - PG::Error: ERROR: index row size 3480 exceeds maximum 2712 for index "ix_data" Here's my ...
1
vote
2answers
133 views

For a boolean settings table, should I toggle a flag, or insert/delete?

I have a settings table. SETTINGS -------- settingId int settingName varchar(20) Each user can choose to apply the settings, or not. The interface allows them to quickly toggle the settings on ...
2
votes
1answer
92 views

Help with database design

I'm quite the beginner when it comes to databases, so please bear that in mind. I need to store user statistics in several categories for an application. In the near future I will most likely need ...
4
votes
1answer
126 views

SQL Server 2005, Foreign key check against part of a table

I have an articles table that references a categories table. I'm defining the foreign key like this: constraint fk_categoryid foreign key (categoryid) references categories (categoryid) on update no ...
3
votes
0answers
267 views

How to design a database for financial bond prices?

I have following flat file table composed of bond deal names and asociated prices. Each deal name is identified by its unique CUSIP and ISIN codes and each deal name is classified with a certain ...
5
votes
2answers
645 views

Choosing MyISAM over InnoDB for these project requirements; and long term options

Sorry for the long post, but I had to give as much info as possible to make this very vague question more specific. My project's aim is to let users search a (huge) database of variety of products. ...
7
votes
2answers
650 views

Design Pattern - One of Many Parent Tables

I come across a situation in database quite frequently where a given table can FK to one of a number of different parent tables. I've seen two solutions for the problem, but neither is personally ...
1
vote
0answers
94 views

key value database

I have one object and a lot of data associated with that object, you can think of it as something like facebook timeline where we have user and user has a lot of posts. I cannot store data in JSON ...
2
votes
0answers
1k views

Schema for an RBAC (Role-based Access Control System)

I want to implement an RBAC, Flat based. I've decided to base my system on the NIST standardization model. Although all fine and well, I have an inclusion to that design. Instead of a hierarchy ...
6
votes
4answers
3k views

Is there a tool to check if my database is normalized to the third normal form?

I learned about normalization recently, and understand how important it is when implementing a new schema. How can I check if my database is 2NF or 3NF compliant ? Manual review is a sure option, ...
1
vote
1answer
1k views

Planning simple CMS: How much relation?

I'm currently in the process of designing the database for a rather minimalistic Content Management System I'm working on alone. It should allow scalability while remaining speed, especially on boxes ...
1
vote
1answer
210 views

One address table for many types of addresses

I have an application where I have to store adresses of multiple types of location. For example, my app requires addresses of people, hotels and event venues. Should I create separate tables for ...
4
votes
2answers
626 views

Partitioning a table vs moving entries to another table

I don't understand how partitioning helps me more or less than using a separate table to store older records. I need to maintain a list of stock entries along with historical records about the stock. ...
3
votes
1answer
146 views

Economic Database Architecture Possibilities w/ Data of Varying Length

I'm in the process of designing a MySQL database (InnoDB) that holds a large amount of economic data which our application scores. The size of the economic data varies a great deal: some measures, ...
4
votes
1answer
2k views

Product Attribute List Design Pattern

I am working on updating our website's product database. It’s built in MySQL but this is more of a general database design pattern question. I’m planning on switching to a Supertype/Subtype pattern. ...
2
votes
2answers
1k views

How would you design a table for a booking system?

I have a design database for a booking system. The booking system requirement are as follows: The booking system allows user to book a time slot (1 hour) between 8 am to 1 pm for Monday to Friday. ...
1
vote
3answers
270 views

Mysql error while creating FK

here is structure of both tables category table CREATE TABLE category ( `catID` bigint(20) NOT NULL AUTO_INCREMENT, `title` varchar(60) NOT NULL, `created_at` timestamp NOT NULL DEFAULT ...
1
vote
2answers
171 views

What are the pros and cons of this schema for flashcards app?

I am planning a flashcards app with the following schema: user(id, name, email) flashcard_group(id, user_id, group_name, group_tag) flashcard(id, group_id, question, solution) guess(id, user_id, ...
1
vote
1answer
111 views

Is MySQL replication suitable for a Write Mostly application?

I'm considering adding another server to my one-server setup application with 600GB MySQL DB. The db and the apache are both running from the same server. In order to avoid backup downtime and improve ...
4
votes
1answer
370 views

MySQL database normalization 3NF

I have homework where I need to create simple web interface and a DB normalized to 3NF. I've chosen ISP client selfcare as my database purpose. Web interface is no problem, the normalized DB is. After ...
2
votes
1answer
119 views

Unique foreign key constraint between three tables

I'd like to track appointment attendances. Visitors can have appointments, or they can just turn up. If they have an appointment, and miss it, in which case I'd like to record a reason for the missed ...
4
votes
1answer
318 views

Should I Link a Fact to Hierarchical Dimension at ALL Levels or only the most granular?

Related question about the same project here. I'm looking at two approaches to model a hierarchical relationship between my fact and dimension tables in a data warehouse for storing IT infrastructure ...
2
votes
1answer
182 views

Representation of circular references constraint

We have a database where we store commands and properties for devices that may be controlled via a network. For instance, "Concrete Device" is an instance of some DeviceType, which in turn contains ...
0
votes
1answer
169 views

Mobile Phone & Tariffs

I have designed database tables of Mobile Phones & Tariffs. It should support multiple mobile networks, sale type and the related affiliate. Points (for operators) are vary depending on the ...
2
votes
2answers
394 views

How do I optimize this database design?

I need to create a vehicle tracking database. There are several vehicles that send data, consisting of around 20 parameters, to my database. The parameters of a vehicle include the constants ...
0
votes
1answer
133 views

Database column vs row size

I have Column A and Column B in a single table. I need to add 1,000,000 records to this table. I have 2 options: Keep 2 columns and add 1,000,000 records Add more columns and flatten out the ...
6
votes
4answers
428 views

Can this business logic be enforced by a conditional database constraint?

I am trying to duplicate the business logic embodied an intranet C# web application in the database so that other databases can access it and work under the same rules. This "rule" seems difficult to ...
3
votes
1answer
337 views

Curious Database building Problem (ER Diagram)

I am trying to build an EER Model for a Autostore that has 5 locations and offers a range of auto products. They offer car repairs and roadworthy tests as a service also. I need to be able to make ...
3
votes
1answer
71 views

linking databases for reporting

I am attempting to design a simple reporting feature for some financial market data. I have a few sets of data, and I am trying to figure out what will be the best way to organize the tables, in ...
1
vote
3answers
1k views

ER Modeling; multiplicity basics - one to many or many to many?

Apologies for a basic question, but I’m having difficulties determining the multiplicity constraints for a database I’m trying to design. Our team undertakes a number of services/projects...each ...
3
votes
3answers
285 views

An “unlimited” data model

I need to store an unknown amount of fields. Some are numbers (like IDs, zip codes and times), some are short strings (like names and states), and some are longer strings (such as descriptions). All ...
2
votes
2answers
340 views

Replacing composite key with surrogate

I have the following table that has a couple of million rows in it and is 99% fragmented virtually all of the time. My plan was to insert a IDENTITY field as a surrogate key to replace the current ...
5
votes
2answers
163 views

Web Database - How to store user information

I'm starting to design a database to use in a web solution and would like to understand if there is any benefit to storing passwords (and the rest of the user information for that matter) in a ...