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

1
vote
1answer
17 views

Relation between tables [on hold]

This question may be too easy to ask, but I can't understand how to do it. I am new in SQL. I have two tables. Table I book_id (AI & Primary Key) book_name book_year Table ...
0
votes
1answer
56 views

Create relationship between two tables with composite primary key

I've created a table [t1] with two fields and a composite primary key, show in below: create table t1( id int, name nchar(10), primary key(id,name) ); I want to create a second table ...
0
votes
2answers
47 views

SQL Query: Selecting a person who is a member of all existing groups

I'm tinkering around with my very first SQL queries and am completely baffled by a problem I encountered. Let's say I have the following database: PERSON(PID, Name) MEMBER(PID, GroupID) How would ...
1
vote
0answers
17 views

reports on history table

Assume Trucks which travel between Cityies. I store the Cityies that a Truck has traveled to in TruckLocationHistory table, if the Truck is passing the City, State = Passed and if it gonna stays for ...
0
votes
1answer
36 views

MongoDB Manual References vs DBREF

I've been researching MongoDB and trying to see if it would be a fit for my company's product catalog. I came across database references: http://docs.mongodb.org/manual/reference/database-references/ ...
0
votes
2answers
50 views

MongoDB/MySQL - auto increment vs object ID

I am in the process of evaluating MongoDB and writing some basic PHP applications around it. Typically in my PHP/MySQL applications, I would create an ID field and set it to auto-increment on each row ...
0
votes
1answer
23 views

Help with preventing double bookings with variable lengths

I'm designing a sample database for a venue where members can create bookings for venues. I'm looking for a method to prevent double bookings (possibly by creating a button on a form that checks ...
0
votes
0answers
17 views

calculating Canonical covers

Given F = {AB -> C, A -> BC, B-> A}, compute Fc AB-> C is A extra? {B->C, A-> BC, B->A} 1st possible Fc = {A->BC, B->AC} AB-> C is B extra? {A->C, A->BC, B->A) 2nd possible Fc = {A->BC, ...
0
votes
0answers
37 views

Help writing the following query to relational algebra

Can someone help me in writing the following query to relational algebra, I am studying DBMS and I am stuck on this exercise. Query: SELECT a.name, d.name. d.grade FROM student a, enrolled i, class ...
0
votes
3answers
78 views

Database Design for Paper Submission System

I am learner of Database design, I want to design a database for a journal paper submission system in which one paper can be submitted by one or more author. I have initially two tables Author and ...
0
votes
1answer
70 views

How to insert values in junction table for many to many relationships?

I have three tables in database: trips(trip_id(pk), trip_name(unique), user_id(fk)) places(place_id(pk), place_name(unique)) trips_places_asc(trip_id(fk), place_id(fk)) Since, many trips can ...
0
votes
2answers
42 views

Need help about giving relationships in database design

I am developing a simple blog application in which users can write posts and others can like, comment, share etc. i am facing difficulty in designing database. What I have tried is: user ...
0
votes
1answer
58 views

Trying to map postal codes to their respective cities, but running into some issues

The Problem I am creating a database of Countries, Regions, Cities and Postal Codes. Here's an example to give an idea of the database structure as it is now: Now, let's take Tuskegee University ...
1
vote
1answer
38 views

Transforming a relation to 3NF

I'm trying to transform the following relation to 3NF but can't figure it out. The relation is (a student can only have 1 major): STUDENT (StuID, StuName, Major), Primary Key = {StuID} I tried the ...
1
vote
3answers
35 views

Study material for Advanced Databases module inc SQL, Relational Model, ERM & TM [closed]

For my next module in my masters, I am planning on studying Advanced Databases. (Long story short, the masters is designed for people with NON-CS degrees, so I have never studied databases, therefore ...
0
votes
1answer
64 views

A question regarding the performance of normalization

I am sorry this is such a newb question, but it is one thing I am having a difficult time wrapping my mind around, and after an evening spent reading I finally just decided to ask for some ...
0
votes
0answers
40 views

Multi-Tiered Database Design Issue

I am trying to build the multi-level model as demonstrated. When a user creates a campaign they will select some categories and some metros from tables Category and Metro. Those selections will then ...
5
votes
3answers
366 views

Replace relational database with “poor” design in software product with non-relational DB? [closed]

Edit: This question is about how to deal with many issues that arose from a overall system design, which made parts of the system deviate from common standards. For example, managing everything in the ...
1
vote
2answers
185 views

Relational Model vs. Database Products [closed]

The formal Relational Model (logical level) for databases is not exactly the same thing as you get with MySQL, Oracle or other major products / implementations of ‘relational’ database management ...
0
votes
0answers
22 views

Employee permissions in ER model

I'd like to model an approach to permissions which I can visualise in code but am a little blurry about on the ER side of things; Each user will be logged in at this point and bound to a record ...
2
votes
1answer
27 views

Is it possible to enforce a Unique Constraint on a Dataset comprised of joins

I am playing around with an idea to describe friendships in a system, and I am wondering about constraints. I currently have a database that looks like this: Users: ...
2
votes
1answer
57 views

Inheritance or lot of relationship?

I have to transpose a class Diagram into a Physical Data Model (more precisely MySQL database structure). In my class diagram, I have a lot of entities (A, B, C, D) which inherit from an other ...
1
vote
3answers
63 views

Best approach for Legal/Natural can have many Orders

I'm working on this model: where as you may see one NaturalPerson can have many Order and the same for LegalPerson the only difference between NaturalPerson and LegalPerson are a few so in that ...
0
votes
1answer
38 views

Modeling global and private parameters

I'm trying to model a database that will be used for management and execution of SSIS packages. The entities are Client, Job and Package. A Job is the managed unit that references Client and Package. ...
1
vote
0answers
60 views

Relational or non-relational database for a system to pass objects on?

hopefully this is the right place to ask this kind of question. I am working on a system that focuses on helping people give away things that they don't use anymore. So, an object typically has the ...
0
votes
1answer
38 views

Schema check or “DATE as separate table”

I'm dusting of my SQL, and would love to know if I've got my mental ER-diagram right. http://sqlfiddle.com/#!2/c5c59 Basically, I've got 10-15 different datasets (actividades) from several locations ...
1
vote
1answer
99 views

Beginner questions about SQL and relational algebra

I'm doing some exercices waiting for the exam. I have some doubt. RELATIONAL ALGEBRA These are the table: Newspaper (Cod_n, Name_n, Publisher) Article (Cod_a, Title, Topic, ...
2
votes
2answers
108 views

Logical problem with a database model

Beforehand the table names and columns are in Spanish, my native language is Spanish. (table names have been now edited to English) I've got a database to manage the tickets sales of a trip that is ...
0
votes
0answers
56 views

mysql Database Schema for different group of user in same table

I have two type of user in my master table Doctor and Hospital both user has common fields like Name,Address,Contacts etc. But there are some different fields which is connected by foreign key to ...
0
votes
2answers
69 views

What's the use of assigning foreign keys on MySQL [duplicate]

Aside from indexing the value of the foreign key, what is/are the advantage of assigning foreign keys to databases? I've seen a lot of databases that does not assign foreign keys, but is relational by ...
0
votes
2answers
172 views

DB Design Payments Table

I'm working on a Desktop application that uses a DB to store information i.e (customers, houses, proprietors, payments). So the application must accept payments from customers to company, company to ...
1
vote
1answer
52 views

Schema design - Reference slightly different data in different tables

I'm trying to design a schema for a MySQL database and got stuck on the following. My database stores documents which should have relations with blocks of content. create table document ( `id` ...
1
vote
2answers
200 views

How to insert values into a table from two different tables?

I have three tables students table ------------------------------------ id(PK, A_I) | student_name | nationality teachers table ------------------------------------ id(PK, A_I) | teacher_name ...
1
vote
3answers
232 views

Heterogeneous ordered list of value

I have the following object model: class A { List<Thing> orderedListOfThings; } interface Thing { } class X implements Thing { int attr; } class Y implements Thing { String ...
0
votes
1answer
28 views

Database relationship refresher

All, After several years of programming applications, I'm looking to refresh my understanding of databases. What I knew to begin with was fairly basic, and honestly, it's disappeared over time. I ...
0
votes
2answers
32 views

Design for table with multiple links to other table

I am designing a database to keep track of our network equipment. My db has 2 tables: sites & circuits (circuit = cable) & (site = property location) Each circuit runs between two sites, so ...
0
votes
1answer
50 views

Is using a relational DB for storing votes and (accessed resources) overkill?

I am writing a forum component for a site and would like to keep track of what topics/questions a user accesses so that other topics/questions can be recommended based on said users previous choices. ...
0
votes
2answers
198 views

Parent/child relationship or not if the name of the field implies the relationship?

I am working with the harmonized system and try to catalog this in a MySQL database. This works for example like this: 01 LIVE ANIMALS 0101 horses, asses, mules and hinnies, live 0102 bovine ...
0
votes
0answers
75 views

How to know the correct indexes for mysql?

I tried to find out with explain where I must set the correct index. A current select takes about 20 seconds. Can someone tell me which would be the correct index for my tables? SELECT trade.*, ...
0
votes
0answers
74 views

MySQL Associative Weak Entity

I'm working on a project in MySQL that has a table of users who have favorite foods. Favorites is an associative entity between Users and Foods. I want the Favorites table to be a week entity of the ...
1
vote
1answer
35 views

Understanding how relationship sides works

So, I have this relations on my tables (see image) and I need to understand some things. I'll enumerate what I understand and what I need from yours is to say if I'm right or not and in case I'm not ...
0
votes
1answer
36 views

How to relate to information_schema

Is it possible to create a foreign key that relates to information_schema? For an application implementation, I would like to store extra column information in another table, but I want to ensure ...
1
vote
1answer
119 views

Difference between Relational database and time series database?

I have a bit stupid question maybe. I recently came across a term "time-series database". I would like to ask what is time series database and is it same as relational database? Thanks,
1
vote
0answers
137 views

How do you think in NoSQL? [closed]

I'm from the pre-nosql era and am rather comfortable with SQL. However, I cringe whenever someone suggests using a NoSQL database for the "upcoming" project. There are some major problems that I'm ...
0
votes
2answers
63 views

Help required to design a database [closed]

Firstly I would like to apologies if this is not the correct place to ask this question but I know how good community spirit is around here from my time in Stack Overflow. I am very new to the world ...
1
vote
3answers
460 views

Many one-to-many relationships between two tables

In the process of creating a small database for a therapeutic boarding school with Access 2013, I have a problem when designing the relational database model. Two times at least, I ran into a ...
2
votes
1answer
31 views

Save different account types in a database

I have the following issue. In one application (imagine a messaging/e-mail app on your smartphone), the user enters its accounts and gets information from the server displayed. I need to store the ...
0
votes
0answers
39 views

Would an INNER JOIN query in a sharded relational database hit the same shard when using a compound primary key?

In this question I have asked about modulus calculation in sharded tables, this design is used: CREATE TABLE Orders (order_id INT PRIMARY KEY, ...); CREATE TABLE LineItems (order_id INT, lineitem_id ...
0
votes
1answer
989 views

Cannot add foreign key constraint while creating table

My Error Code is 1215 which finds problem with the foreign key constraint. I know all fields are the same data types. I can't see where the problem is. Any help would be much appreciated! Thanks! ...
0
votes
0answers
82 views

What would be the most efficient way to store a text messaging (SMS) database

I'm creating a database to store incoming and outgoing text messages for a program that will be responding to text messages. The app has multiple potential responses depending on the message it ...