I'm designing a domotic system database and I'm trying to figure out how to represent two foreign keys.
This is the cardinality I want. Consider 1...N Areas (rooms, halls, kitchens, etc.):
Area 1 - ...

At work I use a rather old MS Access database which defines some relations between tables, but does not outright define all of them. If the database application used an ORM, I would think that this ...

I am having a problem with foreign keys between two tables. I am trying to model a relationship between members of a club and their relatives. This is a straightforward many-to-one relationship, with ...

I have some csv formatted table dumps and loaded those into a new database with the tables defined by a DDL script from the source database (both acquired by somebody else so I cannot have a look at ...

It seems like I have been bitten by the first bug described in the release notes of postgresql 9.3.4: http://www.postgresql.org/docs/devel/static/release-9-3-4.html
I now have e.g. duplicate primary ...

I am working with a 'lookup' style table that is already in place, which has a compound primary key (not my design) in Microsoft SQL Server 2012. I want to add a foreign key to it in another table, ...

Background: I'm a programmer who, while had to work with simple databases several times, never had to work with complex ones. I.e. I'm proficient with basic stuff, but clueless about advanced features ...

This is the first database I set up so I apologize if my problem is something obvious.
I'm playing around with my table design and tried to create some link tables with FKs to avoid redundant data. ...

In my noob opinion, it strikes me that in a serialized environment, this shouldn't be a problem.
Is that correct? If not, please explain to me why a foreign key's behavior on a non-unique column is ...

I'm having trouble understanding Postgres's CASCADE DELETE behavior.
If table_A REFERENCES table_B, and the column referenced could have multiple instances of the same value, will the table_A row be ...

In Mysql 5.5, I have a table, in which I store some informations about "events".. In order to have a chronological order, I made two columns that reference to the previous and to the next event. So I ...

I have following tables:
class_table (class_id = Auto Incremented Primary Key (AIPK) of this table)
user_table (class_id, user_id (AIPK of this table))
course_table(class_id, course_id (AIPK of this ...

I'm using an orm framework that handles data (and its integrity) on top of mysql. So far I ignored foreign keys because the orm handles that just fine.
I recently read that foreign keys can enhance ...

Hi there I am fairly new to sql development. I am current following the head first into mysql book and is on chapter 6. On chapter 6 there is a table in third normal form but it does not contains the ...

Suppose the ASCII tree below is a UML generalized concept model. To represent these entities/classes in UML, lets assume [mammal] a super class, and the level 1 classes, [wild] and [domestic] are sub ...