Questions tagged [rdbms]
A relational database management system (RDBMS) is a database management system (DBMS) in which data is stored in tables and the relationships among the data are also stored in tables.
2,800
questions
0
votes
0
answers
49
views
The installed version of Bison, /c/Program Files (x86)/GnuWin32/bin/bison, is too old to use with PostgreSQL
I am trying to run PostgreSQL in my windows laptop using its source code by cloning its repo from Github.
For this I am following this documentation
But while trying to run ./configure command I am ...
-1
votes
0
answers
25
views
Is this a partial dependency or a transitive dependency?
I have the relation R on {A,B,C,D,G,H,I} and functional dependencies {AD->C, C->BGI, AC->H}.
I have determined the candidate key is AD.
Does this make AC->H a partial dependency or a ...
0
votes
1
answer
9
views
Can an Identifying relationship be one-to-one?
Let's take an employee entity set. Employees purchase insurances to cover one dependent. We wish to store Name and Age of the dependents. If the employee can one name only one dependent, the ...
-1
votes
0
answers
27
views
ERROR 1822 (HY000) I am trying to create table with PRIMARY_KEY composed of three values
I need to use MAINTENANCE_TYPE_ID as the PRIMARY KEY.
CREATE TABLE MAINTENANCES
(
CAR_ID CHAR(5),
MAINTENANCE_TYPE_ID CHAR(5),
MAINTENANCE_DUE DATE,
PRIMARY KEY (CAR_ID, MAINTENANCE_TYPE_ID),
FOREIGN ...
-1
votes
0
answers
22
views
Why conflict serializability in database schedules is called "Conflict - Serializability"? [closed]
Definitions say conflict serializability in database schedules is called that because
A concurrent schedule is conflict serializable if it can be transformed into a serial schedule by swapping its ...
0
votes
0
answers
16
views
Dax measure to get 2 columns from different tables into one
I have 5 tables;
member : 1 to many relation with product and cash transactions.
product : 1 to many with product transaction history.
cash transactions: many to one with date.
product transactions: ...
0
votes
0
answers
8
views
How to create new db instance based on trigger caused by insertion of record in a particular DB's table? (Any DB)
Looking for solutions in any database? Relational or NOSql
Example,
DB Name -> administration
Table Name -> Students
Record Inserted ->
Name -> Kramer
Roll -> 1
New DB Created -&...
-1
votes
0
answers
13
views
I am storing pivot in a table. But before rendering the result I want match the result with a column from table which is not there in pivot result [closed]
I have table sales which has columns like store location, sales and managerId.
In crosstab I'm using store as an row identifier location as category column and sales as a value column.
I am storing ...
0
votes
0
answers
36
views
Reading data from PostgreSQL backup directory
Let's say I have a backup directory containing PostgreSQL data from some other system. By default, the data is stored at /var/lib/postgresql. After changing the default data directory to the path of ...
1
vote
1
answer
43
views
Representing collections of set partitions in a relational database
I have a set of elements. There are various ways I would like to partition the set, in the mathematical sense. A partition is defined as a collection of subsets such that every element is in exactly ...
0
votes
1
answer
63
views
Why does Postgres return same ctid values for different rows across multiple tables?
My understanding of ctid was that it returns the physical location of the row on disk by giving page_id and the offset in that page where the particular row / tuple is stored. But when try to fetch ...
0
votes
0
answers
58
views
Allocation of user calls to VPs on Informix RDBMS
A problem I'd like discuss brings me trouble for some time now. There is a lot of articles addressing how to optimize Informix RDBMS in general but very little (or no at all) about a problem I'd like ...
1
vote
0
answers
51
views
What is missing to be ready to deploy the database to Heroku? [duplicate]
I'm quite new creating web applications.
For a course grade, I have created a database in VScode. If I'm not wrong and trying to be as tech as possible, It is a Sql Flask App written in Python.
The ...
2
votes
1
answer
60
views
Can a user with a role that denies SELECT on a particular attribute value infer items in the Table (with that value)?
Consider a table as follows:
CREATE TABLE Farm (
ID INT,
Name CHAR(1),
Contents VARCHAR(255),
Level VARCHAR(50)
);
INSERT INTO Farm (ID, Name, Contents, Level)
VALUES
(1, 'A', 'Cats',...
-1
votes
1
answer
72
views
Transposing Columns to Rows Using only Case Statement and Joining All Tables
I have a query that produces millions of rows and has 10s of columns. I have posted a pic of the original query and it's a simplied version of what I am working with and is named 'Details'.
I need to ...
0
votes
1
answer
54
views
Pros and Cons of Constraints across Many-To-Many relationship
I have tables with relationships like the following.
CREATE TABLE DocumentType
(
ID uniqueidentifier primary key,
...
)
GO
CREATE TABLE LinkedDoc
(
ID uniqueidentifier ROWGUIDCOL NOT NULL,
...
-1
votes
1
answer
36
views
Does Serializable isolation level block read queries in Postgres
I have table "Transactions", where customers accounts transactions will be hold. So I want to set transaction level Serializable to prevent all types of anomalies.
Lets assume transactions ...
-2
votes
1
answer
65
views
SQL query on table A with a (multiple rows) subquery on table B and result of the query show in 1 single record
How can I come to the output of tableC in below data example by use of an SQL query by combining the data of input tableA and input tableB and showing all the order numbers in 1 single record in ...
0
votes
0
answers
11
views
When SQL Using Hint returns different values
Is it normal for different values to appear when using hint when SQL?
I have using sub query and exist on RDBMS.
ex :
SELECT (SELECT A FROM TB_B WHERER X.I = A.I) as AA
, A.BB
FROM TB_A A
WHERE ...
-2
votes
1
answer
57
views
Merge results of 2 inner queries into single result in SQL
I am trying to merge results of two inner join SQL queries into a single result. This works if both queries return rows; otherwise it returns no rows.
If either of the subqueries doesn't have a record ...
-1
votes
1
answer
33
views
Dependency-Preserving Decomposition
Given the schema R = (A, B, C, D, E, H, I) with the functional dependency set
F = {A→B, C→D, CD→E, BD→AH, H→D, AC→H}:
Is the decomposition of R into (A, B, C, D, I) and (B, C, E, H) dependency ...
1
vote
1
answer
94
views
PostgresQL How to implement pessimistic locking on nullable outer join columns
I'm trying to implement pessimistic locking on a complex entity with a foreign keys, but Postgres does not support SELECT FOR UPDATE with OUTER JOIN nullable fields. Is there any workaround?
Example:
...
0
votes
1
answer
20
views
How do i prevent updated row from shifting or changing to last row in Postgres using C code?
I'm new to Postgres and i have been creating table's using C program, so now I have run into a issue where a updated row is moving or shifting to the last row of the table and I have to prevent this ...
0
votes
1
answer
32
views
PostgreSQL: How to create concurrency-safe check for max aggregate value (e.g. sum, count etc.) limit?
First let's assume we are using PostgreSQL 16 with the default isolation level, i.e. Read Commited.
Then let's take the following "notes" table as a simple example:
id
text
user_id
1
...
-1
votes
2
answers
42
views
How to retrieve the data from MySQL database if we are having million of rows in a table without indexing the time_stamp column?
I have faced this scenario in one of my interview. There will one table with millions of records and the table is going to have only two columns id which is primary key and time_stamp which is of type ...
1
vote
1
answer
42
views
SQL to show status for both id and next_id in a single row
Can someone help me on below please:
I tried the below SQL
select
CUSTOMER,
ID as Current_ID,
lead(ID) over (partition by ID order by CUSTOMER, ID) as Next_ID,
STATUS,
...
0
votes
1
answer
56
views
Does the TRUNCATE Statement Technically Drop and Recreate the Table in the Background?
I've been using the TRUNCATE statement in SQL to remove all rows from a table. However, I'm curious about its internal mechanism. Does TRUNCATE technically drop and recreate the table in the ...
0
votes
0
answers
10
views
Replicating DynamoDB stream events using RDBMS [duplicate]
Using MySql or Postgres (or some other RDBMS) is there a way to replicate DynamoDB's stream functionality? That is, when any INSERT, UPDATE or DELETE query is executed on a table, an event is created ...
0
votes
0
answers
25
views
Prevent snapshot of entire table during data load in SAP IQ
Tryin to load 20GB of data in 40 batches (0.5 GB each) using LOAD TABLE .. FROM CSV command in a table which is 200GB in size before my load commands. few of these writes sometimes (not every-time) ...
-1
votes
1
answer
29
views
How to make a unified Table for more than entries but retrieve different columns name for each entity in SQL?
I have different entities but, ironically, in same time they are very similar, and I wonder if I can save them in one united table.
I need four tables for Departments, Committees, Groups, and Bands in ...
0
votes
1
answer
31
views
How to reference the primary key at the derived part of the same table?
Let's consider the following two, simplified tables:
CREATE TABLE payments
(
id bigserial NOT NULL PRIMARY KEY,
method int,
method_name name,
total numeric,
payment_date timestamp ...
-1
votes
2
answers
36
views
Oracle: Create a table copy exempting totally null rows
I've been tasked with fixing a bad data problem in Oracle. There are completely null rows (Millions), no PK, no indeces, and the table is used often. This is causing massive slowdowns in the ...
0
votes
2
answers
206
views
Procedure/Trigger error log in oracle database
Is there any log in database when my procedure/trigger or any database object error occur?
ex: When someone insert a table with trigger but something wrong happened in the trigger, can I get any error ...
0
votes
0
answers
38
views
Unapplied Django Database Migrations Error: Ensuring Database Schema Consistency
`class PatientHistory(models.Model):
HIV_STATUS = [
('Not Applicable','Not Applicable'),
('Positive','Positive'),
('Negative','Negative')
]
DELIVERY_STATUS = [
('Not Applicable','Not Applicable'),...
0
votes
2
answers
61
views
Storing Data across Columns vs Storing data in a JSON Column in MYSQL
Lets say I have a table T1. Initially it has ID, Identifier, C1, C2 as columns. As time goes by I will be adding new columns C3, C4 and so on. Will it be better to have the columns as ID, Identifier, ...
0
votes
1
answer
85
views
How does the SYSDATE in Materialized View behave with respect to Materialized View's Last Refresh Date?
I have this Materialized View in Oracle with a SYSDATE condition in the WHERE clause.
CREATE MATERIALIZED VIEW DISCOUNT_ELIG_CUST ( AS
SELECT customer_id,
customer_name,
join_date
FROM ...
0
votes
0
answers
45
views
Error creating table with foregin key constraint referencing multiple columns from same table: Postgresql
I am creating tables in following steps-
create table student(rollno varchar(8) primary key,
name varchar not null,
admitted_on date,
...
-3
votes
1
answer
31
views
What is the difference between a table from a RDBMS like SQL Server and a tabular file like Csv?
I have a theoretical question, if both a table and a .csv file store the data in tabular formats, what is the difference between them?
Can I for example access a database table from outside the server ...
0
votes
0
answers
54
views
DBMS_CLOUD_PIPELINE.run_pipeline is not working because of columnpath is required for JSON type
there!
I'm a new user at DBMS_CLOUD_PIPELINE, I can't figure out why my code is not working, I only get the same problem every time.
Do you know what could be wrong with my declaration?
Thanks.
BEGIN
...
0
votes
0
answers
33
views
Trouble accessing PostgreSQL database dump [duplicate]
I am new to the SQL world so forgive my ignorance.
I have downloaded a postgreSQL dump chemfont.sql (the first downloadable on the page linked below), and I am trying to figure out how to query it.
...
0
votes
1
answer
62
views
How can I execute INSERT INTO SELECT with DEFAULT for primary key?
I am trying to copy distinct values from one table column into another table column. However, I encounter issues when trying to create primary keys for new records.
Database: PostgreSQL on AWS RDS
...
0
votes
0
answers
43
views
Copy Feature in postgresql failing when data is in epoch format (org.postgresql.util.PSQLException: ERROR: date/time field value out of range:)
I have a data in my csv file where timestamp field values are in EPOCH format. When I try to insert the csv file into postgres with copy feature I'm getting below error
org.postgresql.util....
1
vote
1
answer
185
views
partitioning the query results with ORA_HASH
I have few million rows in the RDBMS (Oracle 12+) and i'm using Spark (3+) to read the data into multiple partitions. However, the query execution is getting aborted by the Oracle server due to TEMP ...
-1
votes
1
answer
53
views
How can I model a one(zero) to many relationship between two tables in SQL?
I have table A and B that are defined like this.:
CREATE TABLE A (
AId int NOT NULL IDENTITY ( 1,1 ),
Message VARCHAR(50) NULL,
)
CREATE TABLE B (
BId int NOT NULL IDENTITY ( 1,1 ),
...
-1
votes
1
answer
16
views
Android: why Room removes parent if I remove only child?
I'm working with Room for an android application.
@Entity(tableName = "author")
data class AuthorEntity(
@PrimaryKey
@ColumnInfo(name = "authorId")
val authorId: String,
@...
-3
votes
1
answer
72
views
Postgresql function has syntax error at If. Why?
I am new to writing functions on postgres. So I was trying to write a function that checks if a row exists. If it exists then it returns the row with a flag 'Exists', else it inserts a row and returns ...
-2
votes
1
answer
33
views
Retrieve distinct and recent values from the SQL table
I have a table like below.
I need to fetch the most recent records(for given time) for each unit from the above table. Each unit should have all the possible vehicle IDs but should not have duplicate ...
0
votes
0
answers
37
views
Should I roll up multiple values into a list within a single column or use a separate table? [duplicate]
Should I roll up multiple values into a list within a single column or use a separate table?
In SQL Server, I have a table that stores product information. This product table has a child table that ...
1
vote
1
answer
40
views
Laravel Mysql Schema Relations
I have pages table and logos, faqs, carousel, testmonials, cta tables. Each page can have sections of group of logos, group of faqs, single carousel, can have more than one ctas like page builder. How ...
0
votes
0
answers
37
views
Can't load http api to rdbms using stambia S19
here is the mapping
here is the metadata
While creating the metadata (a very simple one), the reverse works just fine
but whene executing the process (or mapping) i get many errors, each time i try to ...