All Questions

0
votes
0answers
8 views

SQL Query: Selecting a person who is a member of all existing groups

I'm tinkering around with my very first SQL queries and am completely baffled by a problem I encountered. Let's say I have the following database: PERSON(PID, Name) MEMBER(PID, GroupID) How would ...
0
votes
1answer
10 views

TSQL vs SSIS Lookup

I was trying to find some well performing Tsql equivalents for the SSIS Lookup component. Especially for Fact table loading. After few different query patterns the most obv performed the best: ...
0
votes
1answer
11 views

Import CSV file - dynamic path

I am trying to import a csv file dynamically. This works: BULK INSERT #CSV FROM 'C:\Users\MyName\Desktop\Players.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) I would like to ...
0
votes
0answers
22 views

How to recursively find gaps where 90 days passed, between rows

This is a kind of trivial task in my C# homeworld, but I don't yet make it in SQL. like to form a resultset with a query like this. SELECT SomeId, MyDate, dbo.udfLastHitRecursive(param1, param2, ...
0
votes
0answers
4 views

Unexpected slow queries at random times

I have a moderate service, serving at most 100~ users at the same time. Mariadb slow log is open, and I occasionally see reports of slow running queries such as: # Time: 141123 19:48:38 # User@Host: ...
0
votes
0answers
8 views

XMLDB - Nodes to Rows

I have an application that stores XML as XMLType in a table. This is the first time I'm using XMLDB and XMLType features, and was wondering if I could use the results from an XQuery FLWOR expression ...
0
votes
0answers
13 views

Fast select = slow update, slow select = fast update

A query is super-fast when executed as a SELECT (#1), but when I try to UPDATE using the retrieved data, the performance starts to be unpredictable for me. For example, an UPDATE is faster with much ...
0
votes
1answer
8 views

MySQL rapid Data Replication from multiple Databases

I am a Freelance Web Developer but not a Database Administrator at all except basic Database Operations like DML etc. Today I got a client asking me to develop a Web based application but there is a ...
-1
votes
0answers
9 views

Transferring full database to another machine oracle 10.2 xe

We are having oracle 10.2 xe working on windows xp sp3(32bit). We need cloning/copying full database to windows server2008r2 machine(64bit). Any help.
0
votes
2answers
16 views

Granting permission on a particular job to execute on SQL Server 2005

An user is requesting permission on a particular job. How can I give him access on job activity monitor which shows only that requested job?
1
vote
1answer
15 views

MongoDB Insert Performance

I have some data which are aggregated in chunks and later pushed into another collection. The problem is that aggregated data pushing to another collection is very slow and takes from few hours and i ...
0
votes
1answer
26 views

Unknown column in 'where clause'

I've a query in my php script $result = mysql_query("SELECT State_Id FROM state_master WHERE State_Name='$statename'") or die(mysql_error()); $row=mysql_fetch_assoc($result); return $row['State_Id']; ...
0
votes
0answers
18 views

Continuously copying an SQLite table

I have a SQLite database associated with an online application (Skype) on my computer, which is often changed by that application when I am using Internet. These are the columns of the database: ...
0
votes
1answer
24 views

Is a query inside mysql IF clause allowed?

DELIMITER $$ CREATE PROCEDURE `InsertUser`(IN passwd VARCHAR(100), IN userType VARCHAR(20), IN mobileNo VARCHAR(20), IN refId BIGINT(20), IN companyName VARCHAR(100), IN companyMail VARCHAR(200), IN ...
5
votes
7answers
686 views

Professor told us to store Serialized java objects as blobs instead of defining relational tables

The title pretty much says it all, but my professor told us we could map objects to ids like this : id (int) | Serialized Object (blob) 1 10010110110 instead of actually ...
0
votes
3answers
33 views

SQL MAX function

Suppose I have a table with attributes Name, Age as follows: MyTable (Name, Age) Now, to get the oldest age I can write the following query: SELECT MAX(Age) AS "Oldest Age" FROM MyTable; ...
2
votes
1answer
27 views

How much space is needed to reclaim space from a table in INNODB

I inherited a MySQL InnoDB table that has approximately 200 GB worth of data, as well as several unneeded indices that amount to approximately 500 GB. I've archived approximately 75 percent of the ...
0
votes
1answer
16 views

11gR2 didn't ask me to set username or any password

I have installed Oracle 11gR2 (latest version 11.2.0.1.0) on my system. During the installation it didn't ask me to set username or any password. I'm unable to start sql plus because i don't have the ...
0
votes
0answers
10 views

reports on history table

Assume Trucks which travel between Cityies. I store the Cityies that a Truck has traveled to in TruckLocationHistory table, if the Truck is passing the City, State = Passed and if it gonna stays for ...
0
votes
1answer
11 views

check numeric column for empty cells

How can I check for a numeric column for empty values I want something like this: select * from table where column_numeric = '' This does not works obviously, but what can be the equivalent of ...
0
votes
0answers
9 views

db2_install do not have write permission on the directory or file

This is the error I encountered (I ran the db2_install and everything else as root,): DBI1288E The execution of the program /home/DB_SERVER/ibm/db2/v10.5 failed. This program failed because ...
1
vote
1answer
44 views

Can I trigger events based on timestamp data or should I use polling?

I'm asking this question for SQL Server 2008+ but this could really be for any DBMS. Imagine you have scheduled data, something like: ID Data Timestamp 0 NULL 2014-11-22 1 ... ...
-1
votes
1answer
29 views

how to select from two tables [on hold]

how to select data from two table like this table 1 ---------------------------------------------------------------- proid | uid | problem | prostatus ...
0
votes
1answer
14 views

How to retire a physical standby in Oracle 11.2

I have a production Oracle 11gR2 RAC database with a single node physical standby. Now it has become the time to retire the old standby and pass that role to a RAC on fresher hardware. We don't use ...
0
votes
0answers
16 views

self referencing tables with SQL and entity framework

I have many tables in a database and the tables are nearly identical. There are limitations currently on what objects reference other objects. For example I have company,contact and project. Contact ...
0
votes
0answers
7 views

SQLAnywhere: Real time databases replication, to prevent downtime by crash of machine server

I'm looking for options to prevent downtime of SQL Anywhere server, in case of failure of machine server. Is there solution, that will allow us in real time, to switch to different server? I mean, ...
0
votes
1answer
23 views

how are passwords encoded in pg_shadow

How are passwords encoded in column passwd of pg_shadow? Doing a: select passwd from pg_shadow; I see values like the following: md52c92c858aa1fa12144f1dcbd4ca9c3a0 ... which, doesn't seem to ...
0
votes
0answers
7 views

What does FTS_ file mean after converting from MyISAM to InnoDB?

I have convert some tables in database from MyISAM to InnoDB. After that, I see some modification on file system. The size of database is grown up, from 2.8GB to 4.8GB and there are many file with ...
0
votes
1answer
19 views

Prevent Primary Key increment when an INSERT statement fail in PostgreSQL

I have a simple table in my PostgreSQL database like this: CREATE TABLE person_type ( id serial NOT NULL, name character(55) NOT NULL, CONSTRAINT person_type_pkey PRIMARY KEY (id), CONSTRAINT ...
-3
votes
0answers
35 views

How do I show all records related to a user? [on hold]

I have a table in which a few records are stored, among others CSR and user. What would be the correct way to get all records where user's value = test? My SQL file: -- phpMyAdmin SQL Dump -- ...
-2
votes
2answers
48 views

What's wrong with my SQL statement? [on hold]

I'm trying to execute: create table `certificates`( `id` INT NOT NULL AUTO_INCREMENT, `common_name` VARCHAR(100) NOT NULL, `csr` LONGTEXT NOT NULL, `type` VARCHAR(100) NOT NULL, `certificate` ...
0
votes
0answers
44 views

Query execute slowly when changed compatibility Level of my database

I use SQL Server 2014 and have a database with compatibility level 110 (SQL Server 2012). also I have a stored procedure on it that execute about 10 second. When I change compatibility level of my ...
0
votes
1answer
24 views

PostgreSQL Role Configuration

I am using PostgreSQL 9.3. I am working with a friend of mine on a project on which both of us would need access to the same database and all of the permissions on every table. So I created a Role ...
1
vote
1answer
60 views

Error on DDL statement never invokes CATCH

When I try to close the SS Management Studio window below is the error I understand that DDL statements are implicit COMMIT and the below WARNING message is because BEGIN TRAN never COMMIT or ...
1
vote
1answer
4 views

SQL - Update table for a unique ID with multiple entries if one entry has variable in question

I'm trying to update a table to fill in a variable to each row in the table if one row for the unique ID shows that variable. I was trying to do the following, but it's giving me an error. ...
0
votes
2answers
36 views

Summarizing Pay Checks Based on Employee's Job Code

What I'm trying to do is summarize an employee's earnings for each job code they worked in for the year. Employees are assigned a job code based on an effective date. I'm trying to line up the job ...
0
votes
1answer
32 views

Database Normal Form (financial statement)

I would like some advice on how to design the database for financial statement data which objectively addresses the tradeoffs between usability, performance, maintenance and adherence to normal form. ...
0
votes
0answers
21 views

problem in connecting SQL Server for internet access

I'm having a problem connecting SQL Server for internet access. I have built a test server so that I can play at home and not kill the works server. I've been trying for days and so far I have: My ...
1
vote
1answer
17 views

Does a database update force index rebuild regardless of updated field?

With MySQL (InnoDB), I understand that having indexes slow down UPDATE queries. I would like to know if this happens regardless of what fields are updated. For example, if I have a table with 20 ...
0
votes
1answer
17 views

ORA-01033: ORACLE initialization or shutdown in progress using Oracle Express

I am using Oracle Database 11g Express Edition. I'm on Windows 7-64Bit I get this error when trying to access the database: ORA-01033: ORACLE initialization or shutdown in progress I set up the ...
0
votes
0answers
40 views

Size of Table Now vs 2 Years ago [on hold]

I am trying to Analyze the growth of the data/tables within a database. I would like to analyze how much Data is currently present in a table and how much there was 2 years ago. There are date fields ...
2
votes
0answers
39 views

Quirk update for cumulative sum of chances for a raffle. What can go wrong?

I need to make a raffle where users have different chances. | USER | CHANCES | |------|---------| | A | 10 | | B | 25 | | Z | 15 | Looking in this answer: drawing a riffle ...
1
vote
1answer
18 views

postgres materialized views and indexes to improve aggregate performance

I have a large table with a number of materialized views used for pre-calculating aggregates. New data is inserted only once a day so think of this as a data warehouse type system. Obviously when I ...
1
vote
1answer
49 views

How to get the SUM between dates in a WHERE clause?

I'm trying to get the SUM between each date in the WHERE clause of the following query, not the cummulative sum, but the sum for the period in between the dates. For example: Query: SELECT ...
2
votes
2answers
21 views

Joining two Mysql VIEWs takes a very long time

I have a textbox (for which I used jQuery auto-completion) in my PHP form where user can insert an actor/actress name and then by clicking "Search" button, a new window is opened showing list of ...
1
vote
1answer
14 views

can't backup 11.2.0.2 database after catalog upgrade to 11.2.0.4

(main question is 4th) 1. We today have almost all databases running with Oracle 11.2.0.2. Actually we have an RMAN database created (in 11.2.0.2) and a Catalog with user (called RMAN112) 2. We are ...
1
vote
1answer
55 views

How to combine two queries?

I can't explain this very well except by spelling it out. I start a query on ID, and from there I can get TITLE, DATE, and REGNUMBER. The problem is I also want to get 'where,' which is also stored ...
-2
votes
0answers
44 views

Joining Multiple Tables in Sql Query [on hold]

I have four tables with their attributes; namely Check_Gauge, Storage_Facility, Product, Product_Brought. The first three tables are related through their primary keys. Product_Brought is not ...
2
votes
1answer
16 views

MySQL table indexes change location

Is it possible to move the MySQL Table indexes to another location rather than "datadir" ? for example a ssd drive or memory partition ?
1
vote
1answer
26 views

Slow query performance on simple select

I have 2 tables: Organization (2.500.000 rows) City (35.000 rows) 'Organization' has 'city_id' set as foreign key to 'cities'.'id': Organization: ALTER TABLE public.organization ADD CONSTRAINT ...

15 30 50 per page