referential-integrity Questions

4

Solved

I've read some of Bill Karwin's answers about single table inheritance and think this approach would be good for the setup I am considering: Playlist -------- id AUTO_INCREMENT title TeamPlaylist...

2

Solved

Let's say I have 3 tables in a hierarchy: TableA -> TableB -> TableC TableC has a foreign key relationship with TableB, and TableB has a foreign key relationship with TableA. If i delete ...
Gussie asked 19/4, 2012 at 8:47

3

Solved

As in this question, I've been reading PoEAA and wondering if it's possible to defer referential integrity checks until commit in MySQL. I've run into this problem when wanting to insert a bunch o...
Botanize asked 16/2, 2011 at 9:32

2

Solved

I want to drop all the schemas in a mysql db, and I don't want to be bothered with referential integrity errors in h2 it's done like this SET REFERENTIAL_INTEGRITY FALSE; drop table if exists com...
Despinadespise asked 31/3, 2012 at 16:59

2

I am building a system that is a central repository for storing data from a number of other systems. A sync process is required to update the central repository when the other systems data is...
Rozanneroze asked 19/2, 2012 at 8:25

2

Solved

I'm new to PostgreSQL. I have tables like: CREATE TABLE Person ( ID SERIAL PRIMARY KEY, Name VARCHAR(32) NOT NULL DEFAULT '', Surname VARCHAR(32) NOT NULL DEFAULT '', Birthday DATE, Gender VA...

1

I have a table, with rows of events, and each one has (amongst lots of other fields) addedbyuser, editedbyuser, deletedbyuser There are INT, and refer back to the users table to a particular user. ...

9

Solved

We are planning on introducing simple Audit Trail in our database using triggers and separate history table for each table that requires auditing. For example consider table StudentScore, it has f...
Feeding asked 26/4, 2011 at 17:54

3

Solved

I'm looking for a simple way to limit an application configuration table to 1 row. I know I can do this with a virtual column containing a subquery, or a materialized view on top, but really it's a...
Cabasset asked 29/3, 2011 at 19:38

5

Solved

If I define a Customer and Order model in which a Customer "has many" Orders and the Order "belongs to" the Customer, in Rails we talk about Order having a foreign key to the Customer through custo...
Tirrell asked 29/5, 2009 at 22:30

2

Solved

I have a table, ProductSupportArticles: ProductSupportArticleID int NOT NULL <primary key> ParentArticleID int NULL ProductID int NOT NULL Title varchar(100) NOT NULL Content varchar(MAX) NO...
Astor asked 20/3, 2011 at 23:53

1

Solved

I've looked at the MySQL 5.1 docs, and still can't figured this out -- that being I noticed a difference between the code I input into MySQL and output code by the system. What is the difference b...
Maestoso asked 3/12, 2010 at 21:7

1

In the following table, is there a way to ensure PreviousID always references an ID in a row with a matching ParentID, or, if ParentID is null, it is also null in the referenced row? CREATE TABLE ...
Selfdefense asked 12/10, 2010 at 20:47

7

Frameworks like Rails have encouraged moving a lot of the logic, even stuff like constraints and foreign keys, off the database - in my opinion. for the better, as it's more manageable and easy to ...
Hydroelectric asked 31/8, 2010 at 11:57

11

Solved

One of the reasons why referential integrity should not be enforced is performance. Because Db has to validate all updates against relationships, it just makes things slower but what are the other ...
Courtneycourtrai asked 23/8, 2010 at 5:23

5

Is there a database out there that gives you the benefit of referential integrity and being able to use a SQL type language for querying, but also lets entities be loosely defined with respect to t...

6

Solved

I have a table with 3 columns: ID, PARENT_ID, NAME PARENT_ID has a foreign key relationship with ID in the same table. This table is modeling a hierarchy. Sometimes the ID of a record will chan...
Ibnsina asked 23/6, 2010 at 21:34

9

Solved

I'm designing a few applications that will share 2 or 3 database tables and all of the other tables will be independent of each app. The shared databases contain mostly user information, and ...

2

Solved

Consider a M:M relation that needs to be represented in a Cassandra data store. What M:M modeling options are available? For each alternative, when is it to prefer? What M:M modeling choices have ...
Furring asked 4/4, 2010 at 0:8

4

Solved

I'm trying to implement a tree like structure using a Materialized Path model described here: http://www.dbazine.com/oracle/or-articles/tropashko4. Is it possible to enforce referential integrity ...

5

Solved

I understand the need to have referential integrity for limiting specific values on entry or possibly preventing them from removal upon a request of deletion. However, I am unclear as to a valid us...

3

At present we have very little referential integrity, as well as having a number of tables that self-join (and indeed would perhaps better be represented as separate tables or views that joined). ...
Dubonnet asked 3/12, 2009 at 11:42

4

Solved

I recently read in Fowler's PofEA that some database engines allow you to defer RI checks until the end of the transaction. Is this possible in SQL Server? The problem comes with some scenarios wh...
Jewess asked 25/8, 2009 at 18:15

1

Solved

I'm piecing together an image website. The basic schema's pretty simple MySQL, but I'm having some trouble trying to represent possible admin flags associated with an image ("inappropriate", "copyr...
Traynor asked 14/1, 2009 at 5:16

38

I remember hearing Joel Spolsky mention in podcast 014 that he'd barely ever used a foreign key (if I remember correctly). However, to me they seem pretty vital to avoid duplication and subsequent ...

© 2022 - 2024 — McMap. All rights reserved.