Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
1 answer
86 views

I have implemented this code to add a check constraint after creating the table ALTER TABLE recruitment_data.candidate_experiences ADD CONSTRAINT chk_experience_dates CHECK ( ...
Beliz Yazici's user avatar
0 votes
1 answer
99 views

I want to make sure, that a column doesn't have a value that exists in another column of another table. It is kind of like a negative foreign key check, if you will. However adding a constraint doesn'...
Caulder's user avatar
  • 459
0 votes
0 answers
50 views

I Have 3 tables ProdVariant, Variant, VariantValues. ProductVariant ---------------------------- ProductVariantID PK ProductID FK NOT NULL VariantID FK NULL ...
Miff's user avatar
  • 15
1 vote
1 answer
248 views

Adding constraint using alter table dok add constraint dok_during_exclude EXCLUDE USING gist (pais2obj WITH =, during WITH &&) throws error ERROR: relation "dok_during_exclude" ...
Andrus's user avatar
  • 28.2k
-2 votes
2 answers
139 views

CREATE TABLE Oracle_All_DataTypes ( ID NUMBER(10) PRIMARY KEY, -- Unique identifier FirstName VARCHAR2(50) NOT NULL, -- First name must be provided LastName VARCHAR2(50), -- Last name is ...
Mohammad Saqlain's user avatar
1 vote
1 answer
87 views

I have 2 SQLite tables, users and transactions where a "transaction" happens between exactly 2 users. A short example would be: CREATE TABLE users( id INTEGER PRIMARY KEY ASC ); CREATE ...
Rares Dima's user avatar
  • 1,787
0 votes
1 answer
42 views

In PostgreSQL, I want a check constraint if column "Art" (this never is NULL) is == 'Typ 3' and three other columns either all NULL or all NOT NULL. My code fails for the first record having ...
StOMicha's user avatar
  • 481
-1 votes
1 answer
75 views

Can check constraint be used instead of pessimistic locks? Consider there is following table in SQL Server: create table Balances( id int, userId int, balance money) If more than 1 thread try to ...
user19291301's user avatar
1 vote
2 answers
78 views

I need a way to create either a validator or a constraint at model level to evaluate two or more fields to be able to be null/blank only if all of them are null/blank at the same time. For example, in ...
42WaysToAnswerThat's user avatar
0 votes
1 answer
144 views

I need to write test for a custom field with access to the database. The code is the following : class TestMyField (TestCase): def SetUpClass(cls): super().setUpClass() class MyModel(...
piscvau's user avatar
  • 23
1 vote
4 answers
142 views

A personal identity codes consist of a string of numbers that indicates the individual’s date of birth, an individualized string, and a control character. Example: 150600A905P • 150600 = Date of birth ...
Tien Huynh's user avatar
2 votes
1 answer
405 views

I have two variables in Stata which are string (MAIDCW1 and strboth). I would like to check for each observation whether the value of MAIDCW1 exists somewhere in the whole of strboth. If this value ...
user23332575's user avatar
0 votes
0 answers
96 views

This is the Table in SQlite: CREATE TABLE document( id TEXT NOT NULL, data TEXT NOT NULL, CHECK ( json_type(data, '$.documentLines.title') IN ('text') ), PRIMARY KEY (id) ) STRICT; This ...
rranke's user avatar
  • 33
1 vote
2 answers
77 views

I want to include a check constraint for my model in my members app where the sex field should be male, female or null. Here is my code: from django.db import models from django.db.models import ...
Canberk Ekinci's user avatar
-1 votes
1 answer
174 views

We don't have application running on server, so all the logic need to be done on Bigquery. I know Microsoft SQL Server have check constraint like: CREATE TABLE MyCleanJapanClient ( Phone varchar(...
少強甘's user avatar
0 votes
1 answer
66 views

I run the code and the results is always "no value " for all decision variables. In the conflicts tab it shows:"ct20#1#10#4, ct21#1#10#4,ct22#1#10#4)", but I stuck and do not know ...
Diem Nguyen's user avatar
0 votes
1 answer
96 views

I run my model in CPLEX using Constraint Programming for quite a long time, but it still has no solution so I have to stop the model. Is there something wrong with my model? I tried to run the model ...
Diem Nguyen's user avatar
0 votes
1 answer
133 views

This is a part of my Cplex code. I want to code the constraint below but it seems nonlinear constraints and can not run in CPlex opl. Can anyone help me deal with it? Here is the constraint ... int ...
Diem Nguyen's user avatar
0 votes
2 answers
76 views

When creating a constraint for a hierarchy I get an error, it doesn't let me make inserts I leave the code in case someone can give me a hand: CREATE TABLE JUGADORES ( Id_jugador NUMBER (4) ...
trex's user avatar
  • 21
-1 votes
1 answer
886 views

to check the phone number that it should be of the 10 digits , so how can i put the check constraint so that it will be validated i try using the simple technique but i guess it will check only the ...
Pranjal Jain's user avatar
1 vote
1 answer
442 views

What are the options for adding check constraints to columns in tables when using Liquibase? I have tried using the Liquibase checkConstraint attribute, but it doesn't seem to work, possibly because ...
ShipIM's user avatar
  • 13
1 vote
1 answer
23 views

I need to create a table for meetup with patientId, doctorId, the meetupdate and the type. And if the type is an IRM, I can't have another meetup if the last one as been less than 2 month ago. I need ...
Phobos's user avatar
  • 35
0 votes
1 answer
587 views

The aim is to insert a check constraint for the row titles, 'ppl_tshirt_size' that limits it to a few values (sm,med,lg,xl,xxl) but not an enum data type. What am I not understanding? Additionally, ...
Anonymous's user avatar
0 votes
0 answers
249 views

I tried to add a column to my table where the integer needs to be in between 01067 and 99998. But The problem is that I don't know how to specify the range of an integer in SQL, so I tried it with the ...
Fruit_alpha's user avatar
0 votes
1 answer
61 views

I'm creating a custom user-model where every user needs a company assigned, unless they are a superuser or staff. To accomplish this, I'm adding 3 CheckConstrains as seen below: class CustomUser(...
S.D.'s user avatar
  • 2,981
1 vote
2 answers
163 views

I have these entities in my business: class Team { public int Id { get; set; } public string Name { get; set; } public List<Member> Members { get; set; } } class Member { public ...
Daniel Jee's user avatar
1 vote
1 answer
100 views

We are using sqlite3 for a database and ensuring values inserted into a column matching a specific string would be useful in our case. Example: CREATE TABLE people ("firstname" TEXT), CHECK(...
leetbacoon's user avatar
  • 1,377
0 votes
1 answer
838 views

I'm trying to import database tables from a file of table definitions. Near the top, there is a line setting foreign_key_checks to 0, so that no errors would be thrown because of tables that ...
Magmatic's user avatar
  • 2,009
0 votes
0 answers
67 views

I'm trying to write a constraint to check whether a new entry in my table has an overlay with already existing entries. this is my code to add the constraint which doesnt work: ALTER TABLE tour ...
Erd4's user avatar
  • 1
0 votes
1 answer
514 views

Schema create table course (course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) check (credits > 0), ...
codelone's user avatar
  • 760
0 votes
1 answer
181 views

Similar to other questions asked but haven't found a normalized solution for TEXT[]: Postgres check constraint in text array for the validity of the values does not use another table as a check ...
M.Holmes's user avatar
  • 585
0 votes
1 answer
92 views

I want my attribute ID to start with the letters AB, followed by exactly 8 integers. And how would I do it, when I want it to start and end with defined letters? CREATE TABLE Table( ID TEXT NOT ...
helloworld's user avatar
0 votes
1 answer
735 views

I am using PostgreSQL 15.2; I can use both check constraints and triggers to ensure my business logic on database. I read some of the comparisons about them, and I still have a question: if we can use ...
Morteza Seydi's user avatar
2 votes
1 answer
84 views

The values of produce_prices must be < wholesaler_prices must be < retailer_prices. Can I apply check constraints for these to happen? The table is the following: CREATE TABLE `...
Tesfaye's user avatar
  • 21
1 vote
1 answer
490 views

I am trying to add a named CHECK constraint to a table in MariaDB. As far as I can tell from the documentation and a few samples scattered around, the following syntax shouyld work: DROP TABLE IF ...
Manngo's user avatar
  • 17k
0 votes
1 answer
61 views

A table in MySQL 8.0 where only one distinct combination of two values can exist. It can exist multiple times. Example: SQL Fiddle Is there a way to do this without triggers? UNIQUE CONSTRAINT won't ...
Tony Vlcek's user avatar
0 votes
1 answer
43 views

Working in MS Access 365 I am trying to set constraints on a table of appointment cycles. I was wondering how I can have the column CycleStartDate always be less than or equal to CycleEndDate; and ...
psycoperl's user avatar
  • 150
3 votes
1 answer
709 views

How to add a check constraint in django model that a field value startwith letter 'c' or 'e' or 'a' like the bellow SQL check constraint CREATE TABLE Account ( account_no varchar(12), ...
tjtharappel's user avatar
1 vote
1 answer
212 views

When I export my database from phpMyAdmin (quick method), it does not include CHECK constraints. However, when I run SHOW CREATE TABLE table, I see the constraints. Moreover, foreign constraints are ...
xerez's user avatar
  • 89
1 vote
1 answer
2k views

I can get the constraint name, the table name and the check_clause of the check constraints on a table using this query: SELECT tc.constraint_type, tc.constraint_name, tc.table_name, cc.check_clause ...
jmc42's user avatar
  • 454
1 vote
1 answer
1k views

I've started a new project using Prisma & Supabase but I'm facing an issue. I have some required String columns. Is there a way to prevent those columns to accept empty string value (''). Do you ...
BghinC's user avatar
  • 330
1 vote
1 answer
120 views

when is check constraint evaluated as per SQL 92 standards? create table a ( val INT ); create table b ( f CHECK ( f in (SELECT val from a)) ); a) Is CHECK with sub-query allowed as per SQL-92 ...
Khushit Shah's user avatar
2 votes
2 answers
335 views

I can't find how to check each element of an array-field in a table. Be like: create table tab ( day_in_mounth int[12] check ( *every array element* > 0 and < 30) ); values < 0 and > ...
Иван Павлов's user avatar
-1 votes
1 answer
52 views

I am attempting to create a table then add and modify it. Below is how I created the table. The other part is the first record I attempted to add to the the table that has given me the check constrain ...
nightowl898's user avatar
0 votes
1 answer
308 views

What I am trying to accomplish is to create a constraint on a postgresql table’s column which is of type jsonb. The constraint will check and ensure that at least one of the values is in a predefined ...
Catto's user avatar
  • 6,469
0 votes
1 answer
133 views

I am very new to SQL to apologize if this is a stupid question. I wanted to write a CHECK constraint requiring that a patient's medical record number, first name, and last name be entered. I believe ...
nancee's user avatar
  • 1
-1 votes
1 answer
48 views

Trying to build these tables and there's always an error or missing something, can someone help me? Where's max_mice i'm checking if it's inbetween those values and doesn't work why? Don't know what's ...
Miguel Ramalho's user avatar
-1 votes
1 answer
122 views

I have a column named "ppl". How do I make a constraint for this column that the data inserted got to have 5 characters and start with "ppl" (the next 2 characters got to be ...
Gaylord 's user avatar
0 votes
0 answers
46 views

This is my create statement. I need to make a photo_filename constraint for it to be case insensitive to accept and form of .jpg JPG, JpG, jpG, etc. CREATE TABLE P_PHOTO ( PHOTO_ID CHAR(5) NOT ...
love4mj789's user avatar
0 votes
0 answers
156 views

I have this table and i added a check to the column duree with this condition alter table operation modify Duree integer check(Duree>=2); but in the homework it's specified that it needs to be like ...
mohamed's user avatar
  • 15

1
2 3 4 5
15