Why are postgresql tables empty although filled when starting Testcontainer?

Tags: , , ,


I am using Testcontainers 1.15.2 (using postgres image 13.2-alpine) with Spring Boot 2.4.3. The Testcontainer is started using an init script which starts with a type definition, a table creation and ...

Tags: oracle sql

(Error) ORA-02270: no matching unique or primary key for this column-list

Tags: ,


I have the code below and I'm running it step by step: CREATE TABLE registration ( constraint pkks primary key (cod_class, number_rgm), cod_class NUMBER(8), number_rgm ...

Writing SQL Queries Workbench

Tags: , ,


I'm having some trouble with writing this query. This is what I have so far: Find the name of the customer that deposited the highest amount with one transaction (include the transaction amount). ...

Tags: sql

Find difference in quantity column of two tables

Tags:


Suppose I have two tables, with a item name and quantity: Table 1 Item Name Quantity a 10 b 15 c 2 Table 2 Item Name Quantity a 45 b 2 I want to find the difference in quantity of items from ...

Query Java doesn’t execute

Tags: , , ,


I'm trying to execute a query on eclipse at my Java program, but it always exit with a exception and don't execute the query, I read a lot of posts here but no one of them could help me with this. ...

Merge not inserting new values

Tags: , , , ,


I'm trying to use MERGE to insert new values to a table only if they don't already exists in the same table. This is the query I am using: MERGE [dbo].[TARGET_TABLE] AS Target USING (SELECT [NAME] ...

ORDER BY DECODE: Decode won’t reorder the days like I want it to

Tags: , , ,


I've got an assignment where I need to return a certain report and then order it by the day, but I need Monday to be day #1 (by default, Sunday is day #1 in SQL). Here's my code for the report and the ...

Oracle 10g sql query

Tags: , ,


I have some data like this ↓ T_ID T_PERIOD T_COUNT T_SUM T_UPDATE_COUNT 1 2013-2014 3436 20118043 0 2 2014-2015 4298 27101356 0 3 2015-...

Tags: sql sql-server

How to filter the record based on two columns in sql

Tags: ,


i have a table with 2 columns and i wanted to filter the records where column1 in (Hierarchy,Single) and column2 in ('Relate', 'NoRelate'). but not return the record when Column1 = Single and Column2 =...

Regexp search SQL query fields

Tags: , ,


I have a repository of SQL queries and I want to understand which queries use certain tables or fields. Let's say I want to understand what queries use the email field, how can I write it? Example SQL ...