54 questions from the last 30 days
Advice
2
votes
15
replies
205
views
Practical tips for coding
I’m pretty much just getting started with coding and web development. To be honest, I’m not too bad at HTML and CSS, but I’m really struggling with dynamic web projects—I’m having a hard time using ...
Advice
1
vote
10
replies
168
views
Image upload to SQL PHP
After many hours of research I finally cracked the code to uploading images through POST and inserting them into SQL.
index.php:
Connect DB file to your index
require "db.php";
(prevents ...
Advice
0
votes
14
replies
120
views
PostgreSQL WHERE created_at <= timestamp slow on large table on (140M rows)
I have a large table (140M rows) with a created_at timestamp column and its taking too much time to execute.
PostgreSQL 14.20
Query:
SELECT *
FROM users
WHERE created_at <= '2026-04-17 00:00:00';
...
Best practices
0
votes
6
replies
179
views
The multiple choices in a database
I'm building a web application that has ~34 independent dropdown lists (e.g. currency codes, country names, user types, example statuses, etc.). Each list has no relation to the others — they're ...
2
votes
3
answers
137
views
Find the column given a data-value in SQL
I want to simplify (or more accurately, generalize) this query:
SELECT * FROM MRE_TABLE
WHERE col1 = 'my-data-val' OR col2 = 'my-data-val' -- OR ... there are 68 columns
I really do not want to ...
3
votes
2
answers
204
views
Unspecific error for Firebase Data Connect nested SQL inserts with _execute
I need to insert data in multiple tables at once in my Firebase Data Connect db with native SQL. When calling the mutation from my cloud function it fails and Data Connect will always throw the same ...
Advice
2
votes
9
replies
114
views
When to prefer application code for syncing denormalized columns over a trigger?
Take the example of SO: you have a votes table and a posts table. You want to keep in sync the vote count for each post but the votes table is the source of truth.
You can use statement level triggers ...
1
vote
2
answers
96
views
Intersecting Multiple times against the same table (set) on JOIN
Perhaps I'm missing something, and I know SQL is set-theoric, but I just can't figure this out.
Table Account:
| id | zip_code_id |
Table Package:
| id | name |
Table Account Package:
| account_id | ...
Advice
2
votes
6
replies
141
views
Parsing a field into multiple records
I'm not sure how to name what I want to do, or even if it's possible, but this is my situation. I have a table with 2 fields: ACCOUNTS & PROGRAMS. The PROGRAMS field is a concatenation of a ...
1
vote
1
answer
139
views
'offset ... fetch next ...' doesn't work as subquery
I'd like to create a temporary table with range of ids to reuse them in other queries. When I try this:
select ca.company_id
from company_account ca
order by ca.id desc
offset 0 rows
fetch next ...
Best practices
0
votes
5
replies
125
views
How to use concat
I'm analyzing wind speed and visibility data from 2023 in BigQuery, but the dataset wasn’t cleaned and missing values were entered as zeroes.
I'm trying to update those zeroes to NULL before running ...
-2
votes
2
answers
116
views
Row inserted without error, but not showing up in the table [closed]
I added this row and MySQL showed
1 row(s) affected
But even when I counted the rows before and after inserting the row, the count is the same. I believe it means the row was not inserted. Then why ...
Advice
1
vote
9
replies
168
views
Get Start date of a current partnership
I need to get the start dates of a partnership in different disciplines where the partnership previously existed but the individuals participated with other partners then resumed their partnership. I ...
-2
votes
2
answers
126
views
Basic SQL query to find all records using AND criteria
My database has a table Items of items using ID as the primary key. Another table Tags lists attributes of the items (Topic) using ItemID and Topic as a primary key. An item can have one or more ...
Best practices
0
votes
5
replies
87
views
Filling Null values with MEDIAN in Oracle Database table
I have table TABLE_ORIGIN with a primary key PK_ID and a numeric column COLUMN_NAME with some Null values.
I want to create a table called NEW_TABLE with columns PK_ID and COLUMN_NAME but I want to ...