All Questions
311 questions
6
votes
2
answers
691
views
Weather Observation Station 8 query
Here's my (correct) solution to a HackerRank question:
Weather Observation Station 8
Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last ...
5
votes
3
answers
1k
views
Slow SQL query with nested subquery
I have written the below query in order to identify how many events (occur over a week) in each hour.
...
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:...
2
votes
1
answer
256
views
MySQL interval search query suggestions
My database structure is:
...
3
votes
1
answer
104
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?
...
3
votes
0
answers
94
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 ...
-3
votes
1
answer
85
views
Preventing PHP SQL injection on login [closed]
I had a login code like this:
...
1
vote
1
answer
64
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 ...
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 ...
0
votes
2
answers
196
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&...
0
votes
1
answer
292
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 ...
2
votes
1
answer
700
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 ...
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() ...
1
vote
3
answers
205
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 ...
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 ...