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
vote
1answer
47 views

Recursive CTE to find unique slug

I have an article table where I want the slug to be unique. CREATE TABLE article ( title char(50) NOT NULL, slug char(50) NOT NULL ); When the user enters a title e.g. News on Apple, I want ...
0
votes
0answers
6 views

What Is the Next Best Ingredient to Add?

I am building a program that allows users to optimize their grocery shopping so they can make the most recipes using the fewest ingredients. One of the features of this program is a function I’m ...
2
votes
1answer
205 views

Database design for a table with both bulk insert and single row insert

I have to design a table where records will be inserted in two ways. Bulk insert from a batch process from a delimited text file between 2 - 3 million rows in a short burst. Later the same records ...
0
votes
2answers
19 views

when to put a business rule in the business application layer or into a database constraint

I need you wisdom, I am debating with another person when is it recommended to put the code of a business rule into a database constraints or inside of the application business layer? There is a ...
2
votes
1answer
424 views

How to normalize my db schema for a quiz application?

I am putting together a quiz application. (I'm calling each quiz a "challenge") I have a "challenge" table and a "challenge_question" table which is pretty straightforward. challenge table: id ...
2
votes
0answers
15 views

How to store a 64-digit key of alpha numerical values into MySQL Database

I am student studying in Database Administration (first year), one of our task requires a to design a login form for corporate and regular users. Below are the requirements for the username and ...
1
vote
0answers
22 views

Need Help in building database

I am developing an app that send messages (email and sms) to users. The db must also maintains the list of messages send to users. And also the status of messages send to user like send or failed. I ...
1
vote
1answer
20 views

DB Design storing products sold in bulk, priced by vastly different units

I am trying to design a database that stores products that are sold in varying different units. Some are priced by product, some by volume, some by length, some by surface area. Possibly some by ...
0
votes
1answer
16 views

can I use many-to-many relation with weak entity

I have an entity, for example employee(key employee ID), and every employee can have multiple responsibilities. Every responsibility can be tasked to multiple employees. I have 3 options: 1) Create ...
0
votes
1answer
15 views

database design for storing individual users' items

I am trying to make an application which users can have their own account For the account, I have an single table and now I would like to add a function which allows users to items in to their account ...
1
vote
1answer
161 views

Enforce a constraint problem

This business model is for a case management database. This is closely modeled on the idea of a file folder representing the phase and a sequential checklist representing the stages. A case consists ...
3
votes
1answer
325 views

Removing “duplicates” within a time range

I have a table that contains number plate data with a date and time stamp, collected by a plate-reading CCTV camera at a site entrance. Vehicles stopping at the site entrance will create multiple ...
0
votes
3answers
434 views

Rent weekly cost database design

I have a database which contains a table BUILDING with in each row details about some building, another table BUILDING_UNIT contains rows with details about a single building unit which refers with a ...
1
vote
2answers
30 views

Optimal indexing for SELECT (mysql)

What indexes would you recommend for the following select (and why)? Keep in mind there can be tens of millions of rows. SELECT * FROM mytable WHERE md5 = ? AND created_at >= ? AND created_at ...
-1
votes
0answers
29 views

Database design for different wildlife types

I am planning to design a database for wildlife details (such as fishes, birds, and animals) in a certain state, e.g. what kind of wildlife is present. I have created a table in SQL Server 2014 in ...
0
votes
1answer
89 views

Text Storage and Database Design Optimization in a SQL Server Database

Given a database with a number of columns (c), where some of these columns contain text that is one of multiple values due to a set CONSTRAINT on the columns, what is the most efficient way to ...
4
votes
1answer
537 views

Database table design question

Firstly, database novice here. I'm trying to create a system for processing Sales Orders into Purchase Orders and then split the Purchase Order into Shipping Containers. The systems needs to be able ...
2
votes
1answer
679 views

Designing a reservation system schema

I am not sure if this has been asked before, however I am tasked with designing a new reservation system for my organization We have an older system which simply stored the booking in a table, and it ...
1
vote
0answers
44 views

How do I maintain categories and products of an optical store?

I have a requirement for an optical store. He has various categories like AgeGroup(Kids/GrownUps), GenderGroup(Male/Female/Unisex), FrameType(Metal/Plastic), FrameShape(Full ...
0
votes
0answers
15 views

Starting out with several databases? [on hold]

I'm choosing which database systems to use for a project that is in its early stages. There are different aspects of the project that fit slightly different models that are best matched by different ...
0
votes
0answers
9 views

Building an economic time series database with aggregation/dis-aggregation capabilities

I am trying to build a database in MySQL and MS Access that contains economic indicators and financial time series. Initially, I wanted to solve the problem by setting up a table for each major ...
1
vote
1answer
120 views

Handling a chat room in a database

I have been searching all day to find a better answer to my question but those I found was useful but do not critically analyse my question. I am building a chat room using php, mysql, jquery and ...
0
votes
0answers
18 views

Database design for price comparison site - too complex?

I'm working on a regular price comparison site with two exceptions. I want to show price history and also allow users to subscribe to a product with a specific size and color. As a result, I've ended ...
1
vote
1answer
36 views

Database structure (MySQL)

I have a database called data that is going to contain some data about writers, books and images. I've created these tables so far, but I don't know how to struct the images table. A writer or book ...
-3
votes
0answers
27 views

What is the best database design for blogging service [closed]

I am writting a blogging service that people can make sites in it. But I want to have an echaustive database design to have all sites information in one place. It means for an example I want to have a ...
0
votes
1answer
85 views

Complicated data

I have a requirement i got from my father. He gave me a table and wanted me to digitalis it. So that he can the system can do all the dirty jobs for him ( that's why there are developers in the world, ...
-1
votes
1answer
25 views

Best approach for storing huge data [on hold]

I'll be handling 300,000+ users. Each user (after logging in) will be able to create lets say "folders", in each folder, users will create "name=value,name2=value2,name3=value3" entry pairs. Each name ...
0
votes
1answer
88 views

What is the strategy of query evaluation in DBMS when Limit is used in query?

I have following tables in database post(post_id , user_id , post_text , parsed_text) ; Comment(comment_id , post_id , user_id , comment_text) ; friend(id , user_id , friend_id ) ; group (id , ...
0
votes
1answer
20 views

what should be the good normalization for the following scenario?

ITS JUST FAKE TABLE DATA TO SIMPLIFY MY PROBLEM I have tables ,, Users , shirts, pants, belts .... each will have some data... so by some research i have made some scenarios of links between the ...
0
votes
1answer
25 views

Database structure for a cloud based ERP?

I am designing a configurable ERP hosted on the cloud. Each one of my users(customers) may not have the same table structure. For example: Organization 1 : They store Name, Address, Phone for their ...
0
votes
0answers
16 views

Accounting - Dimention table in mysql

I am designing a accounting and mini erp system. I use a date dimension table to track all date related data. In oracle we can have many schema for a database. so we could create each schema for ...
0
votes
1answer
111 views

Building a branched versioning model for relational databases

I am database designer and at my current project I'm implementing versioning capabilities required to concurrently edit rows of data in RDBMS. The project requirements says, that data editing sessions ...
0
votes
1answer
76 views

When to use hashtable over binary search tree vice verse for Database Index

Database Index can be constructed using binary search trees (BST) or HashTables , From my understanding so far , HashTables are superior to BST in terms of time taken for searching and insertions ...
2
votes
1answer
34 views

Database design tracking daily personal expense

I currently have the following in Excel tracking daily expenses: I would like to turn the following excel sheet into a normalized database. I would also like to capture the descriptions for each ...
1
vote
1answer
51 views

Normalized database table with non-atomic values

I'm creating a normalized table for a questionnaire that the customers fill in and in one of the columns is a field called "extra comments". I realize that with the "extra comments" field, the data ...
46
votes
7answers
9k views

Why shouldn't we allow NULLs?

I remember reading this one article about database design and I also remember it said you should have field properties of NOT NULL. I don't remember why this was the case though. All I can seem to ...
7
votes
1answer
1k 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 ...
0
votes
1answer
31 views

Database structure for users, events and event lists

I am creating a web service for managing events. The service will have users, who are listed in one database, called Users. It will also have events, which are listed in another database, called ...
3
votes
2answers
119 views

Denormalized tables within OLTP database

My company has a product centered around a fairly normalized mssql server database. At this point we have several reports and a web application that needs the data in a much flatter fashion to ...
0
votes
2answers
163 views

Database Design Help: MySql/PostgreSQL Single Database/Multiple Databases

We are planning to build a web based custom business analytics tool using PHP and MySQL/PostgreSQL. In our application, we are planning to upload customer’s data using a Excel sheet and these data ...
0
votes
1answer
24 views

What would be most elegant way to replicate data contents periodically into a MySQL table?

I need to parse contents from an API route and insert into a MySQL database. The aim of parsing contents is to replicate the data from the API to my database table. I need to check API response every ...
0
votes
1answer
117 views

Need Advice on Normalizing Database

I have a group of database tables that lack normalization. They all have a similar primary key called 'doc_index', which is either a PK by itself or part a composite PK. As you can see below, there ...
0
votes
0answers
32 views

draw an ER model using Chen’s notation

hey Guys I need your help with these equations 1- In a faculty office of a department, each faculty has separate printer assigned to her which is connected to her computer. A printer cannot be ...
2
votes
1answer
81 views

Table design for child tables with multiple many-to-many relationships

We are working on designing tables for a new Networking application, and have been having some problems with finding the best design for the top level tables. Network is the top level table. Under ...
0
votes
0answers
25 views

How to do this physical design question? [closed]

Question as follow: Given a disk containing 2^42 bytes. Disk is organized into blocks each containing 2^12 bytes(default for NTFS). Store a file who's records are length 200 bytes each on the disk. ...
0
votes
1answer
127 views

Relation between multiple hierarchical taxonomies linked to a single entity

I am working on an online test application which supports multiple choice questions. I have created schema for taxonomy (classification) system to be used with questions. taxonomy(id, name, slug, ...
0
votes
1answer
16 views

Should I use one-to-many or many-to-many to log previous records?

I have 2 tables, company and interns. the initial relationships are, An intern belongs to only one company. A company has many interns I have a slight problem with these relationships. If the ...
0
votes
1answer
12 views

Suitable way to record users requests for usage invoicing/billing in database?

Is there more efficient way to keep a track of all requests made by each user with timestamp? And then filter the requests every fortnight to invoice the users? Example DB schema Table: user; ...
1
vote
1answer
37 views

database design for optional association and temporal

I'm designing a simple database and I'm stuck with one part. I have a Task, Sweep and Spray entities. +-------+ | Task | | | ...
0
votes
1answer
225 views

Multiple product attribute inventory database design

i have a database to build based on inventory for my shop. this is the current data that i have put into tables this is the package: this is the product attribute this is the table to produce ...