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 (3)

1
vote
1answer
36 views

Computed Columns Or Views - Database Table Design

I want to store values in certain units along with their corresponding conversions. So for example, there would be following columns DateTime Millimetres Centimetres Metres For a ...
1
vote
0answers
27 views

Managing logs generated by user

I am developing a web app for my client and there is a section which displays the changes made in the application by any of the user. This section is known as log.It basically stores and displays the ...
1
vote
0answers
16 views

DBMS for working with sets [closed]

I want to simulate some stochastic system which deals a lot with small sets of integers, e.g. [0,1,5],[2,5,7,9,11]. The number of the sets is so large, and I need to look them up so often that it is ...
1
vote
1answer
24 views

How to Prevent a Many to Many When Number of Rows Shared Is Unknown

I have two tables that look like the following: Subjects id|subject_name|..some other columns 1 |maths | 2 |english | 3 |science | Users id|username|...some other columns 1 |Frank1 | ...
1
vote
1answer
65 views

Storing multi-select data with single-select data

I've got a database with some multi-select fields. To keep it simple, let's just say those fields are MatchGender and Interests. I want users to be able to find people who match (hence Gender is a ...
1
vote
1answer
24 views

How to model state change timeline

I've got an app where users can place orders for recurring delivery of a particular service. The orders table has columns service_id and state, where service_id links to the service the user has ...
3
votes
3answers
71 views

Is it better to create another table to possible null values in relational databases?

I'm designing a relational database to use in MySQL. I have the next situation: In one table there are fields that in the most of situations are NULL. The fields would be like: Table name: tabla ...
0
votes
0answers
40 views

DB schema for an invoice system with tiered prices

I've been hired by a payment gateway company that handles payments for its customers. Every month, a script is run and will charge each merchant for the bulk number of payments completed. The unit ...
1
vote
2answers
72 views

Is this db/table structure sensible?

I'm not very experienced in database design so bear with me. I've taken over a ruby/rails app. with a connected MySQL/innodb database. As I'm updating the server to the latest ruby/rails version I ...
0
votes
1answer
28 views

Entries with 2 variables. Do I need to make 2 more tables by entries?

In the case of shipment carriers, I have a table with products which price and delay will vary with 2 variables. PRODUCT | SHIPPING DATE | PRICE Carrier 1 | A | B Carrier 2 | ...
-5
votes
1answer
106 views

How to select only few columns from a table in database? [closed]

I have a table which consists of around 200 columns where name of each one is col_i (i=1 ,2,..200).Suppose I have to select only first 50 columns, how should I proceed? I found about concat() function ...
1
vote
1answer
36 views

Duplicate records referenced across different databases

I have a table holding 'People' data (about 70K records) that coexists with an 'Address' table so there's one AddressID per every person in the 'People' table. The idea was to centralize the data in ...
0
votes
2answers
101 views

Large database design

I am new to database design and despite my research I can really only find basic examples on design which does not help for my situation. Currently using MySQL The problem I have is as follows: I ...
0
votes
0answers
51 views

Referral table structure

I need to make a simple referral system and I have a database table set out as follows: mem_id | date | refer_email | accepted And the meaning of such columns is the following: mem_id: The ...
2
votes
1answer
74 views

Have foreign key constraint and index key for the same column(s)

I am creating a composite index key for 2 columns and then adding foreign keys to its appropriate table. Do I need to create a multiple index key reference and then create separate foreign keys? My ...
-1
votes
0answers
34 views

Database replica

I have a question about databases that I would appreciate if you can help me. Assume that a database server is up 10% of time. In order to achieve higher availability of this database in a distributed ...
-1
votes
0answers
11 views

How to set missing colunms as a null in datastage 9.x.x

I have a sequential file with difference length fields, I want to set missing fields value as a null when I import using datastage, (Not mean set empty fields as a null)
1
vote
1answer
37 views

Multi-tenant database constraints

I have a multi-tenant app in PostgreSQL that has a repeated tenant_id column in each table to help isolate the tenants from each other. My question is, is there any sort of way that I can use ...
1
vote
1answer
74 views

How to structure this data? (Many columns currently.)

Working in MariaDB, we're trying to figure out how to store this data. All of our other tables have been normalized and are working nicely, but this has me stumped. We have a number of objects and ...
0
votes
0answers
11 views

Determining the 3NF based on functional dependencies

Given a relation R = {E M L T} and functional dependancies LT -> E, ET -> L, TM -> E, and E -> M , I know that the superkeys of this relation is TL, TE, and TM. For 3NF, the left hand dependancies ...
1
vote
0answers
17 views

Null Dimensions in SSAS [closed]

Several years ago 2008, I create a data warehouse using Business Objects. Business Objects did not process Outer Joins well and used SQL for all of its queries. Therefore, for every dimension I ...
0
votes
1answer
65 views

How to store iterations of similar datasets

I have a dataset that is stored across 20 or so tables, most of which have a few million rows. This data will be generated fresh each month, and compared to past datasets. I'm pretty new to ...
0
votes
1answer
37 views

String to timestamp in datastage 9.1.2

Apologies for asking a question that I suppose is very basic. I'm just starting out with Streams. I'm trying to read a sequential files containing a timestamp field and a value field, like this: ...
0
votes
1answer
46 views

Database design: handling time

I am developing a weekly timetable which ideally would allow teachers pick what subjects they teach. While most of this is fairly straightforward, from a conceptual point of view I am unsure how to ...
1
vote
0answers
79 views

best way to log large amounts of data

I'm building a new logging system for our company. I'm wondering about the best way to store about 50-100GB data each year. I'm looking at both MySQL and MongoDB. I'm considering MongoDB because it ...
0
votes
0answers
18 views

What factors would cause me to favor inheritence over composition in a small database?

I have identified two choices for how to model addresses in my corporate entity database. Method 1: inheritance Table 1: Addresses [data table, primary key = (id)] id (integer) - primary key ...
0
votes
0answers
28 views

Loop through fields on a before-insert trigger?

Here's my table: CREATE TABLE foo ( i_am_pk CHARACTER VARYING(255) PRIMARY KEY NOT NULL, dont_touch_this CHARACTER VARYING(255) NOT NULL, name CHARACTER VARYING(255) NOT NULL, addr CHARACTER ...
1
vote
2answers
71 views

Three questions about Database design

I'm new to mysql,and I'm designing a database for my social network app, I got some questions about it. user_table comment_table 1.Should I use unique key as much as I could in the database ...
2
votes
2answers
108 views

Is it acceptable to have circular foreign key references\How to avoid them?

Is it acceptable to have a circular reference between two tables on the foreign key field? If not, how can these situations be avoided? If so, how can data be inserted? Below is an example of ...
3
votes
1answer
44 views

Should I create a extra relation-table when I have two columns in one table referencing to one column in another table

My problem is best explained by example: Suppose I have a database about chess games and players. Which one of the following structures should I choose Option 1) player (player_id,name... etc) ...
0
votes
0answers
29 views

DB Design for Mobile App Clients

Hello I am new to designing DB for Mobile App where speed is the Key. My Mobile App will request to WebAPI and WebAPI will get data from MySQL. I have designed my tables in MySQL as per relational ...
1
vote
2answers
41 views

Should a table have a foreign key to another table if it already has a foreign key to another table that has that foreign key?

That was a hard title to digest even for me so I'll break it down. I'm very new to SQL, and I just designed my first database. I also am not very good at JOINS which might be the answer to my ...
0
votes
1answer
47 views

Creating many-to-many relation on demand?

Users can join projects. Projects can have many tasks. Each user completes the task at their own time, they can also have some other user specific settings on the task like the priority in their ...
1
vote
1answer
32 views

Is this a good way to model course assignments?

I'm having trouble designing a data model that allows for the following: Courses can have many assignments. Assignments can be defined recursively. e.g. "There is reading homework every tuesday". ...
0
votes
1answer
44 views

Entity ID field that can refer to multiple tables?

In designing both audit tables and notification tables, I've run into an issue where I need a row to refer to an entity in another table, but which table that entity is isn't always the same. For ...
0
votes
1answer
43 views

Creating a flexible table containing prices and periodes

I'm creating a system of availability for rooms and with a calendar according to the days, with every day have it's own price. Room Type | 01 | 02 | 03 | 04 | 05 | ... | 31 | ...
0
votes
0answers
23 views

table design approach for a rental application with several one to many relationships

I'm trying to go about designing a database/tables for the following situation I'm being presented. I'm developing a rental web application with MySQL as db engine. It is for a nonprofit organizations ...
0
votes
3answers
75 views

designing a database with type and sub type

I am trying to build a publications database, and i want to develop a genre relation that has various (maybe look up tables) sub-genres attached. as an example, in the genre relation there would be a ...
0
votes
1answer
53 views

How to store a version sequence per product

I need to create a table like the following one: +----+---------+---------+ | Id | Product | Version | +----+---------+---------+ | 1 | 1 | 1 | | 2 | 1 | 2 | | 3 | 2 ...
0
votes
0answers
12 views

When to use tags vs binary fields in a constituent management system?

I have a table of Constituents and I want to track yes or no qualities like: are they a teacher? are they an elected official? are they philanthropists? There will be less than a dozen of these ...
0
votes
1answer
40 views

PizzaShop - DB - Normalized Schema

I am trying to make a simple DB in Access for a theoretical pizza shop(the db is for an assignment). What I am trying to do is link one type of pizza to one or more types of toppings. I just wanted a ...
0
votes
0answers
70 views

Ideas for Database schema for Automotive web app

For the last couple of days I have been searching all over Google for database schema for my automotive web application [like a marketplace of sort] (in Laravel 5 PHP). I have tried many models some ...
0
votes
0answers
76 views

MySql Innodb Database Slow INSERT Query to Remote Server

I have searched thoroughly on how to improve general performance of my database which is hosted on Hostgator. I have mostly come across performance tuning strategies which are catered to only local or ...
-1
votes
2answers
95 views

Double entry bookkeeping database design

I'm doing an accounting software and I need to enforce double entry bookkeeping system and I have the classical problem of 1 row per transaction versus 2 rows. Lets take an example and see how it ...
0
votes
0answers
38 views

Post categories model for a user submission wedbsite

I'm building an user submission site where users can make posts to content_types: Blog, Movies, Photos, Forums. Since these content types only have slight variances I would like to keep them in one ...
0
votes
1answer
24 views

Working on a blog creation website; should I be creating a new table for each blog, or keep everything on the same table?

So I'm working on this blog creation website as a side project. I don't actually expect it to become anything, but I want to make it as efficient as possible, even if just for practice. The idea is ...
3
votes
2answers
98 views

Split database to fit on SSDs

I have a database that's about 3TB in size and want to upgrade to SSDs. The SSDs I found that are reasonably priced are only 512GB so I'll need to purchase multiple drives. What are some ways to ...
1
vote
3answers
139 views

how to store mp3 files in mysql database by using phpmyadmin?

first of all i am new to database, but i want a database for my site to store mp3 files in it so later i play them on my site by using jplayer. little though i know about database they said there are ...
1
vote
0answers
21 views

Calculate Num_Index_Pages for sizing design

I don't understand Step2 #8 Calculate the number of number of non-leaf pages in the index. I am not sure I understand the "Level". I have Num_Leaf_Pages=508 & Index_Rows_Per_Page=476 I don't ...
3
votes
2answers
62 views

Why is vertical scaling expensive?

As you can find here Best Practices For Horizontal Application Scaling, vertical scaling is much more expensive than horizontal scaling: vertical scaling cost increase exponentially whereas with ...