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)

0
votes
1answer
26 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
95 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
59 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
198 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, debut ...
1
vote
0answers
53 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
17 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
53 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.
4
votes
2answers
209 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
35 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 tables,...
2
votes
1answer
129 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
557 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
141 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
32 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
22 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
12 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
92 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
44 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
258 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 ...
5
votes
2answers
214 views

Best data modelling approach to handle redundant foreign keys in relational model

I am looking for advice on the best relational modelling 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
25 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
122 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
94 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
137 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
62 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
32 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
55 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
90 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
28 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
44 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
58 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
133 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
125 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
40 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 ...
6
votes
3answers
294 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
80 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
84 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
37 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
162 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
85 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 ...
1
vote
0answers
39 views

Do relational databases typically understand '1' and '0' as booleans?

I'm working on a code library that helps users build database searches from form inputs (a layer on top of an ORM). I want it to be compatible with most relational databases. I currently have a ...
7
votes
2answers
143 views

What are the practical uses for relational calculus?

In my Database Design course we are learning both Relational Algebra and Relational Calculus. I can see where Relational Algebra could be useful since it is closely tied to SQL. Our professor said ...
1
vote
1answer
74 views

1NF vs BCNF cons and pros [closed]

I have a clue what 1NF and BCNF are, but I wonder why should someone prefer 1NF instead of BCNF? What are cons and pros with having relation in 1NF and BCNF?
10
votes
6answers
1k views

Explaining 2NF vs 3NF with an example

I have a problem with second normal form (2NF) and I have been unable to solve it by using Google. It is making me crazy because I am a teacher and I don't want to teach wrong stuff to my students. ...
1
vote
1answer
70 views

Converting table to a 2NF relation

I'm currently going through the process of learning about database normalization & having a crack at creating my first relational database. It was going well until I hit the following problem. ...
3
votes
2answers
239 views

Many-to-many relationship when one entity is without attributes

I'm interesting in mapping many-to-many relationship to relational model. I understand that the basic approach is to create a third table (associative entity) that connects the entities in many-to-...
1
vote
0answers
89 views

Sql query , please check whether my solution is correct?

Problem is: Consider the following relational schema: COURSES (cno, cname) STUDENTS (rollno, sname, age, year) REGISTERED FOR (cno, rollno) The bold attributed indicate the primary keys for ...
2
votes
1answer
125 views

One to many relationship on a junction table

I have two entity's - Workout and Exercise. These will have a 'many to many' relationship through the junction table WorkoutExercise. Things start to get complicated when I need to have a 'one to many'...
0
votes
1answer
64 views

I have a database design for an E-commerce website. Need to know how to display related product for each specific product

For example: A customer is viewing a product on the website, say a laptop. There's a section on the left where i need to display products from the database that are associated with this particular ...