Category of database management systems characterised by the ability to join two data sets by matching on common fields, using mathematics-based relational logic.

learn more… | top users | synonyms

4
votes
1answer
176 views

How should I model a worflow of status/activities ? (rules like “if is 3 go to 4, if is 4 go to 5” etc)

I'm trying to model a workflow (status and activities) to create "rules". Let me give you an example. The main "object" let's say are "vehicle requirements", I will have this table: idRequirement, ...
1
vote
1answer
102 views

Can I place the attribute in the Entity, when the foreign key is also already present?

I am using DBdesigner Fork for generating ER diagram. I have the 'Company' as an entity for which can I place the attribute of 'idShares', despite of having the foreign key of Shares Entity in the ...
2
votes
2answers
960 views

Database Design - One table for different types of transactions

Considering a procurement system as an example. Would it make sense to have one single table for the following: Quote, Order, Invoice and Credit Memo? There will be some details that are different. ...
0
votes
2answers
65 views

View for a MANY_MANY_MANY relationship

Let's say I have 3 main tables: category, tag, url category and tag have a MANY_MANY relationship (category_tag). tag and url have a MANY_MANY relationship (url_tag). I would like for a given ...
1
vote
2answers
95 views

Table Design - Identical tables for different statuses

I am developing a transactional System and the below is a simplified scenario of my problem. Users enter JOBS in a system. A User first enters a JOBS with a DRAFT status (and the Job is given a ...
1
vote
1answer
1k views

How to model entities in an entity relationship diagram?

I'm a beginner Database designer and wondering if anyone can help me understand this. Let's say we want to design a system that has, among other entities, an entity called Vehicle, and another one ...
3
votes
1answer
418 views

Applying user-defined fields to arbitrary entities

Currently we have an old (rather crude) system that has user-defined fields, which are mapped against rows in arbitrary tables. This was an after-the-fact modification based on a customer request, and ...
1
vote
0answers
119 views

SQL relationships, one-to-one, many-to-many etc [closed]

I'm trying to understand all relationship types that can be created in SQL. So far I only get the "belongs-to" one - Example: a table with "Blog post" records, which contains an author_id column that ...
2
votes
3answers
750 views

First Normal Form, why is it good and how does it reduce redundancy

I asked a similar question on SO and was advised to ask the type of question here. This is for a course on relational databases. A sample problem asks "how come every table in a relational database ...
1
vote
2answers
5k views

MySQL Workbench, how to refresh EER diagram?

I'm using MySQL Workbench to design my MySQL database and model how entities would look like and how they would relate to each other. Now, sometimes I use Doctrine ORM. When using Doctrine ORM, I ...
2
votes
0answers
2k views

Schema for an RBAC (Role-based Access Control System)

I want to implement an RBAC, Flat based. I've decided to base my system on the NIST standardization model. Although all fine and well, I have an inclusion to that design. Instead of a hierarchy ...
7
votes
1answer
430 views

Friends relations in MySQL

I'm developing a friendship relation in MySQL where friend relation is mutual. If A is friend of B, then B is friend of A. If one of the users end friendship then relation drops. I want to learn which ...
2
votes
1answer
910 views

How do I persist recurring events?

I've been tasked with designing a system to recur events. Events may recur daily, hourly, monthly or yearly. Users should be able to schedule events "every 3rd Wednesday of the month" or "The 1st of ...
4
votes
1answer
2k views

Designing a user authenication (Roles & Rights) module

I am trying to model a User Authentication module for a MS SQL Server database that will be the back end to a Delphi UI Application. Basically, I want to have user accounts where the user belongs to ...
3
votes
2answers
142 views

Which tables to create according to relations

We are planning a new system with a new DB (MS SQL Server). We have the following entities and the following relations: Entities: Clubs, Chains, PaymentTypes, etc... Relations: Clubs-Chains (M-M); ...
4
votes
1answer
122 views

unique constraint on a set

With reference to this SO question, what would be a correct way to implement Unique tag Combination Constraint in SQL Server 2005? To illustrate the problem, I make an example: A tag_bundle consists ...
1
vote
1answer
316 views

What is the correct way to store a list and its items in this instance?

The app I'm working on revolves around projects. Each project can contain several lists, and each list is made up of several items. Each list relates to a single project. Is it better to have one ...
1
vote
1answer
44 views

What is this type of query called, and how can I formulate it?

I have following tables: events(event_id, name, description) groups(group_id, event_id, title, description) event_group(event_id, group_id) users(user_id, name, email) ...
4
votes
1answer
134 views

How can I improve this design?

I'm creating an event planning PHP/MySQL web application as a learning project. The whole app revolves around the idea of the event and its various components (participants, groups, lists, etc.) I ...
4
votes
1answer
477 views

How to use a relational database to store all users who belong to a group, and all groups which a user belongs to?

This is a beginner question: A user can belong to many groups, and a group can contain many users. Let's say the two tables look something like this: user_id user_name user_email group_id ...
2
votes
2answers
200 views

mySQL Relational Tables

Say I have 3 tables Products, Orders and Orders Product Products Table ID | StockNum | Description | Price 4 | 452SB | Black | 45.65 5 | 752SA | Green | 17.12 Orders Table ID ...
5
votes
1answer
298 views

Database structure, relational or data warehouse?

Good morning, Im having some issues with how my database should be laid out and would appreciate some guidance. I have several tables (rainfall data), each containing the following columns: Date ...
5
votes
4answers
272 views

Database Design for updatable sequential records

I am working on creating a data model for storing data related to production tracking. I work for an engineering firm that models and analyzes data for our clients. There are several steps in the ...
-1
votes
1answer
868 views

Difference in between HAS MANY and BELONGS TO in Yii framework [closed]

I am new to the Yii Framework. I discovered HAS MANY and BELONGS TO in the documentation, however I am confused about these features. Can someone give some real life examples with a diagram that ...
6
votes
2answers
2k views

Is one-to-one relationship normalized?

Consider we have a large set of statistical data for a record; e.g. 20-30 INT columns. Is it better to keep the entire set in one table as they all belong to a record OR creating a another table ...
6
votes
2answers
713 views

What's a good relational structure for units and complex unit conversions?

My company is in the Energy industry and I need to come up with a good way to represent the conversion of units of measurement. I've done some searching and have yet to find a good article covering ...
2
votes
3answers
366 views

Express union which is dependent on other results

I would like to make a union of two tables that are actually in a hierarchical constellation. How would I write that in relational algebra? Say table A is the parent of B in a 1:n relationship. ...
4
votes
1answer
388 views

Would appreciate some suggestions on how I should model this data

I am setting up a website that will have users. Users can search for songs and (if signed in) save them to a playlist or their library of songs. I want it to be like iTunes in that all the songs on ...
4
votes
1answer
440 views

database design issue

This is my first time on this beautiful content rich site. I have a sql server 2008 database, but am not too experienced with good relational database design. My project is this: I have a school ...
17
votes
4answers
8k views

How should I design a relationship table for friendship?

If A is a friend of B, then should I store both values AB and BA, or one is enough? What are the advantages and disadvantages of both methods. Here is my observation: If I keep both then I have to ...
1
vote
1answer
521 views

Insert bulk Parent and Children rows using SQL Query

We receive bulk data from our customers in a spread sheet. I loaded them in a temporary table as of now. I tried to normalize the data and create a parent table and each parent to have 4 or 5 child ...
4
votes
3answers
236 views

How to design this simple DB?

How to design this simple DB? I need to add some things to a DB I use to keep track of servers. Table looks something like this. Matrix | Name | Description | Etc | Etc | ...
1
vote
1answer
532 views

Relational algebra question

Here is the relational schema given : employee (person-name , street, city) works (person-name, company-name, salary) company (company-name, city) manages (person-name, manager-name) Q: Find the ...
6
votes
2answers
286 views

Definition for “logical difference”?

I'm currently reading "SQL and Relational Theory" by C.J. Date. And although I'm quite far in the book, I've got a few basic questions. I want to know what the term "logical difference" means, The ...
14
votes
3answers
3k views

Proper Use of Lookup Tables

I'm having trouble figuring out exactly how to place good boundaries for when and where to use lookup tables in a database. Most sources I've looked at say that I can never have too many but, at some ...
2
votes
1answer
164 views

How can I best combine “get categories” and “has user access”?

I was wondering if it's possible to create a query for the following problem. I only want to select categories from the (MySQL) database (if the user has access). A user has multiple roles; A ...
1
vote
1answer
707 views

database functional dependency candidate keys

How do you know when you found all the candidate keys in a functional dependency? I know how i would go about finding a candidate key, just don't know how to tell if there are more. Thanks.
2
votes
2answers
276 views

Advanced search engine or server for relational database

In my current project we are storing big volume of data in relational database. One of the recent key requirements is to enrich application by adding some advanced search capabilities. In the Project ...
6
votes
3answers
1k views

How to normalize Time Sheet data?

I am having a terrible time finding an appropriate way to store this data in a database. The current excel (simple) version looks something like this: http://i.stack.imgur.com/BEZOw.png Staff and ...
4
votes
2answers
1k views

Two relationships to same table

i have one transaction table, each transaction has 5-6 contacts involved. each contact has the same fields like name, address, cell, email etc. So the best thing I guess is to use the same contact ...
1
vote
1answer
241 views

How to design relationships for variant data?

Help me define the table relationships for data with multiple structures. I need to track leads. Leads come from multiple sources. Each lead source has its own data structure. I need advice ...
7
votes
2answers
1k views

How do Application Like Yelp Retrieve distance information from data base efficiently

For example, say I have a table: Business(BusinessID, Lattitude, Longitude) All are indexed of course. Also there are 1 million records Say I want to find businesses closest to 106,5, for example, ...
0
votes
1answer
721 views

Database design for head to head sports

I am trying to create a database to store details relating to darts matches. Im relatively new to this so was wondering if the design I've come up with below would work. It seems I have lots of places ...
3
votes
1answer
309 views

What scope(s) is “hasMany” a part of?

I realize, when talking about structures, obviously if you say "post hasMany comments" there are many records about comments relating to each post. What I don't understand is what context these sort ...
5
votes
2answers
8k views

Relational Design - Multiple tables into one foreign key column?

Take a table that tracks meat purchases. It has a "meat_id" foreign key column to indicate what type of meat the purchase was. But, the different types of meat are unique in some way (such as USDA ...
0
votes
1answer
864 views

Entity Relationship Model for linked tables

Certainly a noobish question, but I'll ask it anyway. Perhaps someone else will be thankful. ^^ I am getting warmed up with MySQL and I try to understand the concepts of creating well structured ...
1
vote
0answers
447 views

Which database technology for big structured data? [closed]

Scenario: Think you have got 100TB of text in 200 tables. This is structured related data. compareable to dbpedia only more data. Any really relational and distributed and performant database would do ...
13
votes
5answers
1k views

What standard should I follow when naming tables and views?

What standard should I follow when naming tables and views? For instance, is it a good idea to put something like tbl_ at the beginning of table names? Should I designate code/lookup tables in some ...
7
votes
2answers
830 views

How to structure a model to properly and efficiently represent tree-like data on relational databases?

Based on Traversing tree-like data in a relational database using SQL question, I would like to know how the way regularly used to describe tree-like data on relational databases considering physical ...