A type of integrity constraint used in a RDBMS platform to ensure that a value in a column matches one of a range of key values from another table.
2
votes
2answers
149 views
multivalued weak key in ER database modeling
I was wondering since i didnt find out any clarification for this.
I want to store movies that exist in different formats (dvd, bluray etc) and the price for each format differs from each other as ...
1
vote
2answers
80 views
Use single table with foreign key or two twin tables for text entries?
I have a table answers that has several columns including the content iself such as
ID | q_id | list_id | user_module_id | content | updated_timestamp
The content column is a varchar since we want ...
3
votes
1answer
173 views
Schema design: Use of association (aka: bridge/junction) table vs foreign key constraint with composite index containing a non-key field
This is an inventory database for IT assets. The models used are trimmed in order to focus on the problem at hand. Using SQL Server 2008. Thanks for taking the time to read and for any input you can ...
0
votes
1answer
23 views
Foreign key with multiple references
I have the following three tables in mysql database named "THE_COLLEGE"
mysql> desc students;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | ...
0
votes
1answer
50 views
best relationship for this design?
There is a table users with autoincrement primary key id.
There is also a table employees (every employee is a user but not vice versa). The employees primary key is userid. The field userid is not ...
0
votes
1answer
32 views
Refer to a table with all rows or to the table which restricts allowed rows?
There are some discounts:
CREATE TABLE `discounts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`value` decimal(4,2) NOT NULL,
`titleru` text COLLATE utf8_bin NOT NULL,
`titlehe` text ...
0
votes
1answer
76 views
Modify MySQL foreign key related column without dropping foreign key relation
I need to modify a foreign key related column. When I tried to alter it I got "Error on rename of 'x' to 'y' (errno: 150)" error. So I googled and found foreign key relation is the 'villain'. I ...
1
vote
0answers
39 views
Classes and objects (but not ORD)
I am looking for help laying out a database that stores information similar to a class definition and then also instances of those 'classes' (but not referring to an ORD). The specific example is ...
1
vote
0answers
84 views
Dealing with Invisible Referencers
Using Oracle database, suppose I have a parent table parent defined in schema A, and a child table child defined in schema B. To achieve this, schema A granted references privilege on parent to schema ...
0
votes
0answers
65 views
How to represent class table inheritance (current DBMS-specific way please)?
I want to implement class either-or table inheritance (Account, CatAccountDetails, DogAccountDetails) in SQL Server.
I found a recommendation for MySQL here (How do I map an IS-A relationship into a ...
0
votes
0answers
133 views
Consequences of multiple FK's from same column to multiple tables
I know it's possible to create multiple FK's to different tables using the same column, other than the performance hit caused by having a FK, are there any negative consequences of doing so?
...
0
votes
0answers
40 views
How can I make MySQL rework its foreign keys?
I somehow tricked MySQL into believing I have a foreign key that does not exist.
I had a table with both an Id column and a Number column. I wanted to merge the two, so I cleared the few tables ...