All Questions

0
votes
0answers
3 views

A first nod in the right direction, please

I'm just after a pointer really. I've had an idea. I want to produce a database. One where information is stored about certain items. The items have certain properties. Some of these properties would ...
0
votes
0answers
4 views

Architecting postgres jsonb for an analytical workload

I have a rails app that is powered by postgres hosted on heroku. My Postgres database makes heavy use of jsonb data type. There is demand for read heavy analytical queries but it is slow and ...
0
votes
0answers
6 views

Transforming rows into columns using a specific condition

I have a table with the structure as attached in the Table Structure file.  Student Id     CourseNumber   ClassNumber InstructionID  InstructorDept Grade Pass/Fail But there are multiple students ...
0
votes
0answers
9 views

Aggregate query and table design for large log table

I am in the process of designing an append only event log table for the purposes of fast inserts, batch reads, batch writes and batch deletes. there will be millions of items inserted and deleted ...
0
votes
1answer
10 views

SQL query to replace attribute value with another attribute value- postgre

I have a table on PostgreSQL as below: id | user_id | attribute_key | attribute_value I have data in the table as below: 1 | 1 | first_name | Jesus 2 | 1 | last_name | Christ 3 | 1 | Email ...
0
votes
0answers
13 views

Dump result sets as csv file on remote

Please forgive my question if it sounds trivial. I would like to dump the result sets of a query to a csv file on remote postgres server (on a very large table), so that when done I can copy the file ...
0
votes
0answers
17 views

Restore a 140GB - 292 Million entrie MySQL-Database faster?

i need help. I have an old innodb Server and my storage limit reached. I dont use files per table entries because in old times there were no ability at this time. My ibdata grown up fast and there is ...
0
votes
0answers
9 views

How To Prevent Live Servers From Detecting a Forced Failover?

We are using an AlwaysOn Availability Group in SQL 2017 on Windows Server 2016 which consists of two servers on our primary site and one DR server on a remote site. We recently did an internal IT DR ...
0
votes
1answer
23 views

Sum between multiple joined tables

I have these tables: DROP TABLE IF EXISTS books; CREATE TABLE `books` ( `bookId` mediumint(8) UNSIGNED NOT NULL, `title` varchar(10) NOT NULL, ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `...
0
votes
0answers
26 views

How to solve problem when oracle apex does not let me do anything with my created schemas even though i should have privileges?

i have a problem with with latest version of APEX, i have installed it on my pc, i logged in as and admin created workspace with schema, but when i log in to that workspace as a user with admin's ...
0
votes
1answer
18 views

PostgreSQL getting the latest value

I have started working on a postgreSQL database. There is a table keeping the record of stocks and every time a record is updated, a copy of the original row needs to be kept, with a flag added to say ...
4
votes
2answers
85 views

Full backup on database creation

When new databases are created the Differential and transaction log backup maintenance plans start failing and sending alerts as full backup is not taken. What could be the best solution to handle it. ...
0
votes
0answers
24 views

NpgsqlException: ERROR: 22P02: invalid input syntax for type json

I have the following JSON string: {"packedRecipeType":"DynamicCharacterAvatar","name":"Character","race":"HumanFemale","dna":[{"dnaType":"DynamicUMADna","dnaTypeHash":1932961400,"packedDna":"{\"...
0
votes
0answers
15 views

What's the maximum number of partition per table I can/should have in MySql 8?

I have around 1T (1,000,000,000) records of products belong to 500,000 accounts. Each product record have the account_id and since I always query within a single account context (there are no cross-...
0
votes
3answers
26 views

Are the switches for the SQLCMD command case sensitive?

I have MS SQL Server 2014 Management Studio installed on two computers, both of which run on Windows 10. The switches for SQLCMD command are case-sensitive on one computer, but it is not on the other ...
-3
votes
0answers
12 views

how to exclude specific checkbox id using javascript [on hold]

I want to exclude specific checkbox id in query selector. Here is the below sample code but it does not work form me. document.querySelectorAll('input[type=checkbox,input:not[id="#chkList_0"]]:...
0
votes
0answers
13 views

How can I start the oracle 12c Enterprise manager cloud control on windows 10?

I have installed Oracle 12c in Windows 10. The installation was successful and the RDBMS and the database that I created are working properly. I am able to access enterprise manager express via ...
0
votes
1answer
12 views

Error: There is a column named in table “*SELECT*”, but it cannot be referenced from this part of the query

Assume we have a simple table, CREATE TABLE foo ( a int PRIMARY KEY, b int ); I'm wanting to write a complex query inside and refer to that query INSERT INTO foo SELECT 5 AS z ON CONFLICT (a) DO ...
3
votes
1answer
56 views

How can I specify the last parameters in a function call and let the others default to the DEFAULT in the declaration?

I have a function with 5 parameters, arguments p1, and p2 are mandatory arguments p3, p4, and p5 are optional and have a DEFAULT set The function looks like this, CREATE FUNCTION test_func( p1 ...
1
vote
1answer
32 views

Why can't temporary tables reference regular (non-temp) tables in PostgreSQL?

Why can't temporary tables references non-temp tables in PostgreSQL? When I run the following CREATE TABLE foo ( a int PRIMARY KEY ); CREATE TEMP TABLE bar ( a int REFERENCES foo ); I get, ERROR:...
0
votes
0answers
31 views

grant privileges for dbms_crypto

I am trying to use dbms_crypto package but I get the error: identifier 'DBMS_CRYPTO' must be declared I granted execute for my user but still get the same error. Maybe someone can give me some ...
-2
votes
0answers
9 views

MongoDB Shutting Down

ran 'mongodump' on the secondary node mongod crashed with 'got signal 6 (aborted)' in mongodb log Environment: VM centos 7, mongodb 3.2.10
0
votes
1answer
27 views

mysql 5.6 replication log-slave-updates doesn't work

We have a setup of master -> replication -> replication the dbs are: mysql 5.7 -> 5.6 -> 5.7 on the replication 5.6 we have the following my.cnf: [mysqld] default-storage-engine=InnoDB ...
0
votes
1answer
9 views

Concatenate two columns into one column in a view in MySQL

I am trying to create a view and would like to display the firstName and lastName columns from a table as one column (User) in a view. The view is using a left join. What I would like to do is join ...
1
vote
0answers
35 views

UNIQUE constraint encompassing all the columns of a table - is it bad practice?

Is it considered bad practice to have a UNIQUE constraint applying to all columns on a table, essentially enforcing unique rows? My use case is to store tokens from textual message from various ...
0
votes
0answers
25 views

Can't run the newest version of MySQL on phpMyAdmin

I am building a database on phpMyAdmin. However, it doesn't include the latest version of MySQL: I downloaded the latest version of MySQL from this link: MySQL Community Server 8.0.16 However, even ...
0
votes
0answers
42 views

SQL Server Database Diagram

I am using SSMS v18, I need to create an ER diagram from my database. As Microsoft removed diagram from new version of SSMS (v18) so now How can I get a diagram for my database??
0
votes
1answer
14 views

convert date to timestamp and store into table using trigger mysql

Using trigger I convert DateTime into a timestamp and then store into another table. But somehow convert date into timestamp always affected by timezone so that's why I had use convert_tz of date and ...
0
votes
1answer
18 views

how to select rows which are mapped to a pivot table in a many to many relationship?

I have three tables, locations(Has zipcode, location name), professionals(has name) and locatin_professional. I want to select only those rows from locations table where professional_id is 4. Whats ...
0
votes
0answers
14 views

Clarifying the connection between TimePlan and the daily routine of work

I'm creating a new database and I have an uncertainty between the two tables (Timeplan and DailyRoutine), how to make a dayiluroutine connection for each day. The idea is to write in the Timeplan ...
2
votes
2answers
31 views

How to express an empty relation (or table) in PostgreSQL?

Is there a way to express an empty relation in SQL without actually creating an empty table? For testing purposes, I want to find a way to test something like: SELECT count(*) FROM (...) ...
0
votes
1answer
17 views

Should i place Registered-Users Info in every table? to Restrict user access to his Own Data only

Database: Relational Database - MySQL I am making a database with multiple tables. In order to see his data from tables, User will need to log in. I only need to display those information(through web-...
0
votes
1answer
20 views

Insert 15 million records with data from other table

I have a table with 15 million records and 15 columns. I want to copy some of the data (2 columns) from this table to another table. My current query: INSERT INTO new_table (col1, col2, col3) SELECT ...
1
vote
2answers
29 views

What permissions are required for UPDATE STATISTICS #table WITH ROWCOUNT = xxx?

Can anyone point me to the correct documentation or additional permissions I need besides SA to do the following? When I run it, I receive the following error: Cannot find the object "#test" because ...
-2
votes
1answer
34 views

Questions about Full-Text Search in SQL Server

If I load a 150kb text file into an nvarchar(max) column, then select the results and paste them into notepad, the resulting file is only 42kb. Second question concerns 8kB pages. What influence have ...
0
votes
0answers
17 views

How can i write an update trigger between two tables

i have two tables one is called defaulters and users .defaulters has mypin and debt_amount and users has mypin and debtor .i want a trigger that update debtor in users table if mypin exist in users ...
0
votes
1answer
13 views

mongodb schema design advice

I have a users index which has fields like id, email, password, etc. A user can see all other users except the ones who had blocked him. I want to design a database schema for this problem. So I'm ...
0
votes
0answers
11 views

Mongodb Replica Set Collection Has Different Document Count

I've created a new 3 node replica set and rsync'ed data from an existing mongo database for initial population. The secondary nodes went into STARTUP2 mode and seemed to successfully sync from the ...
1
vote
1answer
13 views

mysqldump changes primary key to unique key?

While attempting to dump and restore a WordPress database in MySQL, I noticed that mysqldump seems to be changing the PRIMARY KEY on several tables to a UNIQUE KEY instead. For example, this tables: ...
1
vote
0answers
19 views

Is there any special configuration for SQL Server implementing Routing List in a heterogeneous enviroment (Client and Server in different domains)?

I had implemented successfully SQL Server Routing List Feature many times... but I have a very special scenario where our Reporting Services Node is located in a different Domain than SQL Server Nodes....
0
votes
0answers
12 views

SQL Mirroring - Application not pointing to new Primary

Im stuck with a connection string issue this is my connection string. <add name="APP01" connectionString="Server=10.169.0.2; Failover Partner=10.166.0.2; Initial Catalog=DB2017; Integrated ...
0
votes
0answers
21 views

One table or two tables?

If one table, let's call it table_1, has a composite alternate key made up of field1 and version, is it considered denormalized data, since field1 is repeating itself in the table (multiple rows with ...
-1
votes
0answers
35 views

How can a datatimeoffset in UTC be converted to the local time?

In SQL 2012 how can I convert a UTC datetimeoffset to local time zone?
0
votes
1answer
13 views

MYSQL - Error in After Insert trigger affects the actual insert on the trigger table

I have two tables call it - table_1 and table_2 I have an After insert trigger on table_1 and in the trigger I insert on table_2 which has some fk constraints on another table_3. When the insert on ...
0
votes
0answers
15 views

SQL agent job for long running queries

I am trying to setup an alert where the application team can get the notification on their event viewer for any queries which are running longer than 2 minutes. This is what I have so far. For some ...
4
votes
2answers
40 views

Grouping rows in ranges

Let's say I have the following (contrived) table of monitoring data: RowID DateStamp Success Error ----- ----------------- ------- ----------- 1001 5/...
3
votes
2answers
42 views

Proper normalization for an Orders table--whether to split or no

Each order has a unique SalesOrderNumber. An order is made up of various PartID numbers, each with an associated OrderQuantity number. I have the following table currently in my model: I'm ...
3
votes
1answer
13 views

How can I check if my user has create index permission?

I'm working on a .NET library that is used with a third-party product I support. My library may be used with many different versions of the product. I don't control the schema of that product, but I ...
0
votes
1answer
14 views

How can I import an old pgdump into an updated schema?

I'm DB newb doing a software upgrade, and my predecessor's original migration plan may not have been as well thought out as I thought... The Plan was to use our backup, created via pg_dump -U derp -...
0
votes
0answers
7 views

How to restore Postgres cluster from pg_probackup archive

I'm trying to configure continuous backup solution using pg_probackup tool. So far I did the following: Configured archive_command according to the docs Created backup using pg_probackup backup ...

15 30 50 per page