Skip to main content

All Questions

Tagged with
3 votes
1 answer
136 views

Faster Query to Track State changes in a Large Table

I have a table that tracks state changes of an entity with timestamps. The schema of the table is as follows: entityid userid originalvalue newvalue changetime 255 101 Draft Submitted 2023-11-28 12:10:...
Fatal Error's user avatar
2 votes
1 answer
250 views

MySQL interval search query suggestions

My database structure is: ...
friday-json's user avatar
3 votes
1 answer
99 views

SQL query creating tables needed by a simple PHP CMS

I have written recently the SQL query to MariaDB that I want to move into PHP code. Below is my test.sql file. What do you think about my SQL code? ...
whiteman808's user avatar
3 votes
0 answers
93 views

Create table of yearly monthly temperatures from monthly data

I've got a series of tables with monthly data on USA regions over about 130 years, divided by either climate divisions (clim_div) or other federal standards (ncdc_fips). They all follow the same ...
DownrightBass's user avatar
-3 votes
1 answer
85 views

Preventing PHP SQL injection on login [closed]

I had a login code like this: ...
Bazim's user avatar
  • 17
1 vote
1 answer
57 views

Find offers that can be matched with bids

I am working on a sql query for the following scenario: Get all available offers for registered demand (offers from profiles should not be from profile which had registered demand). After that get ...
Gleichmut's user avatar
  • 121
4 votes
3 answers
401 views

Queries to get products selected in multiple stores

Project description I'm making a website listing products. The listing goes as following (See here): Product name Shop name Price in that shop If the product appears multiple times in the table for ...
Alpha.Ars's user avatar
0 votes
2 answers
193 views

Version 2: Display visitor's number on your web page (changed code after getting answer for first version)

Version 2: Display visitor's number on your web page (changed code after getting answer for first version). The first version is here: Display visitor's number on your web page The "visitors&...
user avatar
0 votes
1 answer
290 views

Display visitor's number on your web page

Display visitor's number on your web page. The "visitors" table has only one column (visitor_count) and only one row. The column's initial value is 0. I know goto should not be used but then ...
user avatar
2 votes
1 answer
654 views

SQL query to find expenditures of employees who have exceeded their limit

I've 2 tables emp and expenditure. Emp: ID, NAME Expenditure: ID, EMP_ID, AMOUNT Each emp has a limit of 100 that he/she can ...
reiley's user avatar
  • 137
2 votes
1 answer
77 views

Calculate time interval excluding breaks

I have a solution for a question I asked on SO: I am trying to create a database where I also need to find the time difference inside a record. However, timediff() ...
Memo Haldan's user avatar
1 vote
3 answers
190 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
5 votes
1 answer
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
8 votes
3 answers
951 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
3 votes
4 answers
197 views

Order a table by column and get row number

In my database, I have table wp_postmeta, example: ...
Henrik Petterson's user avatar

15 30 50 per page
1
2 3 4 5
21