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

3
votes
2answers
118 views

Can relationships have relationships?

I have the following requirements (as part of a larger system). In the database, I need to maintain a list of parts, suppliers who sell those parts. Many suppliers can sell the same part and each ...
1
vote
0answers
72 views

Can XML columns in Oracle/MS SQL Server replace document oriented databases to some extent?

Just a strategic question: I am currently working with frequently changing data schemas and it takes a lot to keep track of versions and specific content. I do, however, have a classic OLTP ...
2
votes
0answers
215 views

Number of ISA relationship triangles in an Entity Relationship Diagram

The following two diagrams are nearly identical. However, in one, there are two ISA triangles from the Entity "Movie" and in the other there is just one. What is the difference in meaning?
0
votes
0answers
98 views

In mySQL possible to change auto-increment ids that have huge gaps and if so how?

I am importing a 50 table relational database (I'm not a dba) with 250,000+ records in most of the tables, yet the auto increment is off in most tables, some for example showing the last ID at 5 ...
0
votes
1answer
257 views

Advantages of middle tables in one-to-many relationships

Entities: Lists Leads What I am trying to achieve is a scenerio where in the relationship between lists and leads the following constraint is applied: A list can have many leads, but a lead can ...
0
votes
1answer
26 views

Good idea to include summary of frequently accessed data from another foreign-keyed table?

Sorry for poor title, I'll try to explain it in more detail here. I have an application that often gets a row from table A, then looks up a column from that in a foreign key mapping table (table B), ...
0
votes
2answers
90 views

Multiple relationships issue

Here is my SQLFiddle: http://sqlfiddle.com/#!2/affc4/9 A brief description of the issue: I have the following data: topics brands celebrities All 3 of those data types can be associated to an ...
0
votes
2answers
142 views

Diffrence between relational and unrelational database [closed]

What is the difference between relational(MySql) and unrelational database(MongoDb)
0
votes
0answers
76 views

Need advice on this EER Diagram

This db will work with a CakePhp app and need advice about design. Is it good idea to put orders on center or should I put clients on center? Clients has orders and an order record can only have one ...
2
votes
2answers
78 views

Several stays: many-to-many relationship

Could you please help me with the following problem? I'm a total novice in DB design. I have a table with researchers who visit our university. They come for some period of time (from, till). Now, ...
1
vote
0answers
58 views

Table Structure: 2 Related Entities Share the Same Entity

I was hoping I could get some advice on my table structure. Im writing a simple workout tracker for me and my buddies. These are the requirements: Multiple users A user can have multiple workouts A ...
0
votes
1answer
230 views

Event Management System

I'm working on a "Event Management System" Online Software Project where the system requires the following: Viewers can sign up for their user account Events can be created by the admin from the ...
2
votes
0answers
387 views

The nature of the relationship between two tables in MySQL

Good day. I'm designing a database for a research project where we're predicting whether or not young female athletes will rupture their ACL(s) based on the nature of a test jump recorded with a ...
1
vote
1answer
432 views

What does a round relationship icon mean in MySQL Workbench Visual Data Model

I have created a model in the Visual Data Model of MySQL Workbench, and on one single relationship, this icon shows up: What does it mean? The Relation is 1:1, and this icon shows only on this ...
1
vote
2answers
120 views

Is there any way to tell the number of matches found in a database value matched with LIKE?

Is there any way I can query a SQL-Server-CE database that will return the number of matches found in a cell value using LIKE (or MATCH AGAINST or any other method I'm not aware of, really)? EXAMPLE ...
1
vote
2answers
28 views

Help wrapping my mind around many-to-many relationships

I'm making a database that needs to have the following tables: Article, Video, Image, and Keyword. Keyword contains a fixed list of keywords. (For example when creating an article, you'd have to ...
2
votes
1answer
28 views

NEWB Getting to KNow New Database and Understand Where Relationships Are

I'm teaching myself SQL using MYSQL and a textbook. While working through the textbook I'm using a database I'm kinda familiar with - an exported copy of my CMS driven websites database. My website ...
1
vote
1answer
30 views

related column contents

I've designed a mysql database made of several independent/unrelated tables to use in my office. Different tables hold information about clients (names, addresses etc), visits to the office (dates, ...
0
votes
1answer
43 views

Bit column vs multiple join tables

I asked a question earlier about how I could define a many to many relationship between users and FOSes (fields of study). My original question was how could we know whether the user was the ...
0
votes
1answer
128 views

Multiple junction tables?

I am working on a system where you have users, and you have Fields of Study or 'fos' for short. Each user can have many fos and each fos can have many users. So we are dealing with a many to many ...
1
vote
1answer
38 views

JOIN to read first table and get possible relationship in the second table

Consider a main table as CREATE TABLE groups ( group_id int(11) NOT NULL AUTO_INCREMENT, group_title varchar(255), PRIMARY KEY(group_id) ) ENGINE=InnoDB and a second table for relationship as ...
1
vote
1answer
104 views

How would I change this relational model to fit a nosql database?

Because of things beyond my control, I have to switch from a relational database to MongoDB for the advertising platform I'm helping to build. I've got a relational schema sketched out, but I'm unsure ...
0
votes
1answer
774 views

Candidate key = Key = Minimal Superkey?

I got a little confused by all these keys. As I understand A key of a relational schema = The minimal subset of a superkey that is still a key = A candidate key Is this correct or not?
0
votes
1answer
85 views

Index optimization

I'm building a 'tag' system for my blog posts. Currently my tags table has columns tagid - MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY and tag VARCHAR(30) NOT NULL UNIQUE. And I have another table ...
1
vote
1answer
146 views

Separating tables vs having one table

At the moment I have a table setup that looks somewhat like this: create table tbl_locationcollections ( id int(11) PRIMARY KEY IDENTITY, --(Primary Key), name varchar(100) not null, ...
0
votes
1answer
136 views

Is it better to use multiple one-to-many relationships, or polymorphic?

I've got the following tables: Clicks table Websites table Ads table Both Ads and Websites have many Clicks (i.e. both models have a one-to-many relation with Clicks). In such cases, is it better ...
1
vote
1answer
205 views

Switching to NoSQL for native JSON use?

I am rather comfortable writing concrete schemas with explicit primary keys, foreign keys, indexes, views and stored procedures. For queuing I use a NoSQL solution called: Redis. Recently I heard a ...
0
votes
0answers
165 views

Use cases for NoSQL databases: Time series

I need to set up a database that will record temporal series data (sensors). A friend of mine has recommended me to use a NoSQL database instead of using Oracle (for instance). There're also some ...
1
vote
1answer
251 views

Delete entry from related tables

I can not use InnoDB engine because of some dependency troubles in LuaSQL and PtokaX. My current query is something like: DELETE e.*, m.* FROM entries e INNER JOIN magnets m ON m.eid = ...
0
votes
1answer
147 views

Foreign Keys with Composite Key

Imagine I have a table with the following dependency: (Name, BoughtFrom, TimeBought) --> Cost Where the three attributes in bold form a composite primary key for the table. Now then, I want to ...
2
votes
2answers
229 views

MySQL - Normalization over meaningless data - Compound Primay Keys or Surrogate ID field

Please forgive my title; if you have a suggestion for it, feel free to comment. I have a database: DROP TABLE IF EXISTS `books`; CREATE TABLE `books` ( `isbn` VARCHAR(255) NOT NULL, `title` ...
1
vote
1answer
249 views

Record with variable number of columns?

I am trying to model a cable mapping for devices. Each device has multiple cards, and each of those cards has multiple ports. Since both the number of cards and ports vary, I am confused on how to ...
1
vote
1answer
513 views

Modeling a ticket system based on a set of disparate kinds of tickets?

I'm working on a project that allows for the creation of "support tickets." These are not confined to something that needs fixing, however, so in a way they could more accurately be called "jobs." ...
-1
votes
1answer
123 views

What is the real-world purpose of an optional 1:1 relationship?

I know that one-to-one relationships can be used to split data into multiple tables for performance or security and that it is used to create a is-a-relationsship. But aside from that things, what is ...
7
votes
2answers
375 views

Best relational database structure for this data

I'm in the process of creating a database scheme for the following scenario: There are users Users have roles (such as "Developer" or "CEO") Roles have applications (such as "Topdesk") Applications ...
2
votes
3answers
543 views

Database Design Relationship for Patient Visit in MS Access

I am designing a database to store records for research purposes, and I am having trouble picturing how I can create a relational database based on the information I have. There are a total of 6 ...
7
votes
3answers
196 views

Arbitrarily ordering records in a table

A common need when using a database is to access records in order. For example, if I have a blog, I want to be able to reorder my blog posts in arbitrary order. These entries often have lots of ...
2
votes
0answers
55 views

Create Scheme that allows for fluidity between entities [closed]

We are a small rapidly evolving company and recently investigated switching databases from SQL Server to a graph database. We like the graph approach because of the fluidity and openness that it ...
1
vote
1answer
176 views

Database Relational Design for Multiple Categories

I am building a database for participants who are grouped into studies. There's a total of 5 different studies - A, B, C, D, and E. The participants may be in more than one studies, and participants ...
1
vote
1answer
54 views

Correct data model for users with clients

I have an application where users are granted access. Part of the system allows users to have their own 'clients'. I have a users table ******************************** users ...
7
votes
3answers
3k views

How to have a one-to-many relationship with a privileged child?

I want to have a one-to-many relationship in which for each parent, one or zero of the children is marked as a “favorite.” However, not every parent will have a child. (Think of the parents as ...
0
votes
1answer
86 views

Looking for a scalable relational database [closed]

I'm looking for a database that achieves the following: fully ACID. relational with joins. has transactions. allows the administrator to specify sharding rules (for example: users from Europe should ...
0
votes
2answers
294 views

Relationships in a school database

I am designing database for a school app. Student is the main entity in the database. Student has relation with Parent & Guardian. I am confused as where to store references. As will student ...
0
votes
1answer
440 views

SQL Server 2008 - How would I create a dynamic query for finding relationships and references to the primary key?

Since I'm new and I've never shared, and yet there are a few useful scripts that I need on a daily basis, I thought I should. As a new DBA, some data fix DML operations and simple business logical ...
3
votes
1answer
127 views

Optimised Schema for City-to-City Distance Table

This is my first question, forgive me if this question is simple. I'm stuck here, trying to implement the relations for the data represented below. I want to scale it vertically (new rows), instead of ...
1
vote
1answer
99 views

Relation candidate keys

I have the following relation: R = ABCDE F: AB->DE, AC->B, DE->C, AE->C, C->AB I need to determine this relations candidate keys. Now, if I understood the defintion correctly: ...
4
votes
1answer
171 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
889 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 ...