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)

0
votes
0answers
37 views

Conceptual data model for a billing system

I am working on existing MySQL database, my task is to create a new data model for a billing system on that existing application, I have created a conceptual data model, as given below, My ...
0
votes
1answer
20 views

Database structure for product attributes on orders

I'm making a POS and currently kind of stuck on the order proccess due to the product attributes. As of now the DB looks something like this: tbl_products tbl_attributes (attr id, name, extra ...
-1
votes
0answers
5 views

mysql workbensh/ synchronize model

i try to synchronize model my script sql show that SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET ...
22
votes
3answers
2k views

At what point does one database per client become unfeasible?

For one of our systems, we have sensitive client data and store each client's data in a separate database. We have about 10-15 clients for that system. However, we're developing a new system that ...
2
votes
1answer
28 views

How can I model and enforce constraints on a categorical item contained in a collection?

Scenario: There is a collection of items where each item belongs to 1 category. There is a collection of buckets which may contain at most 1 item from each category. Oh, and an item may belong to at ...
0
votes
1answer
28 views

Single MySQL DB contains both push and pull data. Recommended path to replication?

We have a single deployed (MySQL) database that contains both user tables and product tables (currently in the same DB). The product tables are "pushed to production" data -- they are generated in ...
1
vote
1answer
38 views

Databses design, parallel many-to-many relationships. Two tables, or extra fields?

Say I have want to create a database for expenses. I will have a table for holding Person details, and a table for holding Expense details. Then there will be two many-to-many relationships ...
0
votes
2answers
64 views

Help understanding database design logic for a secondhand bookstore project in MySQL

I am currently working on a small eCommerce based project that allows users to buy/sell second hand books to/from other users. I am having a hard time making design decisions on how to model the ...
1
vote
1answer
49 views

Will a specific denormalization increase performance in a specific scenario?

Suppose I have a table with fields | a | b | c | d | ... | z | which contains millions of records and which will serve millions of queries a day. And the field z holds the id of some parameter which ...
0
votes
1answer
58 views

Which database (Graph, Riak, etc.) would most aptly solve the following problem?

I am working on a project and was wondering if a Graph database would best solve the following problem: (This is a simplified question) Say that you have a list of friends and you want to see when ...
1
vote
1answer
41 views

Spliting Datetime into 2 Columns for Restaurant Reservation Schema?

Using PostgreSQL. The primary driver of this is that while no reservation will exist without a date and time, a user can search for and monitor reservations using a time or date or both. With a ...
0
votes
1answer
42 views

How can I Automate MongoDB schema design from existing MySQL Database and Logs?

I am working on the project which will automatically generate sample MongoDB schema analyzing existing MySQL database and logs. I am looking for help regarding the below questions. Please, share your ...
1
vote
1answer
56 views

Fixing table structure to avoid `Error: duplicate key value violates unique constraint`

I have a table which is created this way: -- -- Table: #__content -- CREATE TABLE "jos_content" ( "id" serial NOT NULL, "asset_id" bigint DEFAULT 0 NOT NULL, ... "xreference" varchar(50) ...
2
votes
2answers
220 views

Choosing a database for big data

Let's say I want to write a web service that stores home automation device readings such as thermostats, humidifiers, etc. The data would take the form of: user_id | device_id | tag | value | ...
1
vote
1answer
41 views

Is there any way MySQL can list relationship cardinality between two entities?

I am working on the project where I have to analyse the MySQL schema. As a part of schema information, I want to list down relationship cardinality between different relations. Does MySQL stores ...
0
votes
1answer
103 views

Best Approach to storing chat history?

I'm building a chat application (Yes, another one :P) and am really curious about the best way to store a chat's history(String username, String Message, Time, and possibly string channel depending on ...
1
vote
0answers
20 views

A better model for connecting users to different objects, even efter they cease to exist

I've got the privilege to create a small in-house application for managing todo-lists, although I am not really a developer. (I know some PHP and SQL, and got a chance to prove myself). As my ...
1
vote
1answer
51 views

Need some recommendations on organizing data

I'm new here. This question, to my mind, is allowed by the rules I saw in the "2 minute tour". If I got it wrong, no need for nasty grams. I'll delete if enough people say so. But anyway, I have a ...
0
votes
2answers
26 views

MYSQL Indexes when looking up on alternating sets of columns

I have a table that looks like: CREATE TABLE `connections` ( `connection_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `service_id` smallint(5) unsigned DEFAULT NULL, `parent_id` bigint(20) ...
0
votes
1answer
43 views

SQL tables relations

i'm making a MySQL data base , my tables are: users, activitylog, activitytype. to avoid repetitions i thought about including activitytype in each activity which is logged into activitylog table, ...
0
votes
1answer
33 views

Move into another table or not?

In my web application there exists a web form with certain questions on it. Some of these questions will be pulled / retrieved from the database. Here is some sample data: My question is, is there ...
0
votes
1answer
43 views

MySQL DB structure with Main category and several nested sub categories

I am looking to create a set of fields on my webpage identical to what eBay uses on their category selection page when you are selling something. For my purposes I am doing motorcycles, power sports, ...
0
votes
1answer
63 views

Beginner table design

I have been coding in C# for a couple of years where I usually try to follow the 'single responsibility principle' which states that each class should ideally be responsible for only 1 goal. Now I ...
1
vote
1answer
53 views

Best approach on storing/displaying sanitized data

Surfing the web I find two approaches on storing data in databases. Approach 1: Store data in the database with the html-specialcharacters sanitized $userdata = $_POST['field']; ...
2
votes
0answers
49 views

How to model (a many to many) to many relationship

Hello i am facing the following scenario. I have a student table with the following structure. Student id(PK), matriculation number, first_name, last_name, email A student can have more than one ...
1
vote
1answer
47 views

Database Design

I'm taking a Database course and I'm a bit confused with the different types of graphical representations terminology of a database design. Are Data Model, Crows Foot Notation, Crows Foot Model, ERD ...
0
votes
1answer
52 views

How to design database for DNS?

What tables will be there.Also as read percentage will be significantly larger than write, is indexing on columns advised? What other precautions are necessary? For now, I can just think of 1 table ...
0
votes
3answers
46 views

Item availability in row or another table

I'm a database newbie, so please bear with me. Say I'm creating a library database. I have a table containing information about books. Do you put the book availability as a row in this table or would ...
0
votes
1answer
57 views

Help With MySQL Computed Columns/Auto Updating Field Based On Average

I am currently building a social network type application on-top of MySQL and have run into a problem I can't wrap my head around. In my web application each user has a field called "weight" and this ...
0
votes
2answers
67 views

Is a temporary table a good solution for importing temporary data into a database

i am facing the following scenario. I have a student database in which exam results are stored. Every now and then i get a list with the names of certain students for which i need to find out how well ...
0
votes
0answers
30 views

Unique database presentation ideas

I have completed the first phase of a fairly large database schema design. I built the ER-diagram in DIA. I have to present the schema to an audience of fellow software engineers. Any thoughts on ...
3
votes
1answer
60 views

Help with “Flexible” vs Fixed Tables

We are designing a database in SQL Server to handle sales commissions. A diagram of the current schema looks like this: There are only a couple of us on the project, and our boss dropped this ...
-1
votes
2answers
53 views

What are the possible risks involved in partitioning large database tables? [closed]

There has been much talk about the benefits of table partitioning in Relational DBMS. I would like to know: Are there any risks to table partitioning ? What measures are there to take to minimize ...
0
votes
1answer
91 views

Choosing between single table and multiple table database scheme

I'm building an application which saves addresses in a PostgreSLQ 9.3/PostGIS 2.1.1 database. Currently I am trying to find an efficient database schema, so far I've come up with two that would ...
1
vote
2answers
87 views

To normalize or not to normalize for few distinct values

Assuming in a Postgres database, you have a table called party, which can have less than 5 well-defined party_types such as 'Person' or 'Organization'. Would you store the party_type in the party ...
0
votes
2answers
40 views

General table name for Person Inf

I was in a meeting with my boss and technical support leader and they asked me for a database model to a very simple application. That application requires: employees information, some location data, ...
4
votes
3answers
144 views

Is matriculation number a good primary key?

I am trying to design a grade assignment database and i am facing the following dilemma. I have a student table which has the following characteristics: matriculation number which i know for a fact ...
3
votes
1answer
48 views

Non-overlapping rectangles constrained to a boundary

I am trying to model placement of parts on a circuit board. Without any meaningful constraints, my basic schema looks like this: create table part ( part_id bigserial primary key, name text ...
1
vote
3answers
292 views

Database throughful design vs Quick and dirty design comparison

Take the representation of an Address, here below is a complete and very detailed implementation: here instead is a quick implementation (which more or less contains the same fields, imagine all ...
0
votes
0answers
23 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 ...
3
votes
1answer
113 views

Most efficient queries on flags in TSQL: bit field or table join?

Looking for the most efficient database structure for selecting rows from a large table based on one or more true/false values. For example, whether or not a user has opted in to marketing ...
2
votes
2answers
92 views

Most performant way to fetch last record

I have a Postgres table Prices with the columns price (Decimal) product_id (Int) Prices get updated regularly and I keep old prices in the table. For a given product, the last price in the table ...
2
votes
1answer
87 views

Enforcing constraints “two tables away”

I ran into some trouble modeling an electrical schematic in SQL. The structure I'd like to capture is part ←────────── pin ↑ ↑ part_inst ←───── pin_inst where "inst" is short ...
0
votes
1answer
40 views

How to structure a database to show data for each USA State and Canada Territory on a Per user basis?

I need to build a PHP/MySQL application. I am a bit confused on how to do the database for a project like I am about to explain though. The end result will be a Map of the USA and Canada. Each ...
0
votes
1answer
44 views

Digital content eCommerce schema advice? [closed]

I don't have much experience designing databases, I'm looking for some advice on my design from more seasoned designers/developers. I'm developing a digital content eCommerce store which will be ...
1
vote
1answer
60 views

Does this medical database look correct?

I'm pretty new to databases and I'm trying to create some schemas. I've been working away at this one for a while, but I can't help feeling that it doesn't look right. Essentially I have the ...
0
votes
1answer
79 views

What is a bucket in database? [closed]

I was implementing a code that involves a database and buckets. Just wanted to ask what is bucket and can someone describe it with an example? Thanks!
0
votes
0answers
19 views

Impact of additional int field as primary key

Directly to the point, at one time I have a table like this: create table item( item_id varchar(50), constraint pk_item1 primary key (item_id) } However from my discussion one day, there is ...
2
votes
1answer
37 views

Denormalize Design Modification

Our DBA is on medical leave, I am just a developer trying to do my part. Initially, the bean counters were going to use quickbooks. However, after seeing how much time they could save with custom ...
2
votes
1answer
64 views

Best way to store an unordered list? [closed]

I apologize if this question has (undoubtedly) been asked before, however I've been hearing conflicting advice from colleagues and the internet. I have a table of "groups" and each group has a list ...