On this site this tag applies to questions about Relational Model theory. The Relational Model for database management is an approach to managing data using a structure and language consistent with first-order predicate logic. In the Relational Model of a database, all data is represented in terms ...

learn more… | top users | synonyms (1)

3
votes
1answer
43 views

What process would you use to determine references on a database that has no integrity?

Imagine you inherit a database which has a bunch of tables, no documentation and zero referential integrity. Now you're trying to find out what are the various relationships between different tables. ...
0
votes
0answers
34 views

database constraint using trigger [closed]

I have modified my question as follows. I have created 3 tables as follows. create table s ( sno char(5), sname varchar(25), status int, city varchar(25), primary key(sno)); create table p ...
1
vote
1answer
46 views

Surrogate key resolution, or what am I missing in the Surrogate v Natural argument?

I've read a lot from both camps in the surrogate vs. natural key debate. What I am struggling to understand, and what seems to be glossed over, especially in explaining how surrogate keys are more ...
3
votes
1answer
57 views

Simple database structure advice

Newbie to dba. I'm creating a php/mysql inventory list and would like some advice before I start, on structuring my table(s) and database. The inventory database will eventually contain hundreds of ...
1
vote
0answers
50 views

ERD Diagram based on Crow's Foot model for Milky Way Jewelry

this was on my final exam this past winter exam season, in search for the answer since i got it wrong: Draw an ERD diagram based on the Crow's Foot model for a database to support the basic ...
0
votes
0answers
34 views

what would be the meaning of this ER Diagram and why? [closed]

If no other indication is given, what would be the meaning of this ER Diagram? (a) An Artist may record (0 or more) songs. (b) An Artist may record (1 or more) songs.
0
votes
1answer
22 views

If my understanding of BCNF is correct, how did we know that R1 was not in BCNF?

Given that R(ABCDE) AB->C BC->D CD-> E DE->A Since, B is the only attribute absent on the right-hand side, we would start with B. {B}+ = B . Not a CK. Next, we ...
0
votes
1answer
20 views

What should be the rule for excluding an FD from consideration while doing BCNF or any other Normalization?

Let us consider this example: http://www.mathcs.emory.edu/~cheung/Courses/377/Syllabus/9-NormalForms/examples.html At the first decomposition step, it is using A -> B C D E. On the next step, ...
1
vote
1answer
58 views

Should I look into alternatives to a relational database? [closed]

I am currently in the process of going through some PHP training with procedural code and will be doing a course in OOP with PHP right after that. The course will provide a solid starting point for me ...
0
votes
1answer
24 views

Name of ForeignKey Back Relation?

Table detail has a ForeignKey to table master. How to call the back relation? master has ??? to table detail I could not find a canonical word in wikipedia or other resources.
2
votes
1answer
72 views

Lossless join in 3NF

I was just studying about the 3NF and the BCNF and then encountered a statement that: 3NF ensures lossless decomposition while BCNF does not. How can we verify this using the basic definition of ...
3
votes
0answers
41 views

Is this ER Diagram correct?

Requirements: • Each customer has a name, a permanent address, and a social security number. • Each customer can have multiple phone numbers, and the same phone number may be shared by multiple ...
3
votes
0answers
44 views

Review the ER diagram regarding a National Football Team

We need to store information pertaining to football players who are or were members of the national team. For each player we store the following: first name, last name, date of birth, ...
1
vote
0answers
38 views

Review the ER diagram of a University

A database includes information pertaining to students, lecturers (scientists) and lectures. We store first names, last names and correspondence addresses for each person. A lecture is ...
1
vote
1answer
16 views

Meaning of the is unique clause here

Suppose I have two relations R and S and I execute the following query: Select R.* from R,S where R.a=S.a and is unique R What is the effect of the is unique clause here ?
1
vote
1answer
40 views

ERD to Relational schema

I'm new to DBM and I'm trying to learn it online. Honestly, I need some help with this. I don't know if I'm doing this right, and any help will be appreciated. This is my answer for i.
3
votes
2answers
82 views

Difference between an Entity and a Relation

I am currently reading about entities and relations and I can't understand the difference between them? According to Wikipedia we have an example of a relation like in the pic: This looks exactly ...
0
votes
1answer
33 views

Why repetition in join queries

Very dumb question, but bear with me, I am learning and am interested in the principles behind. So: I have a users table and a pages table. In this case, 1 user and 4 pages. If I join the two ...
2
votes
1answer
126 views

What would be the Candidate key (s) of this relation?

R(ABCDEPG) F={AB->CD, DE->P, C->E, P->C, B->G} To my consideration, the candidate keys are: AB, AG, CD, DE. Am I correct? Why or why not?
5
votes
2answers
460 views

Relation between first name and last name

I have some troubles understanding the relation between the a person's First name and Last name in a table. (In a Relational Model) I've read that the relation is of type: 1-1: They are linked ...
3
votes
1answer
133 views

IS-A relationship with only single sub entity

Hi I'm trying to design a database for a dictionary. The words has several fields like meaning, an example, and maybe a picture. but the words that are 'verbs' has three more special fields that the ...
1
vote
1answer
24 views

Collection of different types of data in a relational database

Let's say I have a table Cars (with columns such as model, make, year, etc.), a table Books (with columns such as name, author, ISBN, etc.) and a table Wines (with columns such as name, appellation, ...
0
votes
1answer
20 views

How to find functional dependancies from a relational schema?

If only given a schema (table header, with primary key indicated), how do i find functional dependancies? My problem is that would not functional dependancies depend on the data stored int he table, ...
0
votes
0answers
11 views

Schema of equijoin in relational algebra

Why does equijoin return a schema consisting of all attributes from both relations (including intersection) when equality between them have already been established? That is, we know that for any ...
2
votes
1answer
71 views

How to maintain Database audits?

I am using MySQL database (with Django ORM). I want to maintain the database audits similar to StackOverflow, Quora, Wikipedia, etc. These websites maintain the revisions of the changes in the ...
0
votes
0answers
38 views

How to map this ER model to actual tables?

Suppose we have an ER-design problem like this: A pharmaceutical company sells its products throughout a country. For the ease of sales, the entire country is divided into some Areas. Areas have ...
2
votes
2answers
54 views

Understanding relations

Since english is not my first language i find hard to understand this paragraph that i'm reading from "Database Fundamentals" book. I'm trying to figure out, in practice, real world, what this ...
2
votes
2answers
200 views

Relational Design - One table, two foreign keys or Two tables, one foreign key each

Looking for some advice related to optimal design in the following scenario. There is a Cases table (represents cases of inventory) There is a LocationInventory table (represents locations with ...
2
votes
2answers
112 views

Best data modeling approch to handle redundant foreign keys in relational model

I am looking for advice on the best relational modeling approach to store surveys, questions, and responses. I am looking for which of the two approaches below looks best, or an alternative approach ...
-1
votes
1answer
18 views

Basic relational algebra question

I'm new to this and have been given a database. I've been asked to write a Basic relational algebra formula which collects failed test results with a certain teacher and display the surname and code ...
0
votes
1answer
38 views

Two ways to define may-have-a (1..0-1) relationship

Today I have discovered for myself that may-have-a (1-0..1) relation can be implemented in two different ways. Let A be the "main" table (left side of ..) and B be the "linked" table (right side of ...
0
votes
0answers
58 views

Finding the closure and super keys of a schema?

I am working on a problem in which I have to look at the relation R with schema R(w, x, y, z), and the three functional dependencies: w -> z ; x,y -> w ;z -> y For every non-empty subset X of ...
4
votes
2answers
76 views

Best practice regarding concurrency for INSERT into a table with composite primary key?

Say I've got the tables users, teams and a teams_users junction table (team_ID, user_ID / composite PK). If I wanted to add a user to a team, what's the best option when it comes to performance / ...
0
votes
1answer
29 views

Storing shipping details in orders table

Have orders table and among columns the following: shipping type, shipping service provider, delivery type and shipping address. Let me explain what these are. User can choose between two shipping ...
1
vote
0answers
29 views

Relational Model

I would really appreciate if you could check my answer for a relational model question. I just started learning. So please bear with me and please guide me through the right process. Consider the ...
0
votes
1answer
32 views

Help with removing duplicate reversed pairs in relational algebra

I have a listing of data that contains duplicate reversed pairs and I need to remove them.. Call them, name1 and name2. Where I have Tom and Mike, and Mike and Tom, such that this single pair is being ...
1
vote
2answers
77 views

Is my db too big for my server? Should I go nosql or stick with relational db management? [closed]

I have a mysql database that is about 22GB in size and has multiple tables with hundreds of thousands of records, my biggest table has 1.8 million records. The Database was not professionally designed ...
0
votes
0answers
20 views

Calendar mult-data mult-request relations model

I have a table "USERS" I have a table "HOUSES" I have a table "CALENDAR" I have a table "TRANSACTIONS" I need build a schedule(CALENDAR) that relates to every home, every home has days available for ...
1
vote
1answer
28 views

Transaction Table in Personal Finance App

I'm a noob designing a Personal Finance App to teach myself Rails. This is just for learning purposes, but I actually intend to use it to replace my current system in Google Spreadsheets. I want to ...
0
votes
0answers
18 views

Database relation

Let's say I have 2 tables: A and B in relation one-to-one. CREATE DATABASE test; USE test; CREATE TABLE A ( a1 int, a2 int, Ab1 int, -- optional foreign key PRIMARY KEY(a1) ); CREATE TABLE B ( b1 ...
0
votes
1answer
36 views

How to create a one to one relationship

DROP DATABASE if exists test; CREATE DATABASE test; USE test; CREATE TABLE A( a1 int not null, a2 int, PRIMARY KEY (a1) ); CREATE TABLE B( b1 int not null, b2 int, PRIMARY KEY (b1) ); How can I ...
2
votes
1answer
113 views

Table to create Ids for one table to many table relationships

I have several tables that will represent an object that can be commented on. I would like to store all the comments in one table. To relate the other tables to the comments, I was thinking of adding ...
0
votes
1answer
92 views

How can I re-structure my activities table?

I've created a feed but I'm not sure whether it's okay or not, hopefully will get some answers to correct it if there's anything wrong. I'm using MySQL. When a user does something, his activity is ...
0
votes
1answer
36 views

Tuple calculus: unsure if my reasoning is correct

I'm currently working through a tuple calculus question and I ran into a situation where I have two answers that seem correct to me and I am unsure if my logic is wrong or if they are both correct ...
5
votes
3answers
198 views

If a table with a surrogate key has a column known to have unique non null values (eg SSN), does it violate 3NF?

As I understand it, third normal form (3NF) basically means there should be exactly one key. If a table with say an auto-increment id column also has a column known to be unique and not null, eg ...
0
votes
2answers
57 views

Making database tables 1NF

I am creating a database for a DVD rental shop, I have various entities that are related to this question, such as Film, FilmStar. For each film, you record its unique number, title, the year in ...
0
votes
1answer
79 views

Select all from A where attribute exists in B [closed]

I have a question involving relational algebra. Suppose I have two relations A and B, where B has a foreign key that references A. Using relational algebra, how do I select all tuples from A where ...
0
votes
1answer
29 views

Attributes in relation after cross product

I have a question regarding the resulting attributes in the cross product of two relations in relational algebra... Generally, the cross product will result in a relation whose attributes is the sum ...
3
votes
3answers
83 views

Primary key in resulting relation from union operation in relational algebra

I have a question regarding the resulting table/relation from a union operation in relational algebra. Does the resulting relation not have a primary key? Or does it return a table with a hidden ...
3
votes
1answer
77 views

How to remove unreferenced rows in a “Many to One” relation?

in my db i have the following entities: Cities, Persons, Houses. Each Person MUST live in a City. Each Person CAN live in a House. Each Person can change or leave their Houses. Persons living in ...