When I input a code or anything into MySQL and hit “enter” it moves down and “->” appears. It is as if the code is not going through or the code is not being read. I have attempted to download “add-ons” but I am really not sure what I am doing. This is for school and I am having trouble
Tag: mariadb
Optimising query with multiple selects as columns
I have a query I made: The results table has 25000 entries and it takes around 7 seconds to do this query, which is far too long. The query is incredibly inefficient as each column I’m creating is searching again on the same table but with different conditions. I tried indexing the columns of interest in my where clause. This
How to SELECT two records for each unique column value as one row in MySQL?
I have a MySQL table like this : +—-+—–+——-+——+——+——-+———————+ | ID | GID | Name | p1 | p10 | p100 | createdAt | +—-+—–+——-+——+——+—-…
How do I properly optimize this query?
I’m trying to optimize the following query. I’ve used EXPLAIN to troubleshoot but it keeps showing up in our logs as a non-indexed query. What am I missing? I’ve created indexes on all columns referenced, but it’s still showing up. Answer If you have a big table which contains millions of row, it would be the best to have where
SQL / Hibernate insert only if url not exists
I have a list of urls and a table that contains urls. I want to only insert if the url is not in the table. After the insert the Data-table should be contain: My current attempt is to have a method findByURL(url):List and a call this method for every URL in the list. If the returned list is empty I
Mariadb 10.4 Data truncated for column ‘column_name’ on insert but not on update
I have the following table (mariadb 10.4) called p: I currently have a couple of million rows on this table with the sources a, b, c, and d. Just recently we applied a migration to add source_e and we started getting the error ERROR 1265 (01000): Data truncated for column ‘source’ at row 1 when trying to inset a row
SQL count row where progres not done
Need some help, dont know the keyword of this problem to search online I want to count some progres that isn’t done when progres has step3 then its not counted desired result from that example is 2, im trying to do it alone, and it doesnt work help is needed, Thanks Ahead Answer One method uses count(distinct) and filters in
Python MariaDB pip install failed, missing mariadb_config
I am using Linux Ubuntu 18.04 and python 3. I am trying to build a connection between a maria-db and my python scripts. Therefore I have to install the mariadb package. I have already installed: sudo …
make column unique in context of one foreign key entity
So let’s image a database scheme for todos. Your todo table would be id (PK) owner_id (Foreign key on user table) title Of course the title column can’t be unique because each user can have a todo …
How to improve union query?
I have a query which is ‘working’ but slow and feels very poor and I don’t want to have to update each time we add/remove a supplier! Basically I have a table of ‘prices’ and for each suppler I need …