0
votes
1answer
12 views

#1242 error my sql

I'm writing a query and msql return me #1242 error; here is the query, everything works fine but the issue comes from the subquery as it always give the same result instead of adapting this result ...
2
votes
0answers
17 views

Postgresql UDF (User Defined Functions) overhead

Disclaimer The task may seem esotheric, but nevertheless I want to create a POC of some sorts. The goal My goal is to make PostgreSQL database (version 10) expose an API to an application that uses ...
-1
votes
0answers
3 views

Find the phpmyadmin site address

I want to find the path phpmyadmin these sites I could not find anything Please help me find my way Database type: - MySQL dump 10.14 Distrib 5.5.44-MariaDB for Linux (x86_64) - Server version 5.5.44-...
1
vote
0answers
36 views

Database administration in “start-up” companies [on hold]

I am an Information Systems Engineer. I'v been working with data for over 4 years, mainly in Business Intelligence and Data Science. I'v been using Tableau, R and all of Microsoft's tools (sql ...
0
votes
0answers
5 views

Login failed for admin user error in Azure SQL Database using Invoke-Sqlcmd

I am using Powershell module 'sqlps' to create a copy of one of the databases in my Azure SQL Server using invoke-sqlcmd. The complete command line- Invoke-Sqlcmd -ServerInstance "myServer.database....
-1
votes
1answer
14 views

structure of query does not match function result type

I want to create a basic function which takes an input and throws a table with multiple columns and rows as an output . I have written the following query for the same : create or replace function ...
0
votes
0answers
20 views

Count and Sum columns with sub queries or union

Hi everyone I have 2 tables being: odk_blackead.bh_ohs_comp_core a (Primary Key is = a."_URI"::text ) odk_blackead.bh_ohs_comps_rpt_audit c (Foregin Key is = c."_PARENT_AURI"::text) Table 1 ...
3
votes
0answers
18 views

Managed backup large database to Azure

Got a bit of an issue here that I need some help to solve. Hosting a database, that is about 400Gigs. This is giving us a little headache getting it to work with Managed Backup to Azure Storage ...
1
vote
0answers
14 views

change column type from integer to varchar

I have an integer column size in my table product in PostgreSQL 10.5 database. I want to change it's type from int to varchar(20) using alter table if possible. The obvious way which worked for me ...
-2
votes
1answer
17 views

I need help with normalising the data derived from a survey

Background information: I have been assigned to make a survey on E-sports and build a database. My survey can be accessible here https://devpatel6.typeform.com/to/MB1DYP . In brief, this survey ...
0
votes
1answer
20 views

Log-in as service account in SQL Server Management Studio

The stored procedure that performs a CTE in production is being executed using a service account. However, the stored procedure returns empty and I tried checking this using SSMS but I my domain ...
0
votes
0answers
4 views

Method\Function encryption in PostgreSQL

I'm primarily MS SQL Server user. Designing a PostgreSQL database, I wanted to encrypt methods\functions. Is there any way to do this? Thanks!
0
votes
0answers
8 views

Create dynamic mysql queries in php safely

I am building a system which is dynamically expandable, new tables are dynamically created in the system based on end user actions, due to this there is no way for me to be able to 'code in' all ...
0
votes
0answers
15 views

Proving pseudo-transitivity is complete

can anyone help me with this? "Argue that if we replace transitivity with pseudo-transitivity in the Armstrong’s axioms, we still have a set of axioms that is complete" Is the proof suppose to use ...
0
votes
0answers
25 views

IO Test for sql server

I was trying to use Diskspd to check IO subsystem performance but one thing i was confused regarding the T parameter which is as per documentation is the number of threads per file. To my ...
0
votes
0answers
15 views

Postgres — Calculating average distance between two points (long/lat)

I am new to Postgres and really SQL in general, so please bear with me. For a project of mine, I'm trying to calculate the average distance between two points, given their longitude and latitude I ...
1
vote
1answer
37 views

MS SQL 2017 Batch insert performance degradation

This one's a bit strange so bear with me: I'm seeing extreme insert performance degradation after an insert was interrupted in a dirty fashion (the transaction was not committed and the connection ...
3
votes
1answer
435 views

Does clustering provide disaster recovery in MS SQL Server?

I mean can the nodes of MS SQL Server failover clustering be geographically separated and besides high availability also provide disaster recovery?
0
votes
0answers
18 views

Database design - linking and normalizing tables issue

I am seeking help in designing an Entity Relationship database design for my contacts database and resolving the following issue. TblInstitutions TblDepartments TblSections TblEmployeeContactInfo ...
0
votes
0answers
44 views

What is the right way of doing aggregation to partitioned table?

Suppose I have the following table transactions with columns (day_id number, transaction_id number, amount number) and partitioned by day_id. In Oracle, Why select day_id, sum(amount) sum ...
2
votes
1answer
64 views

Can an application connect to databases from on-premise SQL Server Instance and Azure SQL together?

Can a single application connect to two different databases each of which is in different Instances. One instance has on-premise deployment, the other one is Azure SQL(not SQL in Azure VM). So ...
-1
votes
1answer
8 views

Create calculated column min value in mysql 5.7

How to compute a column: calculation is to have 1 or 0 If it is minimum value then 1 should be shown else 0
1
vote
0answers
16 views

Cannot drop primary key or add primary key

This db2 query: alter table mylib.mytable add primary key(field1, field2, field3) returns [SQL0624] Table MYTABLE in MYLIB already has a primary key'. However alter table mylib.mytable drop ...
0
votes
1answer
22 views

MySQL trigger/check on INSERT based on multiple factors (location, date and time)

I have a shift schedule planner for various warehouses. I'm trying to add multiple checks at DB level. If I'm using a composite key (by removing shift_id) to match staff, location,date time it's works ...
0
votes
0answers
3 views

PostGis: How to use a table of point locations to update the nearest point attribute of another table

I am new to PostGis, and I would be grateful to any help to my problem! Tried several solutions but I failed... I have a table of point locations in certain city (tableA) and another tableB which ...
-5
votes
0answers
28 views

Query result needed

I need to create e view that returns me top 2 PartnerIddressId desc by Data_Tran where top 1 SyntheticName <> second SyntheticName. PLS, help!
1
vote
1answer
29 views

Simplifying union where limit query

How can I simplify this query. Requirements are always the same as I described below. (select * from questions where points = 3 and type = 1 order by rand() asc limit 6) union all (select * from ...
-1
votes
0answers
4k views

PostgreSQL vs MySQL Configuration file Comparison For Performance

How I can make my PostgreSQL 10 fast like my MySQL, My Hardware: Processor 12 Core RAM 42GB (20GB Ram Already used for MySQL in same machine) HDD 1TB Usage: SELECT-ONLY Searching - LIKE% Column &...
0
votes
0answers
21 views

Find Popular/Common States

State Table CREATE TABLE state ( id serial primary key, name varchar(255) not null ); id | name -------------------- 1 | NC 2 | OH 3 | MA 4 | NY 5 | Connecticut 6 | New York ...
1
vote
0answers
14 views

What are the pros and cons of using ORMs like sqlalchemy versus writing in SQL directly?

sqlalchemy is an ORM in python. https://www.sqlalchemy.org/ What are the pros and cons of using ORMs versus writing queries directly in SQL? Suppose I have a project which involves only one kind ...
1
vote
0answers
28 views

Optimize Data Warehouse Design

I am working on a project for school (lab, not homework) and we are asked to fix any design problems that we found in the data warehouse implementation. It seems like we could probably get rid of a ...
0
votes
1answer
15 views

how to install mssql on to ubuntu

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1' : file not found. pugazhl@pugazhl-LIFEBOOK-LH532:~$ # sqlcmd -S ...
0
votes
0answers
3 views

Need help with counting the number of games which has quantity greater than 10 in php from the database and printing them

here is the code i have everything is good except i need to print the quantity of games i have which is greater > 10 in stock and printing it out just the like this picture i have here how can i add ...
0
votes
1answer
20 views

What is the foreign key between two children in the same hierarchy?

I'm trying to map an entity relationship design into a relational database. Under STAFF entity, I have 2 children are BUSINESS MANAGER and EMPLOYEE. My teacher requests to add a 1-M relationship ...
0
votes
0answers
6 views

PostgreSQL using SymmetricDS with tokens in the initial_load_select field

I'm creating a new server test group using Postgres 9.6 & 10.3 with SymmetricDS 3.9.13. I've got a successful installation in production that syncs one database server with approx. 10 slaves. This ...
1
vote
0answers
17 views

Double Entry Accounting Schema

Setting up a double entry accounting system for personal use and to help manage a really small business. Trying to put a few features that seem relevant now. I'm just starting to learn about DB/...
1
vote
2answers
15 views

SQL Server 2012 R2 Transaction Log needed to create database mirror?

There's a somewhat lengthy discussion of Transaction Logs in Microsoft's instructions for setting up a database mirror. We've never bothered with Transaction Logs in the past; do we really need to ...
3
votes
1answer
42 views

If at least a negative number, sum; otherwise just show

I have a need to sum values together only if there is a negative value present in a partition. If there are no negative values in a partition, it should just output the row. Here's what I have right ...
0
votes
0answers
21 views

Troubleshooting Deadlock - Part 2

I am still troubleshooting deadlock mentioned in this questions. In that I got help in understanding why a select would hold on to a shared lock and I was able to test and confirm that also. Now I ...
1
vote
1answer
33 views

Avoiding code duplication for counting and selecting the same resultset

I have a requirement to return the total number of records and paged data from a stored procedure. The row count should only be computed if a boolean parameter is true. How do I perform the 2 queries (...
0
votes
0answers
18 views

Store or log actual dynamic SQL EXECUTE … format() … USING

exec_str := format('UPDATE table SET id = $1 WHERE val = $2 AND json#>>''{' || '%I' || '}'' like $3 AND id is null', _element); ...
0
votes
0answers
20 views

Running SSIS package as SQL Server agent job without installing Integration Services

I have set up a SQL Server agent job that runs an SSIS package stored as a File System (on a shared drive) on my SQL Server 2012 (remote) Production DB Server. I have created proxy account and am ...
0
votes
1answer
23 views

How to Replace Hash Match (Partial Aggregate) with Stream Aggregate

My execution plan shows a hash match (partial aggregate) instead of a stream aggregate even though I have a non-clustered index (which basically means sorting is already in place). It gives me a ...
1
vote
1answer
12 views

Azure server names vs Azure database names

Let's say I have one Azure subscription and 2 Azure instances: Dev-instance.database.windows.net for developer testing, and Prod-instance.windows.net for production work. I want to create a new ...
0
votes
0answers
16 views

Retrieve all system admin users activities in SQL Server 2012

I need to log all the system admin users activities in a SQL Server 2012 server. Is there any T-Sql query I can use to retrieve this information? If not, how can I get this information quickly?
1
vote
1answer
20 views

Migration from SQL Server 2008 R2 to SQL Server 2012 SP2

I have many backups on my SQL Server 2008 R2 system, and I must restore them on new SQL Server 2012 SP2. My question is, after the restore on new SQL Server 2012, what can I do to verify that ...
-1
votes
0answers
6 views

Import a .bson file using mongorestore [on hold]

I'm fairly new to mongodb I'm having trouble setting up my connection. I have a mongod server running in the default port. And I want to load a specific .bson file onto that server (assume I do not ...
1
vote
1answer
30 views

Converting a string to an object reference

Sometimes I end up in a position where I have a string version of my object reference like so: 'server.database.schema.table' And I need to use it as an actual object reference: 'server.database....
1
vote
1answer
85 views

Should SQL Server 2000 throw an error if update statement fails within a SP?

I'm troubleshooting an issue on SQL Server 2000 where it appears that a update statement in a stored procedure failed, and the check for @@ERROR <> 0 didn't catch it, so the transaction was ...
2
votes
0answers
24 views

Query involving TVF very slow on SQL Server 2008

I have a query that runs in under 1 second on SQL Server 2014. A similar query takes over 12 minutes when run against a table on a linked server running SQL Server 2008. I don't know if it's because ...

15 30 50 per page