Questions tagged [rdbms-agnostic]

For SQL related questions that is not targeted for a specific database product.

Use this tag when asking general SQL questions:
When targeting an unknown ,
or when targeting multiple systems.
(if, for instance, you are looking for a solution that will fit both MySql and ms-access).

33 questions
2
votes
2 answers

Storing java.math.BigInteger in an RDBMS

I need to store Java's java.math.BigInteger numbers in SQL. I can safely assume that the numbers will be positive and less than 2^k for some k that will be known at table creation time. Lets say k = 256. How do I store it in an RDBMS such that it…
Jus12
  • 17,824
  • 28
  • 99
  • 157
2
votes
8 answers

SQL join problem

I want to retrieve all records from one table when there are no matches in the second table. So it is kind of the opposite of an inner join.
poo
  • 1,095
  • 4
  • 13
  • 21
2
votes
2 answers

How do I join a one-to-many table with results only appended to the smaller table?

Basically I have a one-to-many table. I want to append the columns of the larger table to the result set of the smaller table. I will end up with a result set the same size of the smaller table, but again, with the relevant information from the many…
Zombies
  • 25,039
  • 43
  • 140
  • 225
2
votes
8 answers

How to best implement a 1:1 relationship in a RDBMS?

Yesterday while working on a project I came up on a peculiar 1:1 relationship which left me wondering - how to best implement this (clearly, we had done it wrong :D) The idea is that there are two types of entities, A and B. They can each exist on…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
1
vote
4 answers

sql data where not exists in a table and not duplicate

its a bit tricky please focus on my requirments, I have 2 tables , I want to get data from first table where not exists in the second AND the data in first column are not duplicate for sub id and child id. example: I have this table tab1 id …
Moudiz
  • 7,211
  • 22
  • 78
  • 156
1
vote
1 answer

Key-value pairs for metadata/tagging in RDBMS: efficient storage

I know that key-value pairs aren't good database design, aren't normalized etc however in this case I believe they are the most appropriate solution. My excuse for this, and some background: A large set of items is being pushed into a set of tables,…
Kieren Johnstone
  • 41,277
  • 16
  • 94
  • 144
1
vote
2 answers

nosql example, which engine?

a) I have 1000000 domain names b) Every domain has about 100000 sites c) each site has about 10000 visits daily / (5000 unique visits daily) d) As the owner of all those websites, I want to see, how many visitors on selected sites I had in a…
astropanic
  • 10,800
  • 19
  • 72
  • 132
1
vote
0 answers

Does adding minus sign make query argument un-SARG-able?

Does adding a minus sign in front of a column reference in a SQL statement prevent the query processor from using an existing index on that column to process the query? i.e., would the following use an index on id if one existed, or would it need…
Charles Bretana
  • 143,358
  • 22
  • 150
  • 216
1
vote
1 answer

What performance gains can I expect from database paging?

Say I have a table X with 100 records in it and that running a select * from X takes 100 seconds. How long should I expect the query select top 10 * from X to take? I'd expect that the relationship is more or less linear so 10 seconds. Is this…
StevenWilkins
  • 1,313
  • 8
  • 18
0
votes
0 answers

Calculate length of sequence - SQL

I have a table consists person id (id) and a flight date (date). Each person may have few flights in different dates. If 2 flights are a week or less apart, they are considered the same trip. For example, for person id #2: 2022-05-20 -> 2022-05-23…
Dave R
  • 1
  • 1
0
votes
1 answer

Client/server architecture of data base systems

What is meant by client/server architecture in fundamentals of Database systems? I didn't get any proper answer from google. It will be better for me if you provide some resources.
0
votes
1 answer

How to make select query more efficient?

I have a table Customers with Millions of Records on 701 attributes ( columns ). I receive a csv file that has one row and 700 columns. Now on the basis of these 700 column values I have to extract the ids from the table Customers. Now one way is…
Desperado
  • 5
  • 4
0
votes
2 answers

Do database engines other than SQL Server behave this way?

I have a stored procedure that goes something like this (pseudo code) storedprocedure param1, param2, param3, param4 begin if (param4 = 'Y') begin select * from SOME_VIEW order by somecolumn end else if…
Yishai
  • 90,445
  • 31
  • 189
  • 263
0
votes
1 answer

Sets of sets of sets? Or, implementing versioning for sets of sets

I'm working on a web app for a quality control checklist. I already have a table set up, but I have a hunch that our model is sub-optimal and I could get some better performance. Please not that I'm using mysql, so I'm limited to its…
user151841
  • 17,377
  • 29
  • 109
  • 171
0
votes
5 answers

'questions' and 'answers' with multiple answers

This question is related to this post: SQL design for survey with answers of different data types I have a survey app where most questions have a set of answers that are 1-5. Now we have to do questions that could have a variety of different answer…
user151841
  • 17,377
  • 29
  • 109
  • 171