Skip to main content

Questions tagged [sql]

Structured Query Language is a language for interacting with relational databases. Read the tag wiki's guidelines for requesting SQL reviews: 1) Provide context, 2) Include the schema, 3) If asking about performance, include indexes and the output of EXPLAIN SELECT.

0 votes
1 answer
69 views

PowerShell to query SQL database with a string from a filename

I am trying to write a PowerShell script that will check a folder for any files and then for every file it will grab part of the filename and check it against the SQL database. If it found a match, it ...
Rudixx's user avatar
  • 1
0 votes
1 answer
24 views

Comparing two columns across tables for a remaining subset

How can I find the unique phone numbers (and collapse them into a single column) from table_1 (while keeping the IDs and date fields), and remove phone numbers that appear in table_2? table_1 id ...
Lbutlr's user avatar
  • 1
1 vote
3 answers
186 views

SQL query joining applications to categories

I do have large database and my query takes about 2s to complete on production environment which is kinda slow and would like to ask is there a space for improvement? My initial inputs are ...
Marius's user avatar
  • 119
4 votes
0 answers
3k views

Student report card management Python program

The program is designed to take data from a MySQL database, using mysql-connector-python, and print it as a table in Python using the texttable module. The program also plots charts based on the data ...
Random Person's user avatar
2 votes
1 answer
39 views

Find coherent datetime ranges in postgresql

My Data consists of rows containing a Length/Duration in Minutes, a Begin & EndTime. The precision is 1min (or larger). the table looks something like that: ...
Fritz's user avatar
  • 121
1 vote
2 answers
148 views

Moving files according to paths in database

I'm trying to move a large number of files. I get the path of source and destination from database. It takes hours to move images, and I was wondering if there is a faster way for moving large ...
MickeyMan's user avatar
5 votes
1 answer
129 views

PostgreSQL: Grouping and Aggregating on multiple columns

Problem Statement: I am working on this simple dataset from Kaggle. I have provided a snippet of data with only required columns in below table. Dataset is quite simple, it has all IPL (cricket) ...
gautham's user avatar
  • 53
1 vote
1 answer
4k views

Beginner CRUD Console Application

I wrote this basic CRUD app + simple report so I could practice talking to a db directly. I purposefully avoided repository pattern and Entity Framework and only used a library to show the coming data ...
Pablo Aguirre de Souza's user avatar
2 votes
1 answer
170 views

Prevent Column Name Collision

I have been working on a series of posts about a library to connect to databases but most of the scenarios I have to resort to some "JOIN" the problem arose when two or more tables had some ...
user avatar
8 votes
3 answers
942 views

Schema design for user profile and transaction

I'm creating a schema design for a user profile and transactions. I am very new in data modeling and currently this is my design. The schema has multiple deposit ...
9years's user avatar
  • 81
-2 votes
1 answer
52 views

T-SQL Query Performance [closed]

The query below already has indexes based its execution plan but it is still under performant with larger datasets. Are the additional null checks needed and why? Do you see anything that can be done ...
Rick B.'s user avatar
  • 135
1 vote
1 answer
432 views

Database schema for discussion forum scraping

I'm scraping posts from various discussion forums and storing those posts, along with some metadata, into a relational database (SQL). My actual use case is a bit more complex, but I think I can give ...
Dan Tony's user avatar
0 votes
2 answers
42 views

Table-Value Function with row-level-locking

I'm implementing row-level-locking on a MS SQL Server. The function I created below works, but even with a very small data set, it takes a significant amount of time to return the results. If I were ...
rohrl77's user avatar
  • 181
1 vote
1 answer
66 views

Simple website sql database

I'm getting into backend with postgresql and I would like to know how much of my example would fit for a real website database, just for storing and then displaying it on website. ...
irtexas19's user avatar
  • 173
1 vote
1 answer
2k views

Get result of a scalar-valued SQL function from C#

I do not receive files on holidays; I only receive files on regular days—i.e., non-holidays. I want to skip 2021-09-06 since that's a holiday (Labor Day) and I know I will not receive any files. ...
Anonymous29's user avatar

15 30 50 per page
1
4 5
6
7 8
98