Tagged Questions

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)

8
votes
7answers
2k views

Professor told us to store Serialized java objects as blobs instead of defining relational tables

The title pretty much says it all, but my professor told us we could map objects to ids like this : id (int) | Serialized Object (blob) 1 10010110110 instead of actually ...
0
votes
0answers
10 views

reports on history table

Assume Trucks which travel between Cityies. I store the Cityies that a Truck has traveled to in TruckLocationHistory table, if the Truck is passing the City, State = Passed and if it gonna stays for ...
0
votes
1answer
33 views

Database Normal Form (financial statement)

I would like some advice on how to design the database for financial statement data which objectively addresses the tradeoffs between usability, performance, maintenance and adherence to normal form. ...
2
votes
2answers
64 views

Associating on the ID of an association table

Sorry about the title, I couldn't find anything better. Suggestions are welcome. Say we have two tables, Suppliers and Products. The same product can come from many different suppliers, so we create ...
1
vote
2answers
26 views

Schema/Structure to handle secondary computed data

I'm trying to design a LAMP-based website for my pinball league, which plays competitive pinball every week in match play. One of the features of our league is that we convert raw scores to ...
1
vote
1answer
16 views

How to design tables for airbnb style booking system

all. My English is not very good, but I will try to describe my question as clear as possible. I want to design a airbnb(https://www.airbnb.com) style booking system, this kind of booking system ...
0
votes
1answer
27 views

schema for mysql database with 30million rows

We am building a SaaS backend for restaurants. We integrate directly with POS, so each POS keeps sending customer orders that we store in a following table in mysql. CREATE TABLE name ( `id` ...
3
votes
1answer
64 views

Normalized Data Store - Confused with prefixes to use

I'm designing a Staging+NDS+DDS Data Warehouse system, where an ETL is going to normalize data from [Staging] and load it into [NDS], which will hold all history. I've pretty much finished the T-SQL ...
-2
votes
0answers
21 views

Setting up a centrally based server repository (database) [on hold]

I need to set up a centrally located database (server). I need to host it somewhere central so that it is accessible from all other locations of our organization. So that the data can be viewed and ...
1
vote
1answer
29 views

Dependency preserving and lossless join decompositions

I have a relation: R = {A, B, C, D, E, F, G, H, I, J} And a set of functional dependencies: G = {AB -> C, A -> DE, B -> F, F -> GH, and D -> IJ} I ended up decomposing into two ...
2
votes
1answer
23 views

Database table to keep track of objects

I have a table called FoodMaker and another table called Settings. Every FoodMaker has multiple Settings. I also need a 3rd table to record what has been made, when and with what Settings. It might ...
0
votes
0answers
24 views

identifying the functional dependencies

I have been reading up on database design and I am having some difficulty constructing functional dependency diagrams from tables. I have the following table. Each salesperson is identified by a ...
0
votes
0answers
16 views

why this FD make 3NF?

Question like this: Consider the relation scheme ABCDEF satisfying the following functional dependencies: BC --> ADEF CD --> B E --> D BC is a key and designated as primary. Explain why the ...
0
votes
1answer
21 views

which type of database to choose for OLAP applications? [closed]

The main classification of databases are below(not sure if there are more). Relational DBMS Object Oriented DBMS Object-Relational DBMS Non Relational DBMS I want to choose a DBMS for my OLAP ...
0
votes
0answers
20 views

Please review and advise on the database schema design for a simple shopping cart [closed]

I'm designing a simple mp3 shopping cart, a customer needs to recharge their account before they can do any purchase. A song or album purchase amount is deducted on the customer's account credit. The ...
0
votes
0answers
43 views

Table design for optimum performance

For example let's say I have to create a table called Employee with columns EmployeeID, Name, DOB, Address, DepartmentID[FK]. So I create the table as follows with a primary key and a nonclustered ...
2
votes
0answers
27 views

With SSD's and in memory tables, does a snowflake schema become preferred over a star?

With SSD's being very fast (reducing the overhead of joins), while more expensive (increasing the cost of redundancy due to de-normalization), along-with a focus on in memory tables (again reducing ...
1
vote
1answer
35 views

When using underscores, should they be reserved to junction tables? [closed]

Say you have the following tables company (contains companies) industry (contains industries) company_type (contains company types, e.g., Public, Private) company_status (contains company statuses, ...
0
votes
0answers
21 views

Advice on table structure change

I am in the process of converting an Access application that stores and reports evaluations to being web-based using php and mysql. I have converted the structure and data over from Access and I have ...
-2
votes
0answers
31 views

What is the best database system for my situation? [closed]

I've got a few coders, who program in C++/C# and PHP/Python but we right now need all the infrastructure (from you of course) and some advise on a Database System that could handle potentially ...
3
votes
3answers
186 views

Can't convert this type of ER diagram into SQL or relational tables

I have stumbled upon a problem during database design. Let me explain what it is all about: Contract has some simple attributes that describe him, and may have annexes and dynamics of payment. ...
0
votes
0answers
24 views

Is it normal to hard code the input of over 80 input fields? [migrated]

This is my first time trying to do database work from scratch, mostly for learning sake. So I'm not sure how to organize my database and tables. Basically, I want to start with a web form and put the ...
0
votes
0answers
24 views

Calculate Quantity On Hand By Location

How can I calculate quantity on hand by location and validate the proposed location quantities against inventory transaction? Currently, I do not track location. I calculate total QoH via the ...
0
votes
0answers
24 views

Looking for a recipe to merge multiple rows to single row

I have a aggregation table that is written by multiple processors (around 20). Each row has a composite key - location-id, campaign-id,... and aggregate stats about it. I need to merge the ...
1
vote
1answer
30 views

Will switching from Concrete Table Inheritance to Single Table Inheritance improve the performance of my queries?

I currently have an application that allows people to view and share 10 different types of posts (ex SportsPost, WorldNewsPost, TechnologyPost, etc). All posts types are conceptually the same, but ...
0
votes
3answers
64 views

Autoincrement Primary Key For Constants

We are having an issue that is probably due to some poor design choice or lack of understanding of how to use primary keys. We have a simple constants table CREATE TABLE IF NOT EXISTS `constants` ( ...
1
vote
2answers
80 views

Need help designing a database

We are designing a system which holds statistical parameters about a particular user. As the users use the system the statistics change and the updated statistics are stored in the database. So for a ...
0
votes
0answers
34 views

Should I create a Factless Fact Table or Denormalise my table

I am creating a data warehouse from a store database and I have a question regarding the design of my dimensions and facts. In the store database a table exists for Person, Person_Address and ...
1
vote
1answer
84 views

How can I design this database?

So I have a ton of transaction logs in pipe-separated format spread across a few dozen files. Concatenated into one file, it's around 2.4 million lines. Each transaction has a store number and a ...
1
vote
2answers
49 views

A simple question regarding database design that has always bothered me

Say I have a table of schools, and each school is either Public, Private, or For-Profit. As well, each school is either '2-4 Year,' '4+ Year', or 'Graduate'. My initial instinct in this situation is ...
1
vote
0answers
19 views

Ideal DBMS Solution for domain problem

I am having a lot of trouble trying to get my head around how to efficiently store and query a very fast-moving data stream, and I expect to be fairly large, in a way that is fast and efficient. I ...
4
votes
2answers
110 views

How to store immutable, unique, ordered, lists?

I have an entity with millions of instances. Each instance has to reference an ordered list of items. The lists have to be unique so no list will be stored more than once. But once created, both lists ...
0
votes
1answer
23 views

Design: Fitting variable hierarchy of text files into a relational db

I have a large data corpus (several TB) made up of data gathered through customer support queries. I've been asked to set up a database to make this data more accessible, but as I'm kind of new to ...
0
votes
0answers
34 views

Using triggers or php code

I have a table called Salons, which has over 15k Salon names. I have another table which takes count of the pageviews of each salon. My question is that if I want to update reputation of the Salons ...
0
votes
0answers
10 views

How to apply updates in a “Fan out on write” architecture?

If I copy certain writes to different tables for faster read performance on certain queries(fan out on write), how should I design updates? Since the data is spread over different tables, I'm trying ...
0
votes
1answer
27 views

Division Email Template DB Design [closed]

First question for me on the DBA SA site! This is for an Java email notification app using MySQL for backend. I have a small number of groups in our organization, [Marketing, Commerce, ...
0
votes
0answers
15 views

calculating Canonical covers

Given F = {AB -> C, A -> BC, B-> A}, compute Fc AB-> C is A extra? {B->C, A-> BC, B->A} 1st possible Fc = {A->BC, B->AC} AB-> C is B extra? {A->C, A->BC, B->A) 2nd possible Fc = {A->BC, ...
0
votes
0answers
26 views

Tables with same schema in DB for different sources. Bad pattern?

The main purpose of the system being developed is to collect data from different sources, process and standardize it, and then add it to the DB. After information from all sources is collected it ...
0
votes
1answer
40 views

How can I quantify the business value of normalization?

My company is developing an internal application with a SQL server database which was started earlier by another developer. Now I am Looking at the model,the developer has stopped at 1NF. I proposed ...
1
vote
1answer
30 views

Date model for commenting system stored in a key-value NoSQL DB?

I'm trying to leverage Cassandra's strong support for time series data to build a commenting system. So far I'm thinking that each row would be a particular topic, and each comment would be a new ...
1
vote
1answer
25 views

Financial Inst - Model Role+Relationships b/w Person and Account

A Person can be on one-or-more Accounts. For each Account a Person is on, Person has a certain role on that account i.e. Person 1 is primary on Account 1 Person 1 is joint on Account 2 Person 1 is ...
0
votes
1answer
39 views

Postgres JSON field for many to many relationships

I'm designing a schema that has a many-to-many relationship as such: A lead can have several stages and each stage can have several leads. I currently have three tables, with one of them as being a ...
0
votes
0answers
67 views

Best way to handle multiple query keys

I am designing a postgresql database for an online card game. I want to provide users with the option to access their play history - users can see log of their games. The data I want to save has the ...
2
votes
2answers
63 views

Check whether empty strings are present in character-type columns

I have an application that (as part of its logic) trims strings and replaces empty strings with NULL prior to insertion in the database. I guess one way to ensure that this is enforced would be to ...
0
votes
1answer
46 views

creating a multi table “identity” column (faux identity)

I am currently designing a job execution engine and have run into a problem I am looking for some advice on. I am converting some processes to a new system and need to define the table structure. ...
0
votes
0answers
24 views

Billion records mysql performance with large result sets

I'm currently developing an application which will have several mysql tables where 3 of them have very large amounts of records. The thing is that my app will have to sync each account on a hourly ...
-3
votes
1answer
95 views

Best design to handle multiple query keys [closed]

I am designing a postgresql database for an online card game. I want to provide users with the option to access their play history - users can see log of their games. The data I want to save has the ...
0
votes
1answer
32 views

modeling data dimensions as columns - some dimensions are highly variable while others have low variability

Please excuse my question if it is a bad one - I am not a DBA... I would like to model the following data: Let's say that I have one column that is the row id as generated by a sequence. Let's also ...
1
vote
1answer
29 views

A many-to-many relationship

I'm designing a simple database and have a question regarding a relationship. So far, I have users, books, highlights and bookmarks. The relationship rules are as follows: Each user may 'subscribe' ...
1
vote
1answer
40 views

Composite Foreign key to single primary key [duplicate]

How do I create a composite foreign key to a table with a single primary key? For example suppose I have the following tables: CREATE TABLE Branches ( BranchId UniqueIdentifier DEFAULT ...