All Questions

0
votes
1answer
3 views

distinct values from multiple fields in array

I have a similar mongodb collection: [{ "country": "France", "exchange": { export: [{ resource: 'MILK', origin: ['Toulouse', 'Bordeaux'] }] ...
0
votes
1answer
4 views

Postgres Trigger-Creation throws Syntaxerror

I am currently working with a program that requires a certain way of structuring our object-classes as different tables (with specific columns) in the db, but i need a global unique id for them. So my ...
-1
votes
0answers
5 views

How to insert documents to mongo db collection using bash shell script

How to connect to Mongo DB and insert documents to collection using bash shell
0
votes
0answers
6 views

SELECT Every Parent Table Record and INSET Multiple Record in Child Table Against the Parent_Id

Suppose I have two tables name company and screensavers as given below: **Company:** id (pk auto inc) name (varchar) **ScereenSavers:** id (pk auto inc) name (varchar) path (varchar) company_id (int)...
1
vote
0answers
8 views

MariaDB behaviour with many JOINs

I found MariaDB behaviour changing according to the number of JOINs in a query. In this particular application, when the number of JOINs goes from 30 to 31 the execution plan changes, causing ...
1
vote
1answer
21 views

SQL Server (JOIN) all from first with NULLs from 2nd

I have 2 tables (Reps and DailyStartTimes). the Rep Table returns 37 rows, but when I Join it with the 2nd table I get 36 rows as the 2nd table only has 36 rows that match the first table. How do I go ...
0
votes
0answers
12 views

How do I insert values of different type to columns in my table?

The question title might sound ridiculous, but I would explain what I want to do with example table below: +------------+------------+----------------+----------+-------------------------+ | ...
0
votes
0answers
4 views

What do the SStable(Cassandra) contain?

What exactly does an SStable contain? Does it contain a single row? a changed element? Could someone clarify
0
votes
0answers
15 views

Exclusive lock vs atomic(?) increment/decrement in MySQL

We're working on implementing an account with virtual currency in our app and we need to update account balance (classic, yeah?). Let's say we have an accounts table with user_id and balance fields. ...
0
votes
0answers
29 views

Restoring of database failed [on hold]

We have a job to restore the full and differential on daily schedule for Analysis team from Microsoft SQL Server 2014 (SP3) (KB4022619) to Microsoft SQL Server 2016 (SP2-CU4) (KB4464106) instance. ...
0
votes
0answers
4 views

Is mongodb upsert the right option for write intensive use case?

I'm designing data model for a transactional use case which is write intensive. The Write load would be, 900 - 1,600 Transactions Per Second(TPS) which would account 30 million Inserts/Updates per day ...
0
votes
0answers
11 views

How to increase mysql dumping speed

I have sql file size of 2.51 Gb I checked mysql dumping speed with 2 different machine os For MAC ----16 Gb Ram , core i7 , 2.7 Ghz---- It's take 10 min only For cent os 6.6 ---8 gb Ram , 4 core ...
0
votes
1answer
17 views

my trigger has an error SQL syntax to use near 'AFTER insert on defaulters FOR EACH ROW

i have two tables one is called defaulters and users .defaulters has mypin and debt_amount and users has mypin and debtor .i want a trigger that update debtor in users table if mypin exist in users ...
1
vote
1answer
22 views

serializability ordering after one transaction finishes in postgres

Suppose, I have a table product with integer column price. Here are two transactions that I begin at the same time (almost): T1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; UPDATE "product" ...
0
votes
0answers
9 views

Difference between one-way and two-way synchronization for change tracking feature (CT)

here are 2 ways in which applications and databases can synchronize data changes. In one-way synchronization the application is responsible to keep the cache fresh with the updated changes in the ...
0
votes
0answers
10 views

How to search for the number of times that keywords will appear in several text

I have 2 tables and the they have the following columns. articles: id (PK), articles (longtext), date (date) keywords: id (PK), keyword (varchar) For the moment I can only do that, search for a ...
0
votes
0answers
7 views

unable to change character_set_server on mysql

I have converted my database to utf8 but the character_set_server is still latin1 Is it compulsory to change it to utf8 or i can just leave it like that ? This is production server, so not possible ...
0
votes
0answers
8 views

aurora postgresql logs

We are in the process of sending logs of Aurora PostgreSQL to a SIEM log management solution. However, there doesn't seem to be a option to publish Aurora PostgreSQL to Cloudwatch log group. Is there ...
2
votes
2answers
78 views

Query to find customers that have deposit in all branched located in a specific city

I have 3 tables as follow: Customer (CustmerName , CustomerCity , CustomerStreet) Branch (BranchName , BranchCity) Deposit (CustomerName , BranchName , AccountNumber , Balance) Here I show you ...
1
vote
1answer
19 views

Join 3 tables, aggregate over date field and subtract sum of two columns

I have 3 tables and the they have the following columns. shipments: shipment_id (PK), shipment_date (date) invoices: invoice_id (PK), shipment_id (FK), amount (float) bills: bill_id (PK), ...
0
votes
1answer
13 views

Get rows within 3 hours of a datetime value [on hold]

I am trying to retrieve orders of a particular customer ID made within 3 hours of a datetime. SELECT `order_id` FROM `orders` WHERE `contact_id` = '2768953' AND `datetime` < '2019-05-03 17:00:...
0
votes
1answer
15 views

Install SQL Server 2017 over 2016 Local DB and 2012 native client

I have downloaded Microsoft SQL Sever 2017 and would like to install it. But just to be sure I checked installed applications and I found that there is: Microsoft SQL Server 2012 native client ...
0
votes
0answers
26 views

A first nod in the right direction, please [on hold]

I'm just after a pointer really. I've had an idea. I want to produce a database. One where information is stored about certain items. The items have certain properties. Some of these properties would ...
0
votes
0answers
10 views

Architecting postgres jsonb for an analytical workload

I have a rails app that is powered by postgres hosted on heroku. My Postgres database makes heavy use of jsonb data type. There is demand for read heavy analytical queries but it is slow and ...
0
votes
0answers
20 views

Transforming rows into columns using a specific condition

I have a table with the structure as attached in the Table Structure file.  Student Id     CourseNumber   ClassNumber InstructionID  InstructorDept Grade Pass/Fail But there are multiple students ...
0
votes
0answers
21 views

Aggregate query and table design for large log table

I am in the process of designing an append only event log table for the purposes of fast inserts, batch reads, batch writes and batch deletes. there will be millions of items inserted and deleted ...
0
votes
1answer
18 views

SQL query to replace attribute value with another attribute value- postgre

I have a table on PostgreSQL as below: id | user_id | attribute_key | attribute_value I have data in the table as below: 1 | 1 | first_name | Jesus 2 | 1 | last_name | Christ 3 | 1 | Email ...
0
votes
0answers
20 views

Dump result sets as csv file on remote [on hold]

Please forgive my question if it sounds trivial. I would like to dump the result sets of a query to a csv file on remote postgres server (on a very large table), so that when done I can copy the file ...
0
votes
0answers
27 views

Restore a 140GB - 292 Million entrie MySQL-Database faster?

i need help. I have an old innodb Server and my storage limit reached. I dont use files per table entries because in old times there were no ability at this time. My ibdata grown up fast and there is ...
1
vote
0answers
15 views

How To Prevent Live Servers From Detecting a Forced Failover?

We are using an AlwaysOn Availability Group in SQL 2017 on Windows Server 2016 which consists of two servers on our primary site and one DR server on a remote site. We recently did an internal IT DR ...
0
votes
1answer
32 views

Sum between multiple joined tables

I have these tables: DROP TABLE IF EXISTS books; CREATE TABLE `books` ( `bookId` mediumint(8) UNSIGNED NOT NULL, `title` varchar(10) NOT NULL, ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `...
0
votes
0answers
31 views

How to solve problem when oracle apex does not let me do anything with my created schemas even though i should have privileges?

i have a problem with with latest version of APEX, i have installed it on my pc, i logged in as and admin created workspace with schema, but when i log in to that workspace as a user with admin's ...
0
votes
1answer
31 views

PostgreSQL getting the latest value

I have started working on a postgreSQL database. There is a table keeping the record of stocks and every time a record is updated, a copy of the original row needs to be kept, with a flag added to say ...
5
votes
2answers
150 views

Full backup on database creation

When new databases are created the Differential and transaction log backup maintenance plans start failing and sending alerts as full backup is not taken. What could be the best solution to handle it. ...
0
votes
0answers
28 views

NpgsqlException: ERROR: 22P02: invalid input syntax for type json [migrated]

I have the following JSON string: {"packedRecipeType":"DynamicCharacterAvatar","name":"Character","race":"HumanFemale","dna":[{"dnaType":"DynamicUMADna","dnaTypeHash":1932961400,"packedDna":"{\"...
0
votes
0answers
16 views

What's the maximum number of partition per table I can/should have in MySql 8?

I have around 1T (1,000,000,000) records of products belong to 500,000 accounts. Each product record have the account_id and since I always query within a single account context (there are no cross-...
0
votes
3answers
32 views

Are the switches for the SQLCMD command case sensitive?

I have MS SQL Server 2014 Management Studio installed on two computers, both of which run on Windows 10. The switches for SQLCMD command are case-sensitive on one computer, but it is not on the other ...
-3
votes
0answers
13 views

how to exclude specific checkbox id using javascript [on hold]

I want to exclude specific checkbox id in query selector. Here is the below sample code but it does not work form me. document.querySelectorAll('input[type=checkbox,input:not[id="#chkList_0"]]:...
0
votes
0answers
13 views

How can I start the oracle 12c Enterprise manager cloud control on windows 10?

I have installed Oracle 12c in Windows 10. The installation was successful and the RDBMS and the database that I created are working properly. I am able to access enterprise manager express via ...
0
votes
1answer
16 views

Error: There is a column named in table “*SELECT*”, but it cannot be referenced from this part of the query

Assume we have a simple table, CREATE TABLE foo ( a int PRIMARY KEY, b int ); I'm wanting to write a complex query inside and refer to that query INSERT INTO foo SELECT 5 AS z ON CONFLICT (a) DO ...
3
votes
1answer
59 views

How can I specify the last parameters in a function call and let the others default to the DEFAULT in the declaration?

I have a function with 5 parameters, arguments p1, and p2 are mandatory arguments p3, p4, and p5 are optional and have a DEFAULT set The function looks like this, CREATE FUNCTION test_func( p1 ...
1
vote
1answer
33 views

Why can't temporary tables reference regular (non-temp) tables in PostgreSQL?

Why can't temporary tables references non-temp tables in PostgreSQL? When I run the following CREATE TABLE foo ( a int PRIMARY KEY ); CREATE TEMP TABLE bar ( a int REFERENCES foo ); I get, ERROR:...
0
votes
0answers
36 views

grant privileges for dbms_crypto

I am trying to use dbms_crypto package but I get the error: identifier 'DBMS_CRYPTO' must be declared I granted execute for my user but still get the same error. Maybe someone can give me some ...
-2
votes
0answers
14 views

MongoDB Shutting Down

ran 'mongodump' on the secondary node mongod crashed with 'got signal 6 (aborted)' in mongodb log Environment: VM centos 7, mongodb 3.2.10
0
votes
1answer
27 views

mysql 5.6 replication log-slave-updates doesn't work

We have a setup of master -> replication -> replication the dbs are: mysql 5.7 -> 5.6 -> 5.7 on the replication 5.6 we have the following my.cnf: [mysqld] default-storage-engine=InnoDB ...
0
votes
1answer
9 views

Concatenate two columns into one column in a view in MySQL

I am trying to create a view and would like to display the firstName and lastName columns from a table as one column (User) in a view. The view is using a left join. What I would like to do is join ...
1
vote
0answers
38 views

UNIQUE constraint encompassing all the columns of a table - is it bad practice?

Is it considered bad practice to have a UNIQUE constraint applying to all columns on a table, essentially enforcing unique rows? My use case is to store tokens from textual message from various ...
0
votes
0answers
25 views

Can't run the newest version of MySQL on phpMyAdmin

I am building a database on phpMyAdmin. However, it doesn't include the latest version of MySQL: I downloaded the latest version of MySQL from this link: MySQL Community Server 8.0.16 However, even ...
0
votes
0answers
50 views

SQL Server Database Diagram

I am using SSMS v18, I need to create an ER diagram from my database. As Microsoft removed diagram from new version of SSMS (v18) so now How can I get a diagram for my database??
0
votes
1answer
16 views

convert date to timestamp and store into table using trigger mysql

Using trigger I convert DateTime into a timestamp and then store into another table. But somehow convert date into timestamp always affected by timezone so that's why I had use convert_tz of date and ...

15 30 50 per page