SQL

Mysql find similar string [closed]

I have always wondered, what is the query for finding the most similar string in DB When I search for a word and get back the most similar string. How to do it in MYSQL? Here is an example of a site that works this way

How do I combine these tables?

My goal is to have a 5 by 5 table that looks like this:

State
MostRE
MostNRE
LeastRE
LeastNRE

WA
4499698
blank
blank
blank

TX
blank
91590135
blank
blank

DC
blank
blank
4780
blank

DC
blank
blank
blank
438130

I have found t…

SQL Join same table based on other tables

I have a payment table, related to dates table and event table. I made separated queries with the result I want:
SELECT employee_id, payment.value ADDITIONAL
FROM payment
INNER JOIN dates ON payment.date_id = dates.id
INNER JOIN event ON p…

MySQL monthly sums

I have a table transactions like this

date
amount

2020-02-26
1000

2020-02-26
1500

2021-01-11
200

I want to select the sum of all transactions per month. The result should look something like…

month
sum

2020-02
250…