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

Manage orders based off product attributes and quantity

I'm developing a database for an online store in which the Products have multiple attributes and attribute types. ATRIBUTES TYPES atrtype_id name (like size, color...) ATRIBUTES atribute_id ...
3
votes
2answers
114 views

Is there a way I can speed up queries against this particular view?

I have three tables in a PostgreSQL database that I'm querying via a view and some joins. CREATE TABLE network_info ( network CIDR NOT NULL, some_info TEXT NULL, ...
0
votes
0answers
41 views

linking a single table (comment) to multiple tables (article,link,attachment)?

the main idea is that i can post an article , link or an attachment and i can receive comments on each of these types of posts (the structure of the comment is the same) , the problem here is that i ...
0
votes
0answers
83 views

Multiple user roles with different attributes

I need to design a database that has multiple users, with multiple roles. For instance, a user can be an admin, company, employee, or customer. Each user can have any number of these roles. Right now ...
0
votes
2answers
69 views

Normalising shared entities and applying constraints

I'm looking for a specific "best practice" or "pattern" concerning entities that are shared between different entities, having a relation to one of many. For example, one may have the generic entity ...
0
votes
0answers
43 views

How to store likes to posts in Parse.com database?

In my parse database I have a classed called Post and Like. Should I create a field likes in Post class with Relation<Like> type or there is another better option of storing likes in Parse DB?
2
votes
1answer
59 views

Compare the structure of two MySQL Databases

I have two MySQL databases that are very similar to each other. How can I find out the differences in tables, and the differences in columns in each table? the databases are in different schema. ...
0
votes
1answer
68 views

What is the best design for storing courses subscription data?

Building an app that will manage lessons, students, courses. Each lesson belongs to a certain course. A student can subscribe to a single lesson or to a whole course. So it seems straightforward that ...
0
votes
0answers
34 views

How to cast as type of a table column?

I have multiple views with union like this: select column1, column2 from mytable union select cast(extcol as nvarchar2(15)), cast(extcol2 as nvarchar2(10)) from exttable But later I change the size ...
0
votes
0answers
44 views

Database design for varying prices from multiple vendors

I am designing a database where the products are sold in bulk with multiple pricing options, from 4 different vendors. What is the best table configuration to store this information? Id like to be ...
0
votes
0answers
24 views

Trying to Figure out an ER Diagram for a set of instructions

Below is information about a database and I want to come up with the ER Model. (Im not sure if this is the right place to post this. Im new to this page) professors have an SSN, and a name projects ...
0
votes
0answers
68 views

MySQL Dynamic columns duplicate value workaround

As the title suggests i have the following code which transposes certain row values into field names, however the problem im having is that the values "closed" & "reopened" may appear in several ...
1
vote
2answers
58 views

Database design for attendance feature

My app has a requirement wherin we need to capture attendance details of a class. A class typically has 50-60 students and there will be records with attendance/absense status of each student for a ...
0
votes
1answer
29 views

What should be the structure for a person-to-person store database

I am going to create a person-to-person store with Laravel, a website whose users can share and sell their product or their mobile, TV, Computer, Shoes, Shirts, Books ,Cars, Bags, Animal etc. I am ...
0
votes
0answers
31 views

Performance/Maintenance Implications of a Write Heavy Table In An Otherwise Normal “CRUD” Database

We have a small-ish (<100,000 rows) MySQL database (on Amazon RDS). Its supporting a fairly simple read heavy CRUD web application. Currently we're building out a web analytics system. It will ...
2
votes
0answers
83 views

Covering Index - Insert Performance

We are running some performance tuning on our database in SQL Server. The database in itself is pretty small with around 13 tables. But there are multi-level relationships between tables. When I try ...
0
votes
1answer
27 views

Using part of a compound key as foreign key

We have the following situation, in which we have three tables: Article ------- - Id (PK) - Supplier_Id - Supplier_Contactperson_Id - Name Supplier --------- - Id (PK) - Name SupplierContactperson ...
0
votes
0answers
24 views

Database systems with users and sub users accessing the data

I am making a database for school student maintenance. Below is the basic description. There are schools. One school has many staff (i.e: Principles,Teachers, Section Head, Office Staff etc) These ...
0
votes
1answer
33 views

Daisy chaining two is-a relationships?

I'm currently dabbling in ER modeling and wondering if it is possible to create a chain of is-a relationships. Example: Here I'm basically trying to model specific in-stock items available for rent ...
1
vote
1answer
416 views

Transpose MySQL rows as column names - DYNAMIC

My goal is to be able to calculate the time difference between the ticket timestamp being created and closed and if reopened Add time from being reopened to closed again etc.. I have an existing mySQL ...
1
vote
1answer
51 views

mongo: how should I layout my data

I have 2TB of data currently spread across many CSV files that looks like: { 'rec_date': "2010-01-29", 'rec_time': "09:15:00", 'site_no': '46', 'data_owner': '1', 'flow_period': '5', ...
0
votes
1answer
57 views

How to reference categories table in products table?

I am using modified preorder traversal algorithm to store product categories in database (like image shown above). But i don't understand how to reference it in my products table. Here is my ...
0
votes
0answers
35 views

Designing a correct table structure

We are trying to save the Family History of a particular foreign job applicant. Below are the details we have to save. Familiy Member: Father|Mother|1st Brother| 2nd Brother| 1st Sister| etc etc ...
1
vote
2answers
77 views

Design: how to store lots of booleans?

What is the most optimal way to store lots (up to 300) of properties about an object? All properties determinate presence of a factor. Like, "has dog", "has cat", "has garden", "has N". Initially I ...
1
vote
2answers
42 views

Table design for linking pictures to a place

Could someone give me some advice on designing a table for a system that has to store x picture for 1 place? Is it better to have something like this: place table: id_place / reference 100 ...
2
votes
1answer
222 views

Why do/should DBMS cache at the application layer?

This article describes DBMS as caching data at the application layer, which is why they often use Direct IO to bypass the file buffer cache. My question is: what benefits are provided by the DBMS ...
1
vote
1answer
333 views

Designing a High Score/Leaderboard table

I'm looking for input on how to design a highscore table for a game I'm creating. The database I'm using is postgres. That's not really something I can or want to change (unless there's very good ...
0
votes
0answers
86 views

ER diagram to tables

Consider the following exam question: Translation: The INCORRECT transformation from the diagram at the right to tables is... This is what I think: a) is incorrect (the column es_C (is_C) does ...
2
votes
1answer
271 views

How to return a record from function, executed by INSERT/UPDATE rule (trigger)?

I'm having some issue when I'm trying to join two tables in a single view (for migrating code we want to split one big record into two records). I'm using Postgres 9.4! Here is an SQL fiddle. The ...
0
votes
1answer
34 views

What does normalization say about storing data from objects that use a decorator pattern?

I am just curious as to what the best practices are for storing the data from objects built using decorator design. I have a base class and can decorate it with A, B, and/or C, with A B and C having ...
0
votes
0answers
19 views

Modeling attributes relations in RDBMS/NOSQL?

I have a table to hold the relationship between attributes and documents: I need to support the following queries : give all documents where attrib X='value' give me all documents where attib ...
0
votes
2answers
213 views

Database structure for hierarchical quiz?

I'm doing a personal project where I have a quiz with a number of boolean questions. Each question will have a two answer choices "true" and "false". Based on the selected answer, a new question will ...
2
votes
1answer
87 views

I can't create relationship in my database sql server

I have designed a database for my website. It has 3 tables: user, topic and comment. A user has many topics (or articles) A topic (or article) has many comments A user has many comments I ...
0
votes
0answers
21 views

How to have a relation applied only to all entities related to another given entity?

Let's say I'm trying to design an online server for judging a bunch of submissions to several problems. Firstly, each problem has many subtasks (which must go to one problem alone). For each ...
2
votes
1answer
60 views

Does SQL Server redistribute data after adding an additional data file?

Imagine a database about 30GB in size using 3 data files on the same disk. Someone told me to have one data file per processor implemented to get full performance on all cpus. So if I now add three ...
0
votes
1answer
63 views

What's the best database if i want save data temporally? [closed]

I want to create a datalog system so I need to store some int data temporally. What would be the best database (Relational, NO-SQL or some specific) for that purpose? And what would be the best way to ...
0
votes
0answers
48 views

Design a database with test table with different answer format

I am designing a database with tables: For each test,there should be a template and one test has many product code and each product code has or has no attribute. tb_template(id,name) ...
1
vote
1answer
53 views

Clarification for database creation and relations

I've trying to make database with few tables and relations between them. As I'm not very good in databases at all I need some clarifications. The idea is to connect table with table_1, table_2 and ...
2
votes
2answers
130 views

What's worse, too many entities or too many tables?

I just had a question about database design, I am in fairly early learning stages of this so bear with me. Suppose I have a parent table called "Projects" each "Project" Entity can have any number of ...
0
votes
0answers
35 views

Data modeling question on Cassandra DB

I'm trying to save events of a month for a user to my Cassandra DB instance. Each month the data will expire and will be removed. The data I try to model will contain user id, date of event and event ...
0
votes
0answers
19 views

Should I install hadoop on a single node

I just bought a desktop computer with 16GB RAM and 1TB drive, i7-quad core. I will be partitioning off 800GB for Ubuntu so I can do some data science type tasks. Is there any advantage to installing ...
1
vote
1answer
42 views

ER-Model for Borrowing-Lending-Network?

I plan on creating my first database so this is going to be a newbie question. My database is supposed to be for a Borrowing-Lending-Network where users can borrow products from other users. Creating ...
2
votes
3answers
440 views

Which design to choose

Suppose I have a website that communicates with a database. In some page of my site i want to exhibit a list with all the students in my database. There are two kinds of students: regular ...
0
votes
2answers
73 views

what is a good use case for splitting user table by role

I have a requirement where there are primarily 5 roles in the system. Each of these roles increase in hierarchy from junior to senior most role. Each junior role is a subset of its immediate next ...
3
votes
1answer
63 views

How to create a Relation between a table and a many-to-many relation table

I am buildng a new database inside an Sql server 2008 r2.I have the following tables & business rules:- Skill that have predefined levels assigned to it, such as junior, senior, manager. Staff ...
1
vote
1answer
55 views

Duplicate table structure with different data [closed]

I am looking for a way to resolve a design issue with a Microsoft Access project that is being converted to use SQL Server 2014 as a backend. We have several Access backend files, two of them have ...
1
vote
2answers
47 views

Separate login for user / administrators using mongodb

I have 2 separate groups of users on my website. One is user and the other one is admin. Currently I put them in 2 different collections user and admin and login respectively. My questions is: ...
0
votes
1answer
60 views

Schema design for storing item combination with order

What I need: Three types of items, and user can add/delete items. Use will select some items from those three packs, and arrange an order according to his/her preference. The number of records ...
1
vote
1answer
122 views

Optimize large table design

First, I am a complete novice when it comes to databases, but have been given the task to speed up queries on a large set of data. (Hundreds of millions of records) The current implementation is a ...
1
vote
1answer
84 views

Best way to document Dwh views [closed]

I works in a company that provide Dwh views as an API for external Customers (We use MS-SQL 2008 & 2012). every once in a while we release new views and updates the existing views. We have ...