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)

0
votes
0answers
34 views

How to reference a table mapping that is not initially known in another table

I have four tables: ExternalName, InternalName, ExternalInternalNameMap, and Transaction. ExternalName and InternalName have a many to many relationship. ExternalInternalNameMap is the junction table ...
1
vote
0answers
38 views

What is the difference between 2 phase locking and strict 2 phase locking?

2 phase locking is used to ensure isolation of database transactions (by ensuring serializability). But there is another term called Strict 2 phase locking. I find it hard to understand the ...
0
votes
1answer
396 views

Select rows from table where each row refers to a different schema

I have customer table in public schema. And I have a schema named after each customer. Each customer schema contains different tables like portals, plugin, ... When I want to select portals used by ...
1
vote
1answer
218 views

Use a set database schema or EAV design? [duplicate]

I have already created a database design with a set schema. The database schema is for a web quotation form. PS it is not a simple quotation form and hence need to customise the form, form builders ...
1
vote
0answers
26 views

What are my options in creating this Location table?

Say I have an Items table. Each item has a location associated to it. This location can either be a city, a state or a country. I believe this could normally be solved with a column Type in the ...
-1
votes
1answer
52 views

Which one is best solution for future database structure?

I'm working on a big web application. so i need to create user_preference_table it has the marks for every users for each attributes. here attributes are games so in the user_preference_table i need ...
1
vote
2answers
60 views

SQL Server 2012: set a column to only use a single case?

Is there a way to tell SQL Server 2012 to store both A and a as A (or both A and a as a) for some given column such that every insert statement does not need to have UPPER() in it?
0
votes
1answer
22 views

Help me define the tables in this scenario

We have 2 tables setup like this: WEB_GK_STATE PRG_CODE Varchar2(5) STATE Varchar2(2) WEB GK PRG_CODE Varchar2(5) TEXT Varchar2(4000) Here is some sample data: ...
0
votes
1answer
68 views

Normalising Customers and Employers with a people table

At what normalisation stage is it recommend to split say Customers and Employees into a people table and then link to the unique attributes of Customers and Employees. I cant seem to find the ...
0
votes
1answer
64 views

Uber-wide tables: Time to switch to Mongo?

As a web developer, I've typically only worked with nice, normalized tables in SQL-based RDBMS, but I'm doing some data consolidation for a researcher who will be analyzing correlations between all ...
0
votes
0answers
22 views

Advice for a friendship table

For my little project I would like to create a very simple friendship system. And I would like someone to give me some advice/criticise the current design I have. Here is an example of my friend ...
0
votes
2answers
25 views

Can we determine FDs if we are given some tuples?

I am taking a databases course and i'm learning about functional dependencies. I have searched around and did not find any information on this. My questions is if we are given a table with some ...
0
votes
2answers
143 views

Make DB tables customizable from an Admin

I want to build an commercial product promotional mobile application in which the administrator of the app will be able to customize some texts / pictures or whatever from the database that ...
1
vote
0answers
48 views

Good way to store daily train data in MongoDB

I am preparing to collect large amounts of information about trains in my country. Each train in my country has a number. I've already collected all of these numbers. There are about 4000 of them. ...
0
votes
0answers
69 views

School fees database design

I am trying to design a database for a school fee management system. The school is charging some Admission fees , Security for one time but development fund, registration fund on annual basis. but ...
4
votes
1answer
287 views

Help with a scenario of music groups and members in ERD design

Can someone please show me how to construct this ER diagram with the following scenario? I’m confused with the ‘or’ part of it. Description An Artist has a Name, and must be either a Group or a ...
0
votes
1answer
53 views

About schema design of NoSQL DB.(How to query multiple data?)

I just got a requirement, to build a web only with Redis. Data of the web is something like this(I write as RDBMS): User Info: user_id,first_name,last_name,age,..... Address: ...
0
votes
2answers
107 views

Excel spreadsheet into a MySQL database tables

I am relatively new at database design and would like to get this right from the start. I have had differing advice on how to do this and believe that the common suggestion of importing all the data ...
0
votes
2answers
221 views

Idea for manking tables for a pharmacy

OK I'm not into Database management, but I got this problem, also not sure if I'm posting it at the right place or not. So, my Dad works in a pharmacy and all the work there is on paper and is done ...
0
votes
0answers
19 views

How to model a type that's related to one of a number of other types

A generic data modeling question: How would one model the database tables in a case in which an entity of Type A is related to one entity of either Type B or of Type C (but not both). For bonus ...
0
votes
4answers
150 views

What is a DB Link good for?

Here is defined what a DBLink is but I really understand for what kind of situations you need it? What I could imagine is a situation where I have a limited (in size like sql-server express) ...
3
votes
1answer
119 views

How do completely empty columns in a large table affect performance?

I have 400 million rows in a Postgres db, and the table has 18 columns: id serial NOT NULL, a integer, b integer, c integer, d smallint, e timestamp without time zone, f smallint, g timestamp without ...
0
votes
2answers
65 views

One-To-One relation is this a good practice?

I have a table "Place" (id_place, name, address,coor_x, coor_y) I would like to add for a place their "facebook page" "twitter page" "wesbite" and telephone My first idea was to create a table let's ...
0
votes
0answers
89 views

Credit Card database schema

I am not very good in database design so please if you can help me with this. I want to know what will be the best way to store it in mysql database Here is the selection I want as final Select ...
0
votes
1answer
52 views

How to define the table structure for measured data in sqlite

I have an embedded system with an sqlite database. How should I define the table structure for the measured data from 4 sensors? Each sensor give us every second an numeric measured value. The ...
0
votes
2answers
40 views

Design of MySQL

My supervisor asked to design a database by using MySQL. This database is used to store information about evaluation surveys. The survey has a lot of questions, and each question has 5 choices, the ...
0
votes
1answer
80 views

PostgreSQL function thinks table reference exists when it does not

So I run this query: SELECT f_copy_tbl('parts','parts1'); ...while working on code based off of this answer and I get this error message: ERROR: relation "parts1" already exists pgAdmin III ...
1
vote
1answer
82 views

Multi table GROUP BY query optimisation

Currently I have a multi table/column GROUP BY query which is pretty slow. Below is the tables schema used by the query: report Table ...
0
votes
2answers
107 views

One MySQL Database or Many MSSql Databases

At the moment I have an in-house Access database, data stored by our online survey provider, and data stored by our project management provider, both in databases. What I want is an in-house database ...
0
votes
0answers
16 views

Assigning items to containers

I have two tables for separate things: One table for containers, one table for items. They both have things like descriptions, title, and of course ID fields: container_ID and item_ID. My containers ...
1
vote
0answers
36 views

Implementing a consistent mailbox

I am trying to implement something like a mailbox for short messages between users. I am using Postgresql 9.4.1 with SQLAlchemy (Python3). There is a table of users: users = Table('users',metadata, ...
0
votes
0answers
17 views

Should I partition table by time or project_id, or both?

I have a table of event data that is getting slightly large. It's ~10 million records. I want to partition the table to help speed things up. I almost always restrict the query by both the time and ...
1
vote
3answers
163 views

Copy table with separate sequences for serial columns

While creating a column management tool I came across the need to quickly replicate tables in PostgreSQL so I would not test new tools with non-test tables. To effectively test the new column tool ...
0
votes
0answers
12 views

How to add entries to tables in PostgreSQL if the attributes are reliant on other tables?

The problem that I have is something like this: Users ========= UserID Name Surname User Group ========= GroupID LeaderID Group Leaders ============= LeaderID UserID GroupID The problem arises ...
0
votes
0answers
32 views

How to combine 3 queries into 1 including set?

I have 3 mysql queries and each does specific job, the problem is I can't figure out how to combine 3 queries into 1. I'll write down all 3 queries and explain what each does, thus you can figure out ...
2
votes
1answer
68 views

Storing floating point values for various units of measurement (kg, ml, mm, pl)

I have a table like the following: order_item ------------ serial | id (PK) integer | order_id ???? | quantity integer | unit_of_measure_id (PK) --> ml, l, kg, mg, mm, m, etc. ...
1
vote
0answers
50 views

Help with ER design

So i am trying to create a db for a restaurant as a homework assignment.. However there is a spot that confuses me and involves the dish entity. "Every dish must belong to a category ...
3
votes
1answer
50 views

What is “cover-to-cover indexing”?

I came across this term reading my lecture notes; I can't find it on the internet. My notes say the following: Given a schema R(A,B) and a query of the form "A=a", or "B=b", or "(A=a AND B=b)". ...
0
votes
1answer
50 views

Zerofill Auto Increment - mySql

Ok, So I'm working on an app and I can't remember, for the life of me, why I set a zerofill on an Auto_Increment column when I created the database. And I couldn't exactly find any compelling info ...
1
vote
0answers
51 views

Database schema design for individual configurations

I'm trying to design a database schema that allows me to store customer custom built products. As a simplified example: A user can buy a cupboard, draws, boxes, and dividers. A cupboard has 2 tiers. ...
0
votes
0answers
26 views

what model should i use for store detections time series in mongodb?

i have cloud site with many hosts and virtual machines inside of it. I receive from some software many different metrics values regarding vms usage (cpu load,free ram,energy consumption and so on). ...
0
votes
3answers
696 views

Should login id and password be stored in separate table

I am working on my academic project. I have a table for employee records which have employee id, joining date, designation and other fields. I am trying to implement a scheme in which when record of ...
0
votes
1answer
40 views

Help with relational database design

I have a data model where each user profile belongs to a department. Each job is also available for a specific department. The department names are formatted like this: AAA-BBB-CCC-DDD-EEE, but of ...
1
vote
1answer
525 views

Optimizing Amazon RDS - MySQLTuner Recommendations / Feedback & Suggestions

I'm currently trying to optimize a database I've inherited for speed. The server is an Amazon RDS db.m3.large instance: 2 VCPUs 7.5 GB Memory 500 GB HDD My current strategy is to do the ...
-1
votes
2answers
48 views

Multiple instances of same foreign key in a single table

I have a table that references the same foreign key multiple times (4 times) in the same table. Can someone explain why/how this makes sense?
0
votes
0answers
55 views

All in one table or separate tables for each categories for a clasifieds website?

I am developing a classified website by using ASP.net and my DB is MYSQL. In there I am using a header table to store common records of an ad. like ad title, description, published date like wise. And ...
2
votes
1answer
316 views

Foreign Key NULL vs Foreign Key to an empty string

This is a table for a catalog of medicines. Some have a pharmaceutical brand, others are generic (i.e. they will never have brand information) CREATE TABLE medicine ( id serial PRIMARY KEY, ...
1
vote
1answer
76 views

Which of these structures are good for maintaining history data?

Iam creating an application which is being used to send reminders. Here is the requirements. We have set of Students. Every student has a Student Pass, this need to be renewed in every month. ...
1
vote
2answers
124 views

Is unique index better than unique constraint when an index with an operator class is required

Postgres docs say: The use of indexes to enforce unique constraints could be considered an implementation detail that should not be accessed directly. One should, however, be aware that there's ...
0
votes
2answers
30 views

Loose database structure

I'm just thinking out loud. I'm wondering if there's any database technology where it's structure does not need to define upfront? For example it may start off with just one column or roll and user ...