All Questions

0
votes
0answers
19 views

Delete duplicate Data joining different tables

I've this problem, and I'm using PostgreSQL 9.4.12 on x86_64 ; I have these tables Entity ------------ idEntity_pkey value ... ... Points --------------- idPoints_pkey idEntity_fkey x y ...
1
vote
1answer
20 views

Way to check where the MySQL connection was initialized?

Is there a way to identify who created the MySQL connection? For example: in file a.php $conn = mysqli_connect($dbhost, $dbuser, $dbpwd, null, $port, $socket); I would like to know that this ...
0
votes
2answers
31 views

distinct select from 2 databases

I have 2 databases with the same structure massfacturation and massfacturation_old and I want to simply combine 2 queries to extract a count like: > select count(distinct(sciper)) as usercount, ...
0
votes
2answers
43 views

Multi-site Failover Cluster Instance for HA and DR to alwaysON Availability Groups

In my company we have chosen to implement Multi-site SQL Server Failover cluster. Basically Data center A has 2 nodes (Active/Passive) and Data Center B geographically located acts as the DR. I ...
0
votes
2answers
19 views

MySQL compare values of two large tables

On MySQL 5.7 I want to get the records from table 1 that are not present in table 2. I'm using this simple LEFT JOIN query that is very slow (more than 2 minutes), I don't know why. SELECT * FROM t1 ...
0
votes
0answers
17 views

Stored Proc with MSDTC Linked Server Update Hangs-On PREEMPTIVE_COM_QUERYINTERFACE Wait

Stored Procedure performs a Linked Server update inside a Transaction. It works well for multiple client environments except for one particular client environment. The behaviour that occurs is that ...
1
vote
1answer
15 views

MySQL change user login from one plugin type to another

I'm in the process of testing MySQL 8.0. I have set up a test database, and the first thing I want to do is import my user account from MySQL 5.7. So to do this I run: /*ON MySQL 5.7*/ SHOW CREATE ...
0
votes
2answers
35 views

Select users that are in the same team

We have these 3 tables: USERS userid name email TEAMS teamid name options (0,1,2 or 3) TEAMUSER id teamid userid isadmin (0 or 1, if they are administrator of team) Let's say we have user 1, 2 ...
2
votes
1answer
20 views

DAC silently swallows tokenization errors in sp_msforeachdb

This morning I hopped on the DAC to check something out. Oops, I made a typo! 1> exec sp_msforeachdb N' 2~ use [?] 3~ select N'?', count(*) from sys.sysrscols; 4~ ' 5> go 1> Can you spot ...
1
vote
1answer
15 views

Auditing of modification of change to encryption keys

Is it possible to audit/log any attempts or actual changes to the keys used in the encryption hierarchy? We are using 2014 Enterprise edition and have recently enabled TDE across our databases and ...
5
votes
1answer
211 views

Does Service pack have all the changes in a cumulative update

I have always thought that all the changes in the CU's are rolled up into the next services pack. I recently was looking at changes in SQL 2016 SP2, and SQL 2016 CU15 for SP1. I was surprised to see ...
1
vote
0answers
60 views

Filter sorted overlapping ranges with window functions

I have the following data set: layer period 1 ["2019-06-17 10:00:00","2019-06-17 11:00:00") -- visible 1 ["2019-06-17 12:00:00","2019-06-17 14:00:00") -- visible 1 ["2019-06-17 15:00:...
0
votes
1answer
42 views

How to store tax for a Product when tax rate for a Product can change and tax-exempted Products

Product id name price Tax id name rate Product_Tax Product.id Tax.id effective date expiry date Is this a good design? How to store Products that are tax-exempted? Also, how to handle the ...
0
votes
1answer
47 views

How to store tax in the database when tax consists of multiple taxes

We need to design Tax table for Billing System. Lets say we have a SGST (State Tax) and CGST(Central Tax) and Final Intra-State Tax = SGST + CGST Tax table id name rate Tax table id | name ...
0
votes
0answers
29 views

Multiple condition in if

I am making a new Report in SSRS. I have an If condition based on a SSRS STRING Parameter. This Parameter have 3 values; EX : john, Albert and sara. I have do something like this in sql and it works ...
0
votes
1answer
29 views

Large Table Times out - Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding

We have a customer who is experiencing Time-outs in our .NET application which uses SQL Server as the backend. The table in question is the OrderLines table in a SQL Server Database that has 4155151 ...
0
votes
0answers
13 views

WAL buffer checkpoint/flush time during serialization isolation

I have a doubt regarding the flush/checkpoint time of WAL buffers during serialization isolation in Postgres. Is it possible to lose acknowledged writes even if transaction runs in serialization ...
-3
votes
1answer
19 views

Select database type (RDBMS or JSON) for attribute storage [on hold]

What database to choose for storage. Now I think about PostgreSQL or MongoDB. It will be necessary to search by attributes. 1. Table - a list of objects. For example - IP. 2. Attributes table for ...
0
votes
1answer
34 views

What's the best way to migrate from mariadb to mysql on ubuntu 18.04

I've got a server running on ubuntu 18.04.1 with mariadb 10.1. and I have to change to mysql. The reason is that mariadb isn't supported by a product I want to buy. Searching around the internet I've ...
0
votes
2answers
47 views

sqlplus, command line parameters and ORACLE_HOME with spaces

I have noticed strange interaction between ORACLE_HOME and parameter substitution. Here is my test.sql prompt &1 prompt &2 prompt &3 prompt &4 exit The expected behavior: C:\...
6
votes
2answers
865 views

How can I restore a master database from its bak file?

During a penetration test I found multiple .bak-files for an MSSQL database. I want to restore them all. In a Windows VM I installed SQL Server 2017. For restoring the master database, I put the ...
0
votes
0answers
23 views

The USE-Statement breaks on MySQL-Server

running webadmin for years now - and having troubles for months - and posting here for weeks. But the support seems to be not the best... want to run sql-commands on the newest version - but it fails ...
0
votes
0answers
10 views

move postgresql 9.4 database cluster to debian buster

I have a postgresql folder backup (no dump) from postgresql 9.4. On my debian buster server I want to get this old database running, so I installed postgresql-9.4 again with this tutorial: https://...
-7
votes
0answers
33 views

Anyone can help me suggest or give a sample query to generate this sample output in sql server or mysql database [on hold]

Anyone can help me suggest or give a sample query to generate this sample output in sql server or mysql database
0
votes
1answer
26 views

Can you restore purged MySQL binary logs?

I have two situations I need some clarification. 1) Let's say I made a backup of all the MySQL binary logs before I purged a single binary log file (the oldest one, possibly the very first one). ...
0
votes
1answer
35 views

Why does this MySQL query take 25+ seconds?

The query is: SELECT T.ID, T.A, T.T FROM table1 AS T WHERE (userID='333335') AND (category LIKE '1%') AND (T.T='You Ain\'t Much Fun' AND T.A='KEITH, TOBY') GROUP BY T.A, T.T I have a BTREE index ...
-3
votes
0answers
16 views

How many IDs do we need for web applications? [on hold]

My thought is that there are several problems that IDs in general need to solve. Primary Key. The best version of this is an autoincremented bigint. It's ideal for not only being the PK, but also the ...
1
vote
1answer
23 views

How do I select the count of a specific value without grouping in postgresql?

I have a view that's a result of a UNION of two selects. It has contents similar to this: id foreignkey 1 a 2 a 3 b 4 c I'm looking to add a column in the view's definition that will show a ...
0
votes
0answers
9 views

Script to alert me that a droplet resize is necessary for PostgreSQL DB to fit into memory?

I am trying to answer the question, "How big is my PostgreSQL DB relative to memory on my Ubuntu server?" The goal of asking this question is to be able to alert me to when the size of my database is ...
-2
votes
0answers
26 views

Aggregate function by date

I have a table of highscores achieved at tournaments. I select on highscores for each tournament using ID. (Each player can score more than one highscore in a tournament.) The query I have: SELECT m....
-4
votes
0answers
20 views

Make a MySQL DB modifiable on different computers in same time - HELP REQUEST [on hold]

I need your help. I created a Java app in netbeans that registers some data in a MySQL db. The program works fine and correctly, but the problem is: If I put the app on another computer, and i run ...
0
votes
0answers
23 views

“syncing” rows to another table

I have a database: companies -> properties properties -> accounts accounts -> line_items An "account" represents a dual-entry accounting account (like Cash or Accounts Receivable) Each property ...
-1
votes
1answer
59 views

TSQL Running Total but only based on Logic

Just been tasked to work on an old system that's running on SQL2008r2. Need to audit the number of hours earned and compare against the number of hours taken. So here's a sample dataset - Expected ...
3
votes
1answer
76 views

Enforcing a “disjoint or identical” constraint

Suppose that F is an Oracle table with two columns, X and Y, such that the constraint CONSTRAINT unique_xy_pairs UNIQUE (X, Y) is satisfied. For each value [x] of F.X, let S[x] represent the set ...
0
votes
0answers
24 views

Add new login for a group under windows authentication [on hold]

I'm new to SQL Server, just a very dumb question on Add new login for a group under windows authentication. So I'm a sys adminsatrator and create a new User Group(i.e Finance_Dept and add a new user ...
0
votes
0answers
4 views

InnoDB clustered index performance when using random values as primary key

By default, my primary keys of InnoDB storage engines are auto increment integers. In effort, to hide the number of rows in the database, application code implements some random generator for the ...
1
vote
1answer
20 views

Why can't I double quote built-in type names in Postgres?

Why can't I double quote the primary built-in type names in Postgres despite being able to double quote their aliases? For example, these work fine SELECT CAST (1 as bool); SELECT CAST (1 as "bool");...
2
votes
1answer
45 views

Is it possible to use just one shared folder for log shipping?

I wonder if it is possible to use one shared folder(only in source database) instead of two (one in source db and another in destination db). That's Server1 will store its t-log backups there and ...
1
vote
1answer
14 views

Multi-dimensional range queries with single column indexes

I am reading a book that covers many database topics on a very high level, but doesn't dive deeper. It introduces multi-column indexes as a better way to query for 2 dimensional ranges. For example, ...
0
votes
0answers
15 views

syntax error in mysql join problem [on hold]

my frist query is working fine select w.id, p.age, w.coins_needed, w.power from Wands as w join Wands_Property as p on (w.code = p.code) where p.is_evil = 0 and w.coins_needed = (select ...
0
votes
0answers
8 views

innodb file per table

We are running with shared tablespace on MySQL database server in our environment. We are looking to enable file per table on database. We want to know What would be ideal plan to enable file per ...
1
vote
1answer
13 views

query with LISTAGG() string function does not give the desired output

I'm new to ORACLE and I'm trying to use a string aggregation function in my query to concatenate the value of rows with a comma , this is the structure of my tables: Student(STUDENT_ID,student_name,...
0
votes
1answer
16 views

What kind of changes does snapshot file store?

Assume that I created a database called [DBS] and inside that database I created a table called [products]. Then I inserted 4 rows into [products]. Afterwards I took a snapshot of [DBS]. As a result,...
0
votes
0answers
17 views

Moving Replicated database in SQL Server Transactional Replication

I have a scenario where I need to move the published database (Transactional Replication) to another server, which is having upgraded Windows and SQL Server installed. Current config is: Windows 2012 ...
0
votes
0answers
17 views

How to show dynamic data row to data column in mysql or within php?

I have problem with query mysql. So I have database table and I've tried with my query like this SELECT GROUP_CONCAT( 'MAX(IF(day(tanggal) = ', day(tanggal), ', presensi, NULL)) ...
0
votes
0answers
20 views

Database schema for a interactive novel

I'm trying to create an interactive story telegram bot on Node-red. To store the story I'm using SQLite How it works: Bot shows you a piece of the story, then shows some answers (buttons) regarding ...
2
votes
0answers
34 views

Keyboard shortcut to automatically wrap selected text in IsNull([text], 0) in SSMS [migrated]

Is there some way to have a shortcut in SQL Server Management Studio (SSMS) that when text is selected, it wraps that text in an IsNull() statement? For example, I highlight the text below: ...
0
votes
1answer
35 views

Enforcing “one-to-one-or-more” vs. “one-to-zero-or-more”

Suppose that I have a mini-world consisting of three types of entities, A, B, and C, subject to the following constraints: each A is associated with 0 or more B's, and each B must be associated with ...
0
votes
0answers
20 views

GoldenGate - substitute update condition

Lets say database is performing this kind of UPDATE: UPDATE table_name SET field_A WHERE field_A = 'VALUE' AND field_B = NULL; That will discard on recipient node. Is it possible to modify replicate ...
0
votes
1answer
16 views

Updating a column in one table based on matches with column in another table

I have 2 tables say table1 containing says 3 columns col1, col2 and col3 and table2 which contains col1 and col2. I want to set col3 = 'some value' where table1.col1 = table2.col1 and table1.col2 = ...

15 30 50 per page