Skip to main content

Questions tagged [referential-integrity]

Facilities provided by a database management system to ensure consistency within the data.

2 votes
1 answer
410 views

I'm currently in a battle with Entity Framework over trying to make a self-referencing relationship without having to add additional columns/properties. I have confirmed the foreign key I envision is ...
Logarr's user avatar
  • 153
2 votes
1 answer
253 views

I am trying to create a scheduling application, and part of it requires the date range of a row to be within the date range of a row in another table, which it is referencing via a foreign key. Note: ...
lucifer34's user avatar
1 vote
1 answer
2k views

I am drawn to this design like a moth to a flame. I've read rumblings that cyclic foreign keys are a nightmare. Generally, I can see why they should be avoided. In this particular case, however, I don'...
untitled90's user avatar
1 vote
2 answers
87 views

Let's say we decided to split user table in two, one will have data related to authentication, another basic user description: user_table user_id | name 1 | Max 2 | Alex 3 | ...
ZiiMakc's user avatar
  • 147
0 votes
1 answer
59 views

I have to design an ERD for a hypothetical scenario. In the scenario, the nurse at a rural clinic needs to get summary data regarding patient visits so she can reschedule canceled or no-show visits. ...
LNicole's user avatar
2 votes
0 answers
61 views

To be clear, I mean to ask this question from a strictly "Data Modelling and database-design, including referential-integrity" PoV. I am currently designing a database that will serve as an ...
Him's user avatar
  • 133
1 vote
0 answers
467 views

I have two tables: ObjectContainer containerID INT NOT NULL PRIMARY KEY mainObjectID INT NOT NULL FOREIGN KEY REFERENCES Object (objectID) Object objectID INT NOT ...
Xudla's user avatar
  • 11
2 votes
1 answer
82 views

Let's say I have the following tables describing some vehicles CREATE TABLE class ( id INT GENERATED ALWAYS AS IDENTITY, label TEXT NOT NULL, PRIMARY KEY (id, label), UNIQUE (id) ); CREATE ...
rdbisme's user avatar
  • 121
3 votes
2 answers
2k views

In Postgres, I have an existing table: things thing_id thing_name destination_id 10 thing 10 null 15 thing 15 null For each row in that table, I want to add rows to two new related tables one of which ...
Robert Elliot's user avatar
0 votes
1 answer
366 views

After renaming some tables I get the following error: MariaDB [testdb]> INSERT INTO user_events (date, uid, operation, info) VALUES('2022-09-15','xyz','create',NULL); ERROR 1452 (23000): Cannot add ...
loris's user avatar
  • 103
1 vote
1 answer
1k views

I have 2 tables. First table is parent COLLECTIONS_OF_MAPS id title 50013 Geological Map Series 50014 Climate Map Series Second table is a child (but whilst describing map layers, it also has entries ...
Vidar's user avatar
  • 157
0 votes
0 answers
71 views

In order to perform functional decomposition of a "big blob" of a database the first step we wanted to take is to separate different modules of the database into separate schemas on the same ...
Joe DiNottra's user avatar
7 votes
2 answers
2k views

Problem statement I have a table with a column whose values are foreign keys, but the target table of the foreign key differs from row to row. The relevant table can be determined from the key value ...
wchargin's user avatar
  • 171
0 votes
2 answers
280 views

I have two tables, a parent and child table, which have referential integrity declared between two tables and try to move both the tables so I can delete rows. I start with the child table and the ...
Pugzly's user avatar
  • 105
0 votes
3 answers
589 views

I have two tables mutually referencing each other, and I get this error when trying to insert into one of them: "Foreign key constraint is incorrectly formed". I have been stuck for three ...
Jonathan Davis's user avatar

15 30 50 per page
1
2 3 4 5
9