0
votes
2answers
12 views

Help with PHP code, SELECT from database

<?php session_start(); include ('connection.php');?> <?php $username='pablorex192'; $consulta=mysql_query("SELECT question FROM users WHERE user = $username") or die ('This is the error: ...
0
votes
0answers
5 views

Mongodb find() operation sometimes extremely slow

I have a collection in mongodb (latest 3.0.4, not wiredtiger) with about 8 million documents. For the most part it's very fast but sometimes all reads to the database start stacking up and the culprit ...
1
vote
1answer
12 views

Postgres: Is migrating old records to separate table and creating new aggregated records a good strategy to improve search speed?

I have a table with 1M+ records. New records are created and updated each day each time an event occurs for each type of event (which there are many). I frequently need to find sums across many ...
4
votes
2answers
66 views

BI and DBA dev , where to start

I've read a lot about business intelligence development and database development, too. I have tried to work my way around a couple of courses on SQL Server 2008 however I feel kind of lost and I have ...
1
vote
1answer
10 views

RETURN TABLE is converted to RETURN SETOF int in Postgres function

I am trying to create a function that returns multiple rows in a single column named identifier, but the column keeps getting automatically renamed. I am executing the following in pgAdmin III: ...
2
votes
1answer
10 views

How to download Oracle Database 11g release 2 for Mac OS

I have been trying to download Oracle Database 11g release 2 for mac os but in the given link by oracle I can only see Linux x86 and Linux x86-64. Is this ok to use this Linux file for installing ...
3
votes
1answer
24 views

Select a count with some conditions

Using Postgres 9.4, I have a table page_views which has a page column. I'd like to select all the distinct pages and have a count before them and sort them descending. I'd also like to have a minimum ...
1
vote
2answers
17 views

Modeling invoices and orders

I have a problem in modeling a database that contains orders and invoices. Actually it's more of a problem from a business point of view, but it's related to modeling the database nonetheless. Model ...
2
votes
0answers
16 views

Modeling discounts - Product specific and Customer specific discounts

I have a reasonably simple database but have the following problem: I'm modeling a store + a lot of non-relevant stuff database. I have the following problem. I want to allow for specific products to ...
2
votes
0answers
23 views

What started this SQL Server job?

I'm looking at a SQL Server environment in which jobs start in several different ways. One way is from a job running on a different SQL Server. So, for example, "SQL Server A" runs a job named ...
2
votes
0answers
21 views

How to do Statistics in Partial Indexes of PostgreSQL efficiently?

This answer motivated think again my following tables but I am still uncertain how to store statistic data for quick selection. I think it is well done with partial indexes because only a subset of ...
1
vote
0answers
12 views

Microsoft Access Export to Excel

I have an Excel spreadsheet that is filled with a ton of data which is organized by column (a column for names, a column for occupation etc.). I have recently moved all of this data into Microsoft ...
2
votes
0answers
18 views

Introduce delay between master slave setup in MariaDB

We're using a master-slave solution using MariaDB 5.5.44. Is there a way to manually introduce a delay between the master and slave? I'm thinking of something like 1' or so. Is there a mysqld option ...
2
votes
0answers
8 views

SSRS - ERROR NUMBER:7357 while passing multiple value parameters using comma delimited string to stored procedure

I am working on a SSRS report to display the logins permissions in a set of databases on a specific server. the server, the logins and the databases are all parameters. NULL shows them all (logins ...
1
vote
1answer
16 views

Trigger is failing with no errors at all, why?

I need to UPDATE territory_id column at pdone.reps table by using and filtering results from veeva_new.userterritory so based on the answer I got here I am trying to build my own and this is how it ...
2
votes
1answer
15 views

automatically change value on the table mysql

i have table invoice in my database that contain atributes 'due date', 'date' and 'status'. What i want is data on 'status' change automatically. Example, status (unpaid change to expired) when date ...
1
vote
2answers
13 views

Any ideas on how to parallelize mysql_upgrade?

I am migrating from 5.5 to 5.6 and would like to speed up the mysql_upgrade process. I have thousands of databases per machine and 200 tables (innodb) per db. Any suggestion how to speed up the ...
1
vote
1answer
17 views

Information about a column and the data it holds?

I'm working with a table that has 3 different dates associated with each item in the table. I don't understand what each time is so I want to know if there's a standard place that the person who made ...
1
vote
0answers
14 views

Mysql high cpu usage - cpanel

After an update from whm, I see a high CPU usage from MySQL (5.6). my.cfg: [mysqld] slow_query_log=1 slow_query_log_file="/var/lib/mysql/slow-query.log" long_query_time=1 skip_name_resolve ...
2
votes
3answers
20 views

How to select a row based on the maximum value of a column, when ties are expected

SUBSCRIBER DATE TIME VALUE aaa 23-04-2015 04:04:07 10 aab 23-04-2015 12:04:32 5 bbb 23-04-2015 01:04:05 20 bbb 23-04-2015 ...
2
votes
0answers
12 views

Oracle error ORA-65052: statement involves operations with different container scope

I'm a relative newb to Oracle. I have set up an instance of Oracle 12c running on a RHEL 7 VM. I am connecting to the database created during installation through and running some installation ...
1
vote
0answers
12 views

Exporting SQL Server DB from my laptop to AWS RDS

I am following this tutorial from AWS to export a SQL Server database that currently sits on my laptop to Amazon Web Services RDS. In particular I am trying the Generate and Publish script wizard ...
1
vote
2answers
21 views

Postgresql: Insert trigger function fails on partial insert statement

We have some big tables in our database and the boss thought that partitioning would be a good improvement to our system. I was charged to investigate it and develop all the needed scripts in a test ...
0
votes
1answer
22 views

My TSQL table identity is incrementing way too fast

I have a table with pretty basic design 1 primary key (id), 1 unique column (filename)(the filename of the file I am tracking) the primary key is the identity column (bigint) (I had to make it bigint ...
0
votes
2answers
19 views

Why can't I get the available free space after shrinking?

My disk drive was full. So I deleted some records. Then I tried to shrink and it indicated available free space of around 5GB as indicated in the below image. Once I ran the shrink for data file, ...
0
votes
0answers
9 views

Party Data Model / Universal Data Model Example

I am trying to implement Party Data Model / Universal Data Model in our application which needs to store different relationships between entities (People, Companies). Example of relationships: ...
-3
votes
1answer
15 views

Implication of owned schemas for a user having db_owner privilege

Importance of "Schema owned by the user"? The user is db_owner for the db. Is it required to select owned schemas?, or else it will own all the schemas as it is a db_owner? Please provide me a detail ...
0
votes
0answers
17 views

Adding wiredtiger nodes to a non-wiredtiger replica set

Situation I have 3 nodes on a Replica Set (P+S+S). Mongodb version 2.6.9. I would like to migrate all the nodes to 3.0.4 wiredtiger. When I need to do that without downtime, I do the following ...
0
votes
0answers
6 views

Simple SSIS Package Failed User does not exist or has not permission

I created and build SSIS Package with "Transfer SQL Server Objects Task". I Copied the package.dtsx to network folder with permissions set to everyone. I created the SSIS Job where i set path ...
1
vote
2answers
11 views

Mysql user accesable with out password from the host machine but not from the remote machine

I have setup mysql and created a user 'test' and have given a password for it. Strange thing I observed is, for test user I am able to access with out password from the machine I have installed mysql ...
0
votes
0answers
21 views

Explain partitions

What does the possible keys, reference and rows indicate in explain partitions? I have used partitions on the table and I executing the explain partitions with a query: select ...
0
votes
0answers
22 views

Automatic failover mechanism for PostgreSQL

I need to have a automated failover setup in my production environment for postgres DB. Though I have explored various articles/blogs to achieve the same, I am not fully convinced on the methods ...
0
votes
0answers
5 views

Datavaulting polymorphic association (conditional) columns

I'm trying to implement data vault into our business but I'm stuck with the data vault model. We are having some source tables (3NF) which contain some polymorphic association (conditional) columns: ...
-7
votes
0answers
10 views
3
votes
1answer
63 views

Unable to shrink log file due to snapshot replication

Our database log (SQL Server 2008 R2) is growing too big, and truncating it via DBCC SHRINKFILE doesn't work (the database is set to simple recovery mode). A bit of background. I released some ...
-6
votes
0answers
20 views

How to join more than one table [on hold]

I'm stuck with one SQL query, the result as the image below : Could you help me to solve this problem? I already tried but the result is repeatly. And I don't know why? I followed the link How to ...
1
vote
1answer
28 views

Cannot create a row of size XXXX which is greater than the allowable maximum row size of 8060

I have a scenario where some inserts/updates are failing due to maximum row size of 8060 limitation. I have a table with lots of varchar 250 to 500 columns, numerics, datetime columns. I was trying to ...
7
votes
2answers
74 views

SARG cardinality estimate, why not full-scan?

Why there is no full-scan (On SQL 2008 R2 and 2012)? Test data: DROP TABLE dbo.TestTable GO CREATE TABLE dbo.TestTable ( TestTableID INT IDENTITY PRIMARY KEY, VeryRandomText VarChar(50), ...
2
votes
1answer
25 views

Is there any difference between 'LIMIT 0, 1' and 'LIMIT 1'?

I recently stumbled upon example codes, which differed by these notations. SELECT * FROM table LIMIT 0, 1 SELECT * FROM table LIMIT 1 The first argument should be considered as the offset if I'm ...
0
votes
0answers
13 views

nbsp character might not be passing as nbsp to the MySQL backend

I am following a tutorial where a web application written in PHP, blacklists spaces from the input(The 'id' parameter). The task is to add other characters, which essentially bypasses this blacklist, ...
1
vote
1answer
81 views

Does PostgreSQL support online schema modification (DDL)?

Recent versions of MySQL (using InnoDB) support many alter table queries without exclusive locking the table. Does PostgreSQL support this to any level? That is, can I add/drop columns from a table ...
2
votes
1answer
38 views

Database Table Design

I would like to ask couple of questions regarding my schema table design. I have the following data coming from an external database where I do not have any control over it. PROD_NO PROD_NAME ...
1
vote
1answer
27 views

What transaction logs are for

I'm confused about tranasaction logs for SQL Server. I was under the impression they can be used to roll the database forward. For example say I made a software release on Sunday, I added three new ...
-2
votes
0answers
15 views

performance of dml statements in mysql [on hold]

how can we increase the performance of insert and update statements in mysql procedure. and also if a procedure has only updates statements Blockquote ...
1
vote
1answer
14 views

Database design, many rows or many columns?

I am aware that this has been discussed before, but I've read conflicting information about this particular topic, so I'm hoping for a bit more decisive opinions from you. I have multiple tables, ...
-2
votes
1answer
24 views

Like operator in postgresql [on hold]

how to check the reverse of the original word using like operator? For Eg: victoria state------state victoria This is the query i tried: SELECT DISTINCT ON (t1.name) ...
0
votes
0answers
12 views

How Columns_update() Function Works in Trigger To Find Updated Columns Name

I am in confuse about trigger function Columns_Update(). i Have Basic Idea about this function that it returns a varbinary and it is use to get updated Columns in Trigger even i have Find The code ...
1
vote
1answer
20 views

SQL DB Permissions so anyone can modify the DB

I'm teaching a class on SQL Server 2014, and want students to be able to restore a Db I give them and then be able to take ownership and modify tables, and also to view the database diagram. ...
1
vote
1answer
34 views

Update records from one table to another in different databases where condition is accomplish

I have two tables stored in two differents DBs and I need to perform some sync between both tables based on lastmodifieddate and lastSyncAt. Let's call them as db1 and db2. This is the DDL schema for ...
-1
votes
0answers
18 views

A good DB Design

I want to design database where possible types of questions are Primary Question Set --> Secondary Question --> Question Primary Question Set --> Question Question. I short some question have ...

15 30 50 per page