Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
2 replies
73 views

Table Schema Like in my picture. I have a Table that contains ID´s(fk). If i hover over one of them it shows me the Value. Then i have another Table that contains the ID from the previous Table. Is it ...
Marco ROKER's user avatar
Best practices
0 votes
5 replies
95 views

I'm developing a desktop application for gym management. One feature is a store for selling memberships and products. My client sometimes wants to sell something that is not in the inventory or ...
kitt51's user avatar
  • 11
6 votes
3 answers
209 views

I have a SQL Server database I mostly interact with using EF Core in a .NET project: I'll analogize my domain logic for simplicity. I have a Fruits table holding general fruit data in columns Weight, ...
Mr. Kloud7's user avatar
2 votes
3 answers
103 views

I don't particularly understand what's going on here, but it seems that super().get_queryset() doesn't do what I think it does? I have 1:N relationship, and the default FK reverse lookup works: >&...
Wayne Werner's user avatar
  • 52.3k
1 vote
1 answer
57 views

class Company(models.Model): note = models.TextField(_('note'), blank=True, null=True) class Meta: verbose_name = _('Company') def __str__(self): return f'{self.id}' Each ...
ORP's user avatar
  • 23
-1 votes
1 answer
140 views

I want to alter a table called mvp to add a column. When I run the alter statement, I get an index error: **ERROR 1553 (HY000):** Cannot drop index '<unknown key name>': needed in a foreign key ...
SMich's user avatar
  • 79
0 votes
0 answers
42 views

I am creating two tables called customer and item. For the customer table customerID is the primary key and for the item table itemID is the primary key. And I am creating another table which is ...
Charith Wirul's user avatar
-1 votes
1 answer
47 views

I am trying to add an index and a foreign key constraint to an existing table, each of which references a JSON expression. The ADD INDEX command below is working by itself, but the statement fails ...
Chris's user avatar
  • 141
1 vote
1 answer
36 views

In a Qt 6.8.2 Desktop application with SQLite I have two related tables: Table master id name 1 aaa 2 bbb Table details id idMaster value 1 1 foo 2 1 bar In my QMainWindow I have two QTableView and I ...
Mark's user avatar
  • 5,355
0 votes
2 answers
61 views

I am using @OneToMany and @ManyToOne in spring boot and when I try to save to the database (PostgresSQL) the foreign key is not saved. I tried to follow all the instructions and settings described but ...
Gianni Spear's user avatar
  • 8,048
0 votes
1 answer
122 views

I want to add a column of type TEXT, NOT NULL, with a DEFAULT value of empty string, which should reference a column in a different table. I can add foreign key references when creating a table. But ...
Martin's user avatar
  • 21
-2 votes
2 answers
77 views

I have two tables: Product Columns: Product ID (PK), Product Name Order Columns: Order ID (PK), Order Name I would like to store which Product Id for each order. Is it better to create another table: ...
developer's user avatar
  • 1,621
-1 votes
1 answer
50 views

am trying to run a Django site but have a error when i click on this url: 'book:genres' this is the error: Reverse for 'genre' with arguments '('',)' not found. 1 pattern(s) tried: ['genres/(?P<...
mangaka's user avatar
-1 votes
1 answer
45 views

I was creating a route finder and I created a vehicle model with relations start_location and final_location. I want them to be foreign keys as I don't want to have multiple options when selecting ...
nikhil gusain's user avatar
0 votes
0 answers
19 views

I have the following table: create table if not exists balance ( id integer PRIMARY KEY AUTOINCREMENT, exchange integer, FOREIGN KEY (exchange) REFERENCES exchanges(id) ); where the field ...
Tomas's user avatar
  • 60.2k
0 votes
0 answers
26 views

I have a form in which there are several fields with foreign keys. For example, the table "Entrance" (3 entries -> 1st entrance, 2nd entrance, 3rd entrance), "Apartment" (30 ...
Николай Евтеев's user avatar
0 votes
1 answer
409 views

I dont know why it's not working and I don't know where or what to look for honestly. I have the main table access_permits structure id permit_id type user_relationship_id vehicle_relationship_id ...
Abdulrahman Mushref's user avatar
-3 votes
1 answer
112 views

I am converting an ER Diagram I did into tables in SQL. How do I define my foreign keys? I tried two ways but the one where I am referencing does not run and the other doesn't work. create table ...
Brianna's user avatar
-1 votes
1 answer
75 views

How do I get unprocessed rows that have no association in Processed_Table with the least number of queries (SQLite 3)? Nested queries will work fine. Main_Table columns: Id Processed_Table columns: ...
Pankaj's user avatar
  • 81
1 vote
1 answer
115 views

In my psql script all foreign key references include the clause on delete cascade on update cascade, because the default is on delete no action on update no action: create table x ( y bigint ...
Code4R7's user avatar
  • 3,152
2 votes
1 answer
180 views

I encountered an issue while adding partitioning to Table1. Previously, this table had a primary key consisting only of the Id column, but when I added partitioning, I had to include AddTimestamp in ...
Ilya Murashkevich's user avatar
3 votes
2 answers
143 views

As the title describes I want to have a zero-or-one to zero-or-one relationship. For example, let's say we have two tables Calls and Files. A call might have an attached file on it, and vice versa. ...
pvarouktsis's user avatar
1 vote
1 answer
192 views

In the GORM documentation for reference and foreign key https://gorm.io/docs/belongs_to.html What does a foreign key do? what does a reference do? What is the difference between a foreign key and ...
Sepehr's user avatar
  • 67
2 votes
1 answer
160 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
-2 votes
1 answer
49 views

I'm new to learning Laravel 11, and I'm stuck with the (erno: 150 "Foreign key constraint is incorrectly formed,") and despite trying various suggestions I’ve seen, I still can't resolve it. ...
Lynelle's user avatar

1
2 3 4 5
263