Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
52 views

I have two GridDB Cloud containers participating in a one-to-many relationship. The tables layout is shown below: Table Customer (collection container) Name Type Nullity Key Customer_ID INTEGER NOT ...
Danilo Silva's user avatar
0 votes
0 answers
43 views

I heard that referential integrity can be assured for one table and two tables relatively easy when generating synthetic data. With referential integrity, I e.g. mean the fact that 'London' is ...
henk van doorn's user avatar
2 votes
1 answer
165 views

I'm trying to create a generated field that is also a foreign key to another table, while maintaining referential integrity at the database level. Basically, I'm trying to have the same effect as the ...
BlackHack's user avatar
0 votes
2 answers
115 views

lets say I have table A and table B. Table B is the child table and has a foreign key to table A. I have other mirrored tables, lets say table C(mirror for table A) and table D(mirror for B). Both ...
fernando1979's user avatar
  • 1,959
-1 votes
1 answer
260 views

I am trying to drop a table: drop table if exists bronze.LawAggregatedPipelineSummary; go But there is an FK constraint on it: Could not drop object 'bronze.LawAggregatedPipelineSummary' because it ...
WestCoastProjects's user avatar
0 votes
1 answer
165 views

Consider a basic relational pattern (one parent, multiple children) As part of a transaction, I may delete parents, but I may also re-insert them. In the first case, I want the foreign key to become ...
Jeff's user avatar
  • 602
1 vote
0 answers
71 views

I would like to create a database constraint that would disallow all of the child records from being VOIDded. For any given Transaction there can be many work orders. I want the database to prevent ...
Mark H's user avatar
  • 11
0 votes
1 answer
279 views

I need to change the column type of all primary keys in all tables to the UUID format. How do I migrate without triggering the foreign key checks? I have tried the following 2 things below, but both ...
TomDogg's user avatar
  • 3,964
0 votes
0 answers
35 views

I have a table of people and another deliverers holding details of how deliveries are made. Most deliveries are made by someone in the people table so there is a peopleId which points to the people ...
liz's user avatar
  • 19
0 votes
0 answers
111 views

I don’t understand how to deal with schema changes and function definitions (which are by nature strings). For example, if I have a table called tablename1 and/or a column called columnname1, and ...
Andy's user avatar
  • 1,406
0 votes
1 answer
178 views

It is sufficient documents about how to set foreign key, but few about how to set with compound primary/foreign key. I run following commands and the last 2 reported `length. How to set it correctly? ...
Xavier Z's user avatar
  • 402
2 votes
1 answer
70 views

Let us assume the following as the user flow in a multi tenant application with each tenant having its own set of catalogs or share a common catalog. User logs into the application and see UI with ...
Gopi's user avatar
  • 5,927
0 votes
1 answer
90 views

i hope you can help me with a general question about referential integrity. If i am deleting data in a table that is referenced to another table as a foreign key. How can i delete the data without ...
David Unger's user avatar
0 votes
2 answers
62 views

I have a recursive function like below function dfs(row, col) { if (grid[row][col] === 0) return true; let result = grid[row][col] === 2; grid2[row][col] = 0; let up = down = left = right = ...
DrinkPractical9526's user avatar
1 vote
1 answer
668 views

I am using Django 3.2. Backend database used for testing: sqlite3 I have a model Foo: class Foo(models.Model): # some fields ... some_count = models.IntegerField() class Meta: ...
Homunculus Reticulli's user avatar
0 votes
2 answers
857 views

I have problem with Enforcing Referential Integrity to a new table. There are different tables in different schemas, each one has its primary key: schema1.table1 schema2.table2 schema3.table3 I want ...
eathan's user avatar
  • 33
0 votes
0 answers
243 views

I tried every solution I can find for this and non of them worked. To explain: I'm trying to update a primary key code_class in the table classroom. This key is also a foreign key in the reservation ...
Oumnia Rana SEGUENI's user avatar
1 vote
1 answer
114 views

Hi everyone I created this table for a database CREATE TABLE IF NOT EXISTS compositions ( id INTEGER PRIMARY KEY AUTOINCREMENT, id_product INTEGER REFERENCES products(id), ...
giovanni sergi's user avatar
0 votes
0 answers
219 views

I have Java code that extracts metadata from a JDBC connection. One of the calls is to extract the imported keys. The database has the RI created, but is disabled. Is there a way to extract the ...
Loren Cahlander's user avatar
-1 votes
2 answers
2k views

I have a small table, below is a screenshot: There is a parent node which references back to the ID. Every row had a parent except the home page (for obvious reasons). Here's the code with some bits ...
John Ohara's user avatar
  • 2,911
-5 votes
1 answer
238 views

Is there a way to enforce referential integrity without foreign keys? Is there a way to achieve what I am trying to do below with alter table statement? ALTER TABLE no.Man WITH CHECK ADD CONSTRAINT ...
LifetimeLearner4706's user avatar
0 votes
1 answer
476 views

Create the following tables: Customer KNr (primary key) Name (at most 15 characters) City (at most 10 characters) Country (at most 10 characters) Balance (Type FLOAT) ...
Mary Star's user avatar
  • 385
1 vote
1 answer
669 views

I have the following two tables in SQLite: CREATE TABLE `Link` ( `link_id` integer NOT NULL, `part_id` integer NOT NULL, CONSTRAINT `link_pk` PRIMARY KEY(`link_id`,`part_id`) ); CREATE ...
byteit101's user avatar
  • 4,020
1 vote
1 answer
44 views

I'd like to express: "insertion of record with 'parent' value that is not included in 'rowid' AFTER INSERTION is forbidden." My intention is to keep the table internally consistent as a ...
Raoul's user avatar
  • 1,902
0 votes
0 answers
363 views

I have some CHECK constraints that all depend on a unique user defined function. They all look like this: ALTER TABLE t_adresse ADD CONSTRAINT chkAdresse_PaysCode CHECK(LibelleCodeMatch('PAYS', ...
Ludovic Aubert's user avatar
1 vote
1 answer
78 views

I have a question about a trigger that I would like to create and I am not sure how to do this. I have a table, 2017_state_data, and it contains some financial metrics per state along with said state ...
user avatar
1 vote
1 answer
1k views

I have one table OBRAZAC Columns are: JIB_OBRASCA JIB_NARUDZBENICE TIP_NARUDZBE IME_ZAPOSLENOG PREZIME_ZAPOSLENOG JIB_KLINIKE NAZIV_ODJELJENJA Depending on the value in column TIP_NARUDZBE which can ...
mIl3's user avatar
  • 13
0 votes
1 answer
1k views

I have a table where records have a (begin, end) time window of existence (for things like employement duration, birth and death, rent duration, ...) begin IS NULL or end IS NULL if there is no bound. ...
Ludovic Aubert's user avatar
0 votes
2 answers
235 views

I am attempting to insert data into two tables, the latter of which references the former. Something like: CREATE TABLE foo (foo_id bigserial primary key, name varchar) CREATE TABLE bar (bar_id ...
GoTodd's user avatar
  • 73
0 votes
2 answers
181 views

When a user tries to delete a code/validation record, I would like to check to see if the code in that record has been used prior to the deletion attempt so I can display a message that is more ...
LG-C's user avatar
  • 47
1 vote
0 answers
123 views

My predecessor built our database with some "overloaded" child tables that are shared by multiple parents, using a "tabletype" column that specifies which parent table is the ...
mempie's user avatar
  • 11
1 vote
1 answer
653 views

For example, let say DB has foreign key A.b_id -> B.id with SET NULL on delete. If record with some B.id get deleted, all b_id references will be set to NULL. But if A already contains record where ...
Oleg's user avatar
  • 111
0 votes
2 answers
2k views

I have a parent record in my people table, but when trying to insert a matching record in my employee table, I get a integrity constraint error. Can anyone explain what is wrong?
Space Turtle 84's user avatar
-1 votes
1 answer
173 views

I've had some behavior in MS Access 2019 that surprised me and I've boiled it down to the following: I've got two tables with a different number of records: I need to establish an outer join between ...
NewSites's user avatar
  • 1,849
-1 votes
1 answer
2k views

I am creating two tables each having one primary key column and another column that is used to link both tables using a foreign key. create table t1(a number not null primary key, b ...
Atharva Singh's user avatar
1 vote
2 answers
323 views

I'm trying to design a database structure that allows me to extract common fields into one table called "entity". You could think of "entity" as an abstract class. Every "...
Felix's user avatar
  • 2,406
0 votes
1 answer
353 views

During a practical interview exercise on databases I was given 2 files in CSV one for drug dispensation showing unique instances of patient (the patient_id column is unique) accessing medicine with ...
Andrewchi's user avatar
1 vote
1 answer
96 views

My problem is fairly simple. I was been given around 95% of a fairly large, working data set. And I wrote out a parser, set my data out into CSVs, wrote my bulk loads, and have everything set up save ...
robinspi's user avatar
  • 103
-2 votes
1 answer
426 views

I have a table [Advertiser] and a table [Ad] that has a N..M relationship that an Advertiser can have many Ads so that [Ad] will have a column referncing [Advertiser]. An Advertiser can either be a ...
shurda's user avatar
  • 65
0 votes
0 answers
199 views

This is my model, made with classical mapping, classes A and B are working accordingly import sqlalchemy as sa from sqlalchemy.orm import mapper, relationship from domain.a import A from domain.b ...
BugliL's user avatar
  • 950
0 votes
0 answers
287 views

I created table A and table B I am using SQL Server and I got this error message: Msg 3726, Level 16, State 1, Line 4 Could not drop object 'a' because it is referenced by a FOREIGN KEY constraint. ...
KIM HYUNG JUN's user avatar
0 votes
0 answers
37 views

i have created function like below, but showing error. any ideas are welcome. CREATE FUNCTION `CheckFunction`() RETURNS varchar(36) BEGIN RETURN (select DISTINCT column from table); END Error: Error ...
BalajiAWS's user avatar
  • 137
0 votes
1 answer
262 views

I cannot seem to figure out why my PK and FK of the same exact type are not linked in Laravel. Both tables are InnoDB. The foreign key in the second screenshot shows that I can enter any integer even ...
KD_Raj's user avatar
  • 345
1 vote
1 answer
40 views

Say I have two long lists a and b and want a list c: a = [obj1, obj2, ..., objN] b = [objNplus1, objNplus2, ..., objNplusM] c = a + b How can I create a new list that shares the previous ones as its ...
dawid's user avatar
  • 794
-1 votes
2 answers
809 views

I have a data model for Tasks and Equipments. Sometimes a Task needs some Equipment to be completed, sometimes it doesn't. Task table create table task ( id serial primary key , task_name ...
gmwill934's user avatar
  • 638
0 votes
1 answer
47 views

I have a general design question. Consider these 3 tables: Table Restaurants: RID pk auto_increment etc... Table Vacations: VID pk auto_increment etc... Table Movies: MID pk ...
Yanay Lehavi's user avatar
0 votes
0 answers
154 views

First of all, I hope whoever reads this is well at these difficult times. I am trying to code a database using MariaDB/MySql that can manage inventory and groups of business transactions. I have an ...
andrew duddy's user avatar
-1 votes
3 answers
2k views

1 create table pointofinterest( 2 pointid number not null, 3 describe varchar(30), 4 opentime varchar(30), 5 closetime varchar(30), 6 townid varchar(30), 7 constraint pk ...
SP45's user avatar
  • 15
0 votes
2 answers
197 views

I am having a hard time getting a relational model out of my project's requirements. The general context is about devices posting sensor data. In the table representations, the PKs of each table ...
Giannis Tsimarakis's user avatar
-1 votes
1 answer
681 views

I am working on appending some additional data from an Excel spreadsheet to an existing Microsoft Access database. The primary key is "RecordID", however, when I go to create the one-to-one ...
CeenCat's user avatar

1
2 3 4 5
8