For questions regarding the use of the relational model for databases.
Questions tagged [relational-model]
54 questions
52
votes
10 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…
![](../../users/profiles/199712.webp)
Jason Swett
- 38,405
- 60
- 193
- 322
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…
![](../../users/profiles/4593.webp)
Justin R.
- 21,845
- 21
- 102
- 147
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…
![](../../users/profiles/199712.webp)
Jason Swett
- 38,405
- 60
- 193
- 322
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: '',
…
![](../../users/profiles/2572325.webp)
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…
![](../../users/profiles/2147.webp)
Jason Baker
- 171,942
- 122
- 354
- 501
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…
![](../../users/profiles/4826671.webp)
dzhu
- 643
- 8
- 17
4
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
![](../../users/profiles/673167.webp)
notGeek
- 1,152
- 2
- 18
- 33
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…
![](../../users/profiles/125713.webp)
Markos Fragkakis
- 7,330
- 16
- 61
- 100
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…
![](../../users/profiles/62202.webp)
Louis
- 4,007
- 3
- 36
- 52
2
votes
6 answers
Broken referential integrity: What would Edgar Codd say?
I'm trying to understand rules of relational model as originally defined by Edgar Codd in 1970.
Specifically I'm interested whether referential integrity is part of his relational model or not. I'll try to demonstrate on following example (just to…
![](../../users/profiles/275.webp)
lubos hasko
- 23,934
- 10
- 52
- 61
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…
![](../../users/profiles/6105697.webp)
Magic code
- 45
- 5
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…
![](../../users/profiles/429921.webp)
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…
![](../../users/profiles/6537724.webp)
Aizaz Athar
- 71
- 6
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…
![](../../users/profiles/4826671.webp)
dzhu
- 643
- 8
- 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?
![](../../users/profiles/144904.webp)
nisnis84
- 199
- 1
- 2
- 7