0
votes
0answers
6 views

Products with different prices in an order

I have a "classic" database schema for order and products: Orders ------ id etc. Products -------- id name etc. Order Products --> Pivot table -------------- id --> some people don't like ...
1
vote
0answers
9 views

QUERY - join two tables based on date and filter results

My apologies for the cryptic title. I guess my inability to condense my question into a title is indicative of my inability to come up with an answer to the following: I have data in two tables (MS ...
0
votes
0answers
6 views

Decomposition of complex queries

select c.ssn,c.cname,c.address,c.ph,c.age from customer c,account a,acc_cust ac,loan_cust lc where c.ssn=ac.ssn and a.accno=ac.accno and c.ssn=lc.ssn and a.atype='joint' group by ...
0
votes
0answers
3 views

Linked Server Mysql Workbench

Is it possible to use 2 MySql Workbench at a time by connecting it using Linked Server? Or is there any other alternative? By the way, I'm working on a web application with jsp and java.
0
votes
2answers
15 views

SQL Server auto restore only log where not restored before

i want to make an auto restore script for the transaction log only i have found the script to restore log in directory which have named with dbname_timestamp.trn the problem is this script will ...
0
votes
0answers
2 views

Cannot start both neo4j development and neo4j test servers

I have a Rails application backed by a Neo4j database. I've installed both a development server and a test server, as explained here and here. Each server works fine when started up alone, but if I ...
0
votes
1answer
11 views

Splitting a large table

My scenario is I look after an old system with a VB6 based front end and a SQL back end (good news, the replacement is being developed but in the meantime I need to keep this up). Now the application ...
0
votes
1answer
6 views

Does Oracle randomly switch execution plans to check if there is a better solution?

I had a talk with an external colleague about oracle "swinging in" its performance. In detail it was about, that oracle optimizes its execution plans for the same query by time. I don't talk about ...
0
votes
0answers
9 views

is it possible to use SQL Server listener IP to the application?

I have 2 application servers and I have SQL Server clusters with always on high availability. I need to point my application server database to the SQL Server listener IP. Is it possible ? if so ...
0
votes
2answers
23 views

When to use DISTINCT

When is it good to use SELECT DISTINCT .. and when not? Basically whenever I see DISTINCT keyword I start to get cautious as most of the cases it is ends up finding that actual query has some ...
-5
votes
0answers
6 views

Write a query to produce a report that looks like the example table below for Feb 2015 [on hold]

Country codes for the US, UK and DE are US, UK and DE respectively. Date # Customers Revenue US Revenue UK Revenue DE Revenue Other Revenue All 2/1/2015 8,476 $11,245 $7,839 $2,098 $6,707 $27,889 ...
0
votes
0answers
3 views

DB schema for storing the process tree of linux

I search a db schema to store the process tree of linux every half hour. Platform: PostgreSQL on Linux. I am unsure where to split all the data into columns or to use a json column. Which one is ...
0
votes
0answers
7 views

Postgresql CREATE SEQUENCE using expressions for parameters

I've been playing with PGSQL for a week or so and I'm seeing if it's possible to set the min/max values for a sequence using an expression. The specific goal is to automate create-scripts for disjoint ...
0
votes
0answers
3 views

MySQL 5.6 Online DDL lead to to much table-metadata-locks when I just add index

It's normal that table-metadata-lock shows up for a short time when ALTER TABLE t add index ... starts and ends. But I have encountered all DML operations blocked in Waiting for table metadata lock, ...
-1
votes
0answers
5 views

sqldeveloper importing data from delimited file

When importing data from a tab delimited file with sqldeveloper, it is rounding off "NUMBER" fields. How to avoid this ? Eg : 2392785159286777182 is imported as 2392785159286777170 (last two digists ...
3
votes
1answer
12 views

Multiple Filters for Databases on SQL Server Server Level Audit

I am attempting to create a Server Level Audit to track Database Level events in SQL Server 2014. I know I can create them at the database level but I want the audits all databases at the server ...
1
vote
0answers
4 views

How did you setup MySQL Replication with autofailover that is app transparent?

Recently told MySQL is shelving MySQL Fabric. Interested how others have implemented a MySQL replicated environment that is app transparent. I am considering using HA Proxy to host virtual IP ...
1
vote
1answer
18 views

MySQL data types for common columns

I have been a frontend programmer for a while and moving to making some applications on my own and becoming a full stack engineer. I have worked with plenty of databases for applications and sites but ...
0
votes
0answers
29 views

Unable to remove the database name

One of the databases is getting to suspect mode. Since I have backup, I restored the same database with different name and then take the SQL SERVER and remove the data and the log file of the ...
0
votes
1answer
15 views

Mysql scaling up vs scaling out

I have an application where each client gets their own database. This is for security, backup ease, and portability. It provides great flexibility and performance has been fine. I am up to 300+ ...
1
vote
1answer
47 views

Trace flag 2861 and what a 'zero-cost' plan actually means

I'm trying to get my head around trace flag 2861 and what it actually does with trivial queries? The blurb says: SQL Server typically won't cache plans for these trivial queries because the cost ...
4
votes
1answer
49 views

What are the “GDR” vs “QFE” hotfixes for SQL 2008 R2 SP3?

I'd always assumed that higher patch numbers were necessarily later releases, but now I'm not so sure. Looking at the SQL Server Build List for SQL 2008 R2 SP3, there are two possible ways to apply ...
4
votes
1answer
51 views

Count instances of value in multiple tables

I'm attempting to write a query that returns the count of a given value across multiple tables. Right now, I'm using the following query SELECT COUNT(*) AS SL, ( SELECT COUNT(*) FROM [Sales Line ...
0
votes
1answer
33 views

Querying a date range

i query this SQL query: SELECT * FROM [DB].[dbo].[Table] WHERE [DATE] BETWEEN '01-01-2016' AND '31-03-2016' AND ([TIME] >= '00:00:00' OR [DATE] > '01-01-2016') AND ([TIME] <= '00:00:00' OR ...
1
vote
0answers
22 views

Quorum Questions For An FCI And AlwaysOn in a WSFC

I was reading the white paper on FCI + AlwaysOn as well as several other resources on quorum voting differences in Windows Server 2008 and 2014 and had 3 questions. 1- Will giving a node in the ...
0
votes
0answers
29 views

Deadlocking on two update statements

Server Info: Microsoft SQL Server 2005 - 9.00.5057.00 (X64) Standard Edition (Build 7601: Service Pack 1) I have a table called LAB it has about 38 million rows in it. The primary key is a single ...
1
vote
1answer
15 views

Conditional relationships? One-to-many relationship using a pivot table for only a type of entity

I have the following tables: users: - id - name - user_type_id (references id on user_types) neighborhoods: - id - name homes: - id - house_number - neighborhood_id (references id ...
2
votes
1answer
16 views

PowerShell Pipeline Binding examples on SQL server?

I am learning PowerShell, my training machine (VM) is a Windows Server 2012 R2, with SQL 2014 and PS 4.0. I am try get a handle on the two Pipeline Binding methods ByValue & ByPropertyName. I am ...
1
vote
0answers
18 views

Why is Server Configuration in Pgadmin3 inaccessible for me?

My Postgres server is running (localhost:5432), but Tools > Server Configuration is greyed out for me as below. I was attempting to access it to edit/locate my postgres.conf file.
1
vote
1answer
15 views

Storing email inbox information

I am working on a webmail client. I want to store the remote mailboxes information in a Postgres database. As a general rule of thumb, most IMAP servers will have a similar default folder structure ...
0
votes
0answers
14 views

How to set up repl_distributor for data access

I need to run queries on the distributor server from the publisher during deployment in a transactional replication setup. I see repl_distributor is set up as a linked server, but am having trouble ...
1
vote
1answer
63 views

Scheduling index rebuild jobs

I have a MS-SQL 2014 SP1 - two node AlwaysOn AG (One Primary and an read-only secondary) with about 10 databases sizing 20-30GB in total. I have some queries regarding scheduling index rebuild and ...
0
votes
1answer
18 views

Select MySQL with 2 tables conditions, Is this right?

Tables: agencia (nome_agencia, cidade_agencia, fundos) cliente (nome_cliente, rua_cliente, cidade_cliente) conta (nome_agencia, numero_conta, saldo) emprestimo (nome_agencia, numero_emprestimo, ...
0
votes
2answers
35 views

Update Grouped records

I have the following query that returns duplicate values: SELECT [t].[Field1], [t].[Field2], COUNT([t].[Field2]) FROM [dbo].[Table1] AS [t] WHERE [t].[Field2] <> '' GROUP BY ...
0
votes
1answer
25 views

Why does SQL Server truncate my nvarchar(max) string in an expression?

It looks like a 2nd variable in an expression is determining the maximum length of my 1st variable. An example is easier to explian: DECLARE @MyDest AS NVARCHAR(MAX) = 'Some long text, for testing'; ...
0
votes
0answers
15 views

Is there any way to automatically keep data in a table in sync with multiple other tables without materialized views?

I would like to create some materialized views in Redshift to aggregate the information stored in several tables and keep the data in the views in sync with the source tables. Unfortunately, Amazon ...
1
vote
1answer
25 views

Login in Always On Availability Groups

I am new to Always On Availability Groups and I am little bit confused with creation of logins. Let's assume an environment NODE1(Primary) & NODE2(secondary) & NODE3(Stand by) & ...
0
votes
0answers
23 views

Oracle 12c cannot start up after having failed to enable Extended Data Types

I upgraded my single instance oracle to 12c on CentOS 6.7 for the benefit of having 32767 bytes varchar2 and I followed below nice article until stopped half way when executing utl32k.sql script. ...
0
votes
0answers
14 views

MySQL 5.5 to 5.7 doesn't work, apparently this is a feature?

Has anyone found a way yet of circumventing MySQL 5.7s insistence that it's Master must have a server_UUID. I currently have multiple instances of MySQL 5.5 over various sites, and want to look at ...
1
vote
1answer
69 views

Troubleshooting extremely long running query (SQL Server 2012)

We have a purchased reporting application that executes a query that just recently is taking an extremely long time (>2 hours). A week ago, this same query completed in less than a minute. I've ...
2
votes
2answers
45 views

RMAN DUPLICATE from backup without Target or Catalog: How is the aux instance created?

I am trying to duplicate an Oracle database based on backups to test if they can be used in case of complete system failure. Hence, I want to do this without a connection to the source database. I'm ...
0
votes
0answers
5 views

Security on MongoDB

I have been reading up on the security of MongoDB. If my web app lives on the same server as the DB, can I just set the bindIP to 127.0.0.1? I'm not sure what the best practices are, but this should ...
0
votes
2answers
26 views

Filter date and less and show column data - 1

and sorry for the title of the thread, I really don't know how to call this else I'm working on an view where I need to get a little tricky data. I'll try to explain it as easier and better ...
0
votes
0answers
17 views

Getting count mismatch for output records

I want count of incorreclty routed task .first query count is correct 1. select * from statuschanges where incorrectlyrouted='t' count=388 and when I modify it according to requirement as ...
0
votes
1answer
29 views

Accessing computed column in a nested query

I am using nested sets to represent tree-type date in SQL-Server and basing what I'm doing on this article: http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/ by Mike Hillyer. In ...
-3
votes
0answers
19 views

Get the output of a stored procedure into a table [on hold]

Can anyone help me with a table that takes the output from a stored procedure. It should not be a temp table or table valued parameter. I am able to insert values to the table, but when I use select ...
0
votes
1answer
16 views

Postgres LEFT JOIN with recurring dates and users

I'm trying to get a query to show me if users have a record on a particular day, and if they don't it would return a NULL. What I have so far is a I create a sequence of days, then LEFT JOIN it, if I ...
1
vote
0answers
8 views

Operational issue for scheduling mongodump as backup method

For production backup, MongoDB recommends mongodump instead of mongoexport for accuracy of data. However, a few operational issue remain unclear to me, appreciate if anyone can advise on this matter. ...
0
votes
0answers
7 views

Postgres archive_command on Ubuntu 16.04

Ubuntu 16.04: Postgres 9.5: When i start psql -c "select pg_stop_backup();" command to execute for hot standby replica. It gives me warning as archive_command as: NOTICE: pg_stop_backup cleanup ...
0
votes
1answer
27 views

MySql timeouts waiting for table lock, no apparent deadlocks

I started having the following error on two different applications that write to the same database and table: Lock wait timeout exceeded; try restarting transaction At the beginning I thought it ...

15 30 50 per page