Could you help me with finding a solution to my query problem? I am stuck with it already for a week so I decided to try to ask for help and learn something. I am using MySQL database. Right now I have a table without the “search feature”. This is the result: I want to show all rooms in the
Tag: mysql
Combining data mysql query
I have this table: trafico.2019 Where I need to select different kinds of traffic (combinations of variables grouped in the following query) Q1 So I know the records for each kind of traffic combination Now I want to set a threshold: 25% of the average of each type of traffic, which I get to know with the fol…
How to create a new column and add values to it based on a condition in MySQL?
this code I have tried the above code and surely there is a mistake. there are two columns studentID and marks. and I need to arrange them in student ID order and also create a new column and say “yes” or “no” if marks are divisible by 10. Answer Just do this first: Then, update data i…
creating a stored procedure based on view with parameter in MYSQL
Im getting a syntax error 1064 in mysqlworkbench for the stored procedure im trying to create. the stored procedure is based on a view i created. this is my view based on dataset(https://www.kaggle.com/gregorut/videogamesales) : and this is the stored procedure based on View with one parameter: I did the stor…
SQL How to ask for a value multiply times in an Query [closed]
Good evening folks! Following Problem, I have three tables: Create TABLE Suppliers ( SID integer, sname varchar(50), adress varchar(50), PRIMARY KEY (SID) ) Create TABLE Parts ( PID integer, pname …
MYSQL Trigger update not working as expected when value is updated
Looking to use a trigger on a MYSQL table when the row is updated, anytime the row is updated. Only setting the id if the id field is null Currently nothing is happening when the table row is updated Answer Your code should raise a syntax error, since id and username are undefined variables. If you want to ac…
How to write a select query that returns multiple results based on the booleans in one row (for spring security authorities query)?
I have a Java web app using Spring Security 5. I’m using MySQL as the database. The database table with users in it looks something like this: Spring Security requires me to give it two queries … one to get the users, and one to get the user’s roles. Typically the queries look like this: How…
Connecting two queries to get Cartesian product
I have a query SELECT d.GUID, w.word FROM dictionary d JOIN word w ON w.ID = d.ID_word WHERE w.id_language = #ID#; if #ID# = 1 it returns table GUID | word ———– 1 | A 2 | B 3 …
How to determine all details should go to first line item if we have multiple duplicate dates?
1)I have four fields like material no, item no, date, quantity. Input: Material item date quantity 101 91 06/05/2020 4 101 92 06/05/2020 …
inner join with subquery results differs for these data sets
CREATE TABLE IF NOT EXISTS `wcd` ( `id` int(6) unsigned NOT NULL, `wid` int(11) unsigned NOT NULL, PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; INSERT INTO `wcd` (`id`, `wid`) VALUES (‘168’, ‘…