All Questions

0
votes
0answers
2 views

PostgreSQL, Stored Procedures, Recursive call Tree structure

I'm faced with a problem.I have a ternary structured data. The relation is from child to parent, more specific a child has an parent_id. A parent shouldn't have more than 3 children. When 4th child ...
0
votes
0answers
2 views

PSQL incomplete backup : how to debug

I've been doing backups of my database " screen ". after connecting to PSQL and typing \l+ i'm getting ( among other things ) : Name | Owner | Encoding | Collate | Ctype | Access ...
0
votes
0answers
6 views

Update thousand records with primary and foreign key

I am a beginner when it comes to SQL (SQL Server) and I hope you help me. A warehouse database, where we have a tl_warehouse_items table for example, which contains over 50,000 different items and ...
0
votes
0answers
5 views

what is the relationship between product and stock?

My assumption is that it can be many to many as one product can be in many stocks and many product cane be in one stock but in the the original question is that there are 10 store locations where they ...
0
votes
0answers
10 views

How to update value increment by 1 SQL

I have a table name downloads where I need to add value colum order + 1 downloads order Name dlid website 0 Jon 51 A 1 Jim 54 A 2 Jack 55 ...
0
votes
0answers
11 views

View images as query results

I've done lots of research on the topic but I'm drawing a blank. Are their any database engines that can return rendered images in the query response? For example: Select images from fruit where ...
0
votes
0answers
8 views

How can I figure out the root cause of “Out of range value for column” error in MySQL

I have a console app written with C# on the top of .Net Core 2.2 framework with EntityFrameworkCore as ORM. My application runs various tasks that run every 15 minutes. Each task calls an external API ...
0
votes
1answer
16 views

What will be the order of statement execution in this use case?

Say I execute select * from users at t1 which gets finised at t3. At t2(in between t1 and t3) update comes for some of the records in users table say update users set address='xyz' where name = 'abc'....
0
votes
1answer
11 views

Normalisation Help

I am undertaking a project that involves a student management system, but I am struggling to normalise/create relationships between certain tables. Here is my current setup: Models Users(id, first ...
-2
votes
1answer
13 views

How to re-zip sqlite file as a .jet file

I have a .sqlite file and the developer zip it as a .jet file. Now I can open it with 7zip, I can edit the db but at the end I couldn't re-zip again as a .jet file. I tried every solution that I saw ...
1
vote
1answer
22 views

Snapshot on Always On Availability Group in suspect mode

Our configuration is 2 SQL Servers 2016, enterprise edition, 13.0.5026.0, running on Windows Server 2012 R2. Created availability group with one database in it. Database has 3 data files in it, all ...
0
votes
1answer
7 views

Mongo Memory management

I had a few questions If there is sufficient RAM, does Mongo load entire collection into memory? Suppose I had two collections A & B and I know that there is not enough RAM to hold both - and if ...
0
votes
1answer
11 views

Which MySQL shows CPU usage?

I am monitoring MySQL server using phpMyAdmin [Status => Monitor] function. And it shows a number of useful graphs. Which variables (or which mechanism) is phpMyAdmin using to pull this data? ps. ...
1
vote
0answers
11 views

Mariadb master master replication supported by HAPROXY for automatic failover

We have implemented master-master setup in maria-db. Master A is being used for read\write and Master B is used for backups and MIS operations. We have built this setup so that we do not need to ...
0
votes
0answers
20 views

sql query three tables with join

i have 5 tables in my database. that are connected with each other using joins. department table vs course one to many course table vs classes one to many classes vs section many to many. i want to ...
0
votes
1answer
17 views

postgres: using unnest in multiple rows

I have an array column contains info like array {a,b,c,a} {a,b,a,b} {b,a,a,b} I want to run unnest on this array column, get the occurerence of of each character. a 2 b 1 ...
-1
votes
0answers
13 views

Booking schema advice

I am starting to put together a database to book students on activities for a week. a tutor needs to log in and have access to all students in their tutor group. there are 4 activity slots per day (...
0
votes
1answer
11 views

Subquery to return multiple columns or a JSON object

Is there any way for me to return multiple columns from a subquery or at least return a column that is a JSON object of all of the columns I need? This is a working query that works: select r.*, ...
-1
votes
1answer
8 views

Operand should contain 1 column(s)

Hello I have problem with this query INSERT INTO radacct (acctsessionid,acctuniqueid,username, realm,nasipaddress,nasportid, nasporttype,acctstarttime, acctupdatetime, acctstoptime,...
0
votes
0answers
33 views

Stored Procedure code

I am a beginner when it comes to SQL (SQL Server) and I hope you help me. A warehouse database, where we have a tl_warehouse_items table for example, which contains over 50,000 different items and ...
0
votes
0answers
7 views

Dimensional Model for CRM Sales Opportunity and Sales Leads: Fact or Dimension?

I'm working for a business lender, and trying to come up with a basic dimensional model around the subject area of loan approvals. We use a CRM, (Salesforce) and one of the core objects is a (Sales) ...
0
votes
1answer
26 views

How to setup a SQL Cluster between 2 sites in active passive mode without shared storage

we need to install SQL at 2 sites, 1 primary and 1 DR. We don't to pay for license for the DR and need to know how will we setup a SQL cluster/replication/alwayson/bag or any other method that will ...
0
votes
0answers
13 views

POSTGRES - handle several unique indexes differently in ON CONFLICT clause

I have a table with several unique indexes. Is it possible to ON CONFLICT UPDATE only on one of them and DO NOTHING on all others, handling with DO NOTHING future unique indexes without going back and ...
0
votes
0answers
8 views

How to encrypt a column using aes-256-gcm encryption in PostgreSQL?

As a database point person, I am required to encrypt SSN numbers wherever they are in a table. We use PostgreSQL. My application counterparts require that we use the AES-256-GCM encryption algorithm. ...
2
votes
0answers
17 views

Some basic questions about SQL and TLS 1.0 and 1.2

(I don't believe this is a duplicate of any other TLS-related question, like the authoritative question about SQL Compatibility with TLS or its many duplicates, or questions about specific TLS-related ...
0
votes
1answer
11 views

Recursion on deletion trigger that calls a function

I have the following schema: CREATE FUNCTION myfunc() Returns trigger as $myfunc$ DECLARE someVal integer; BEGIN SELECT Count(*) into someVal FROM MyTable ...
0
votes
1answer
16 views

How to write a query to get concatenated names of riders with the same weight?

I want to retrieve a table with all Riders of the same Weight from a table named Rider, which is defined in this way: CREATE TABLE Rider( name VARCHAR(30), weight REAL, PRIMARY KEY(name) )...
2
votes
2answers
16 views

Inconsistent performance of WHERE and ORDER BY depending on size of WHERE match

Been working with MySQL for 15 years, and never seen anything quite like this before. MySQL table with 4 million records. I have found a very strange "sour spot" (opposite of "sweet spot") in ...
0
votes
0answers
31 views

Refactor SQL to left join on TVF requiring input variable

I would like to join two tables and a table-valued function. The TVF take a date as input variable. The expected output is: Date, LimitName, Exposure, ProductValueEligible, ProductValueNonEligible ...
0
votes
1answer
20 views

Mysql 5.7 - select where json

I have some JSON data stored in a filters column. An example from one row: name | filters ---------+---------------------------------------------------------- John Doe | [{"Year":2004, "SportID":...
0
votes
1answer
11 views

Azure SQL Database patch and update doubts

It is known that Microsoft automates the patch and update of Azure SQL Database. But, some times applications must be tested before being applied any type of patch or update, because there's a ...
0
votes
0answers
15 views

SQL Server availability groups and traditonal replication

Could you tell if it's generally a good idea to combine AG and traditional replication? What kind of problems a traditional replication could create for AG?
2
votes
1answer
16 views

MySQL 8.0 Replication filters lost between restarts

I don't know if I fell on a bug or a feature, I read the documentation several times but haven't found the information. I have two MySQL servers, both on 8.0.15 and hosted on a Windows Server (x64). ...
-1
votes
0answers
12 views

Functional dependency from statement

relation about a module unique code, adopted books, and lecturers MODULE( CODE, BOOK, LECTURER) Every lecturer adopts the same books for a particular module. Is this relation normalised? Assume 1NF. ...
2
votes
0answers
19 views

How to monitor progress of Oracle Materialized View

I have created a materialized view in Oracle 12.1 database. The master table has materialized view log created, so that I can do a fast refresh. I have executed the refresh using DBMS_MVIEW.REFRESH, ...
1
vote
1answer
33 views

SQL Server Management Studio Doesn't do “Full” Backup

Very new to SQL Server. I'm trying to bring a backup from one our clients Windows 2012 Server Install to our Linux Install. We have the site working perfectly on Linux, but can't seem to do an ...
0
votes
0answers
11 views

PostgreSQL Error 22P02: Unable to insert data into postgres database using CURL POST

I have a PostgREST API running on the top of my PostgreSQL 10 database (Windows 8 x64 machine). A GPS app logs data to this API via: http://my_ip_address:my_port/log?lat=%LAT&lon=%LON&time=%...
2
votes
0answers
32 views

70-761 Practice exam Question about @@Trancount final value

There is this question in the practice 70-761 exam that states after executing the following script, what is the value of @@Trancount? Exam script: CREATE PROCEDURE dbo.up_CreateSalesInvoice ( @...
0
votes
1answer
26 views

How do I calculate the average weight of riders by competition?

I have an assignment where I need to calculate the average Weight of Riders by Competition. The assignment has a lot of different parts but I got stuck on this one so please help my out if you can. I ...
0
votes
1answer
17 views

Combining nested query three levels not showing, all columns

I have the following query. Let's call it Q1. SELECT t3.staffing_id, Max(t3.date_action_taken) AS MaxOfdate, IIf(Month(Min([t3].[date_action_taken])) Between 4 And 6,"Q1", IIf(Month(...
0
votes
1answer
12 views

Analyzing a query plan for a query with TWO predicates, but index only has ONE

Note: This is from an introductory database systems course at my university so I'm not entirely sure if it matters, but for what it's worth we are being taught MySQL. One homework question I'm doing ...
0
votes
0answers
30 views

Red gate SQL Compare error while running using SQL Agent Job

I created a SQL agent job to perform a SQL Compare using the below command line powershell.exe -File D:\SQLCompareReports\DEVvsPRJ\DEVvsPRJ.ps1 This below given is the command line code in DEVvsPRJ....
0
votes
0answers
5 views

Migrating to SqlAzure - workaround for error “The element Certificate: [CertName] is not supported”

Within my database I use symmetric encryption on certain columns. I'm investigating migrating to SQL Azure, but when I try to migrate my database using the Wizard within SSMS, I get a couple of ...
-2
votes
0answers
9 views

Setting up Performance Monitor for several VMs

Does anyone have a script to complete automation of collecting Performance counters for several VMs to be stopped and started on a daily basis.
0
votes
0answers
29 views

Can this circular reference be a problem?

Given this schema, im trying to represent a Warehouse that can have different criteras met for storing products. A product can also need different storage criterias, the entity criteria represents ...
1
vote
1answer
22 views

Oracle losing connection ( ORA-03114 ) after some time not using the software

After some time idle, if users try to use the our system, we receive the error: ORA-03114 - not connected to Oracle. I know there's a parameter called SQLNET.EXPIRE_TIME. the recomendation is ...
1
vote
1answer
17 views

Postgres Log Table

Is there a table that with the log file information in postgres? I wish to create a view/report of the information in the postgres logs. I'd like to do something like: SELECT * FROM log_table;
2
votes
1answer
139 views

Is there a way to get a count about grouped rows?

I am trying to get a count about a grouped rows. Here is a description of the table of relevance: column_name data_type ------------- --------- id integer title character ...
-2
votes
0answers
30 views

Powershell Script to bring back one report [on hold]

Not sure if I'm in the right place with this one as I'm a DBA that is trying to run a PowerShell script to return some stats on my SQL servers. The script at the moment is returning a HTML file / ...
0
votes
0answers
34 views

compare two logins on same SQL server and the output should be the difference between the first and the second

I want to compare two logins on same SQL server and the output should be the difference between the first and the second. This requirement come up as there is migration of logins are happening from ...

15 30 50 per page