Questions tagged [relational-model]

For questions regarding the use of the relational model for databases.

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…
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…
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…
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: '', …
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
  • 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…
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
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…
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…
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…
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…
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…
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
  • 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?
nisnis84
  • 199
  • 1
  • 2
  • 7
1
2 3 4