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
votes
1answer
42 views

Relation that combines entries with their subsequent entries, in order of date

I need to come up with a query that can do the following: I have a table with a bunch of transaction records, whose attributes are not important, other than the attribute Date. I need to come up ...
1
vote
1answer
74 views

Data modelling concepts

Let´s say I have 3 entities. Can I have them all linked to each other "forming a circle" where each one is linked to the other trough a many to many relationship. Cheers
3
votes
2answers
127 views

Can relationships have relationships?

I have the following requirements (as part of a larger system). In the database, I need to maintain a list of parts, suppliers who sell those parts. Many suppliers can sell the same part and each ...
0
votes
2answers
86 views

Table Design Cardinality

I am designing a database for an application, in that I need to consider both BUYER (BUYER_ID) and VENDOR (VENDOR_ID) as a USER (USER_ID). I have designed this logic in a following design. USER ...
1
vote
0answers
80 views

MySQL: What criteria should I base my table column order/arrangement/grouping on?

Does the order, arrangement or grouping of columns with large (such as long text descriptions) and small (such as bit and tinyint) field types have any noticeable impact on MySQL (InnoDB engine) ...
1
vote
1answer
54 views

Is this table designed properly

I am trying to model the process of where one co-worker enters a statement of their proposed work procedure and another co-worker commenting and approving the statement. Currently I have one table as ...
1
vote
2answers
646 views

Foreign key constraint based on conditional column

I'm trying to figure out the best way to handle this situation: I have a table set up as follows: LEARNING CONTEXT ================ LearningContextID - INT - Surrogate Primary Key EntityID ...
0
votes
3answers
80 views

Is it good practice to create new tables for new elements in a database?

I am trying to create a good model for a database that I need for an application. The way that I have tought about realizing it involves creating a new table for each new element that is added, but I ...
0
votes
3answers
60 views

Comparing 1 Database with Many Tables to Multiple Databases with Fewer Tables in Each

What are the pros and cons to creating one huge database with numerous tables or better separating the data into many databases that each have fewer, more relevant tables? Are there server ...
1
vote
1answer
142 views

Product quantity bound to colors and sizes table structures

I've been thinking about how I'll be able to create products with sizes and colors which will match the max quantity of a product (or their total will be the max.quantity ). Let's say I got a product ...
3
votes
1answer
146 views

If all variables are a subset of the candidate key, is the database design 5NF?

I have a table called LogMessages, which has the following columns: Level A numeric value which represents Trace, Debug, Info, Warning, Error or Fatal Time A UTC time Message Foreign key to a ...
0
votes
1answer
1k views

Table Design - User Management

I have designed a database design for a simple User Management System, this system consist of the following things, User - A user may be a Vendor / Employee / Buyer. User - A user may have more than ...
0
votes
2answers
177 views

Database design for holding read/unread content state

In forum application I have member table and post table. What I need is to keep track of what posts have been read by which members. What I thought about is to have a junction table with two columns: ...
1
vote
1answer
470 views

Add a column contains a photo

I installed PostgreSQL 9.1 under Ubuntu 12.10 And now I have a table called property I want to add a field that can be used to store photo(link to the photo or import a photo into a column?) But I ...
0
votes
1answer
73 views

How can I design a database that easily lets me recreate historical snapshots

I'm designing a database for an accounting system. In the system there are companies, and each company has many contracts. Each contract gives a company access to products, data types, or both. ...
2
votes
1answer
51 views

Table Relationship cardinality

I am designing a database for my application, I got issue in implementing the following logic. A user may be a Vendor and also a Buyer. I have created a table for USER and created an another table ...
0
votes
1answer
89 views

Nullable One To Many w/Join Table - Indexing

I have a question regarding database design, I am working with PostgreSQL using Hibernate for ORM, the design I inherited includes the following tables users user_id (pk) user_name user_dob ... ...
2
votes
4answers
278 views

SQL Server: Database integration and synchronization

I have n SQL Server databases with the same data schema. On the other hand i have a web application that needs to retrieve, for some entities, the union of the information stored into the n ...
1
vote
0answers
73 views

How to manage primary key while updating [closed]

In the following table primaryKeyColumn is primary key. To maintain the data history I always uses the values with WHERE condition(WHERE StatusColumn=1) And will set the StatusColumn to 0 if the data ...
3
votes
3answers
318 views

Are 2+ Foreign Keys a Bad Idea in any Association / Junction table?

(First time poster, very very long time lurker. I cannot find an answer to this question anywhere, so I now come out from the shadows to ask the experts). Is a junction table with say 4 foreign keys ...
11
votes
2answers
1k views

Fastest way to change a 600GB table indexed key datatype from INT to BIGINT

I need to change a datatype from INT to BIGINT in a 600GB MySQL table. The column has a unique index. I might be good with unsigned INT, but I assume changing to that or BIGINT will be pretty much ...
1
vote
3answers
3k views

Database design to track student attendance

I was having a doubt regarding the design of a database table to track students' attendance. Currently, my table students have atleast 4000 students. Creating a database for attendance to track their ...
2
votes
1answer
132 views

Improving concurrency in MongoDB via sharding

Our current setup: Cluster of ~500 ec2 c1.xLarge worker nodes with 8 threads on each running scientific simulations Results temporarily stored at runtime on each worker node's local MongoDB, using ...
1
vote
2answers
230 views

Database scheme for product tracking

I'm in the progress of creating a separate login for users who want to track specific product shippings. So I got the tables: Products (Id, Name, Color, Description, ...) Used for storing the ...
1
vote
1answer
227 views

User Table Design

I am designing for an ecommerce application, I need to know how to implement the following task. There are 2 options, Unregistered Users (Free Listing). Registered Users. In this the unregistered ...
0
votes
1answer
508 views

Advantages of middle tables in one-to-many relationships

Entities: Lists Leads What I am trying to achieve is a scenerio where in the relationship between lists and leads the following constraint is applied: A list can have many leads, but a lead can ...
0
votes
1answer
358 views

How can you have a combined primary key for one table?

I have exactly the same question as posted here. But in my case I do not use MySQL but Postgres. Can this be done with Postgres? All things indicate I can not use a combined index in Postgres, so ...
2
votes
0answers
178 views

Problem with Database for survey Questionnaires

Bellow I am showing a sample survey question for woman. I need your help to creating a Database. Description: Top part of the survey Questions are Project Code, Name... etc which is ...
0
votes
1answer
59 views

Database for a startup [closed]

We are in the process of putting together a whole system for a new startup company. This project is meant to store thousands of requests and each one needs to be stored and displayed in real-time. ...
1
vote
1answer
342 views

counter table in mysql

i was going through the book: High performance MySql 2nd edition. In chapter 4 it says: An application that keeps counts in a table can run into concurrency problems when updating the counters. ...
1
vote
1answer
647 views

How do I resolve issue with deleted table in SQL Server Database Diagrams?

I am working on a database design using the SQL Server Database Diagram tool. I created a table with the name dbo.Example and before defining any columns, attempted to save. Got an error that SQL ...
0
votes
2answers
139 views

Additional fields or intersection table

I have a domains table and each domain belongs to a contact. Additionally you can assign 3 extra contacts with different roles admin, tech and billing ,those are not mandatory. My first thought was ...
2
votes
1answer
188 views

PostgreSQL 9.2 tstzrange null/infinity CONSTRAINT CHECK

I'd like to limit a PostgreSQL 9.2 tstzrange to valid dates at both ends. No NULLs nor 'infinity'. Various revisions of this SQL isn't constraining '-/+infinity' input: CREATE TABLE bill ( id ...
2
votes
2answers
649 views

When is it appropriate database design to use a separate schema?

I am developing a database which has data sourced from many different applications. In my first pass at design, I placed the staging tables each in a schema named for their source application. As ...
1
vote
3answers
98 views

Constraint spanning several tables

Imagine the following tables: Products (Id, Name, ...) Used for storing products ProductVersions (Id, Version, ReleasedOn) Used for storing a version history of a single product (v1.0, v2.0, v3.0, ...
1
vote
1answer
179 views

Model Likes / Dislikes in SQL

I'm trying to implement a behaviour similar to Facebook (okay, most similar to YouTube). In my table I got various Products, each Product can be liked or disliked by a Customer. I don't want to let ...
-1
votes
1answer
31 views

prepare stmt is not working

set @sqlt = concat("select", @rowname_date," from syslog_data.syslogs_index_1 "); prepare stmt from @sqlt; execute stmt; deallocate prepare stmt; gives me a eeror 1064 in the prepare statement? Any ...
0
votes
1answer
54 views

Constraint referencing multiple tables [duplicate]

I believe my problem is something similar to this but I am not really sure. I am not even sure my title is on topic. Using mysql. I have the following ACL design for a website: ### tools id name ### ...
0
votes
1answer
115 views

How to store a Preferred Contact? [duplicate]

I'm creating a CRM type application for a client. They need to store information about Companies and information about Contacts within those companies. Each Company can have multiple Contacts ...
1
vote
1answer
256 views

Design DB for users with different information fields?

Let's say I want to register all faculty of a university and they are in different fields and have different resume information. Here we have some common fields and some field specific fields. for ...
-1
votes
1answer
205 views

Should I create a table separately for each employee or one table for all? [duplicate]

I'm trying to figure out how to set up the Database structure. There are ~10000 employees.There will be a table to store the basic details of the employee, and another table for storing transactions ...
2
votes
3answers
383 views

Many to many link tables with history? [closed]

While creating a PostgreSQL database of customer subscribed services with DNS domains, I want to: enable customers to subscribe to multiple services each service can have multiple domain names per ...
2
votes
0answers
142 views

Database design question [closed]

Hello and thank you for reading my post. I work for a company that houses many gigabytes of data in SQL Server. The company is in the process of taking a huge step forward to re-architect and ...
1
vote
2answers
125 views

Two possibilities of primary key

I have a table: all_info, where it holds the users identification. This id can be of two types (just one or another, never both), suppose: int and varchar, but one table can't have two primary keys, ...
0
votes
1answer
136 views

Review my simple database tables

Hey trying to create a simple database table for a small beer review project, it been awhile since i have created db's so could anyone just tell me if i am totally wrong here? Especially my use of ...
2
votes
1answer
154 views

Data Model: Parent, Child, Grandchild with Child Being Optional

I posted the question in another forum and I was suggested to re-post it here which may be more appropriate. Thank you in advance. My organization structure:    Department -- has ...
1
vote
1answer
131 views

Help designing tables for storing lab test results: values include numbers, <number, >number

We're using MySQL 5.5 and attempting to design tables to store the results from tests run in a lab. The results of some of the tests can be either a plain number, e.g. "5", or a range such as "< 5" ...
0
votes
0answers
72 views

Database design: Modifying an open source database without a lot of changes

I am adding more functionality/features to an open source project. The project is about a forum where each post can be given a specific list of tags. The tags are homogeneous. I.e they are of similar ...
-1
votes
1answer
48 views

One or two tables (for two things: cancellations and moves)?

A lesson may be canceled, moved to an other time, and possibly switched to an other teacher. In other words, we have lessonid INT UNSIGNED canceled BIT(1) time TIME teacherid INT UNSIGNED Should ...
2
votes
1answer
125 views

ER relation with unique key

I've a problem about my ER diagram. Assume that I want to draw a diagram with student, member and team. Here is my specs: A student does not have to be a member of any team. A student could be a ...