For questions regarding the use of the relational model for databases.
Questions tagged [relational-model]
56 questions
68
votes
11 answers
Unique key with NULLs
This question requires some hypothetical background. Let's consider an employee table that has columns name, date_of_birth, title, salary, using MySQL as the RDBMS. Since if any given person has the same name and birth date as another person, they…

Jason Swett
- 43,526
- 67
- 220
- 351
20
votes
7 answers
Procedurally transform subquery into join
Is there a generalized procedure or algorithm for transforming a SQL subquery into a join, or vice versa? That is, is there a set of typographic operations that can be applied to a syntactically correct SQL query statement containing a subquery that…

Justin R.
- 23,435
- 23
- 108
- 157
13
votes
9 answers
Does every table really need an auto-incrementing artificial primary key?
Almost every table in every database I've seen in my 7 years of development experience has an auto-incrementing primary key. Why is this? If I have a table of U.S. states where each state where each state must have a unique name, what's the use of…

Jason Swett
- 43,526
- 67
- 220
- 351
8
votes
3 answers
RelationalModel relation field at NULL after job's done
I got a wtf problem that I can't figure out. I explain :
I have a model named Product :
var Product = Backbone.RelationalModel.extend(
{
urlRoot: Backbone.rootApiUrl + '/products',
defaults: {
id: '',
name: '',
…

gjdass
- 146
- 7
7
votes
9 answers
Why are positional queries bad?
I'm reading CJ Date's SQL and Relational Theory: How to Write Accurate SQL Code, and he makes the case that positional queries are bad — for example, this INSERT:
INSERT INTO t VALUES (1, 2, 3)
Instead, you should use attribute-based queries like…

Jason Baker
- 192,085
- 135
- 376
- 510
5
votes
3 answers
How to generate Relational Model from UML Class Model?
Does anyone know an application (Enterprise Architect, ...) that allows mapping from UML Class Model to Database Relational Model automatically? How?
Thanks

notGeek
- 1,394
- 5
- 21
- 40
5
votes
3 answers
Relational data modeling for sub types
I am learning the Relational Model and data modeling.
And I have some confusion in my mind regarding sub types.
I know that data modeling is an iterative process and there are many different ways to model things.
But I don't know how to choose…

dzhu
- 793
- 1
- 9
- 17
3
votes
1 answer
Relational design scenario: restrict children relations
please consider the following scenario. An pet owner may have multiple cats, and may also have multiple dogs. Some of the dogs are related (ie they fight :-) ) with some of the cats of the same owner.
The following relational design does not impose…

Markos Fragkakis
- 7,499
- 18
- 65
- 103
2
votes
5 answers
Circular database relationships. Good, Bad, Exceptions?
I have been putting off developing this part of my app for sometime purely because I want to do this in a circular way but get the feeling its a bad idea from what I remember my lecturers telling me back in school.
I have a design for an order…

lsl
- 4,371
- 3
- 39
- 54
2
votes
0 answers
ER: Converting a ternary 1:1:1 to relational model
Suppose A, B, C have the keys id(A), id(B) and id(C). I want to represent the ternary relation in the relational model, i was following the algorithm from the book "Fundamentals of Database Systems (7th edition)" (Chapter 9.1.1, step 7):
The…

Magic code
- 45
- 7
2
votes
0 answers
Prototype machine whose complete design is based on the relational model
In the Preface to Ted Codd's The Relational Model for Database Management, Version 2, he writes (first paragraph):
Today, if you have a well-designed
database management system, you have
the keys to the kingdom of data
processing and decision…

user429921
- 309
- 1
- 10
2
votes
1 answer
Does Azure Offline Sync deals with relational tables?
I have made two table one is User and the other one is Todoitems. Todoitems are created against a specific user id but when i try to fetch them using linq query in RefreshItemsFromTableAsync() function, it compiles successfully but gives error on…

Aizaz Athar
- 71
- 7
2
votes
3 answers
What is Relational Integrity
In the question How to Set Up Primary Keys in a Relation, PerformanceDBA talked about Relational Integrity and pointed out that it is different from Referential Integrity.
I have heard of Referential Integrity, which is related to Foreign Keys.
But…

dzhu
- 793
- 1
- 9
- 17
2
votes
2 answers
Can a superkey include things that aren't part of the primary key?
Can a superkey include things that aren't part of the primary key?

nisnis84
- 229
- 1
- 4
- 7
1
vote
1 answer
representing doors in ER schema
I have something like this in my ERD.
Note that there can be two rooms connected by more than 1 door.
Translating this in tables I get that every couple door-room is repeated twice (One time as entry and another time as exit). So I simplified my…

BurningOceans
- 11
- 2