I have three tables in my DB: “Film”, which contains details regarding movies “Sale”, which contains details regarding theathers where movies are projected “Proiezioni”, which contains details regarding projections, with external references to both the previous tables The problem involves finding the titles of all the movies that were projected in the city of “Pisa” only. The problem of this
Tag: mysql
Update column value where property of foreign key table is equal to property of foreign key table
I am looking to do an update basing myself on the property of another table to which my initial table has a foreign key to, so given the case I have 3 tables: Is there a way for me to do something like The reason I cannot use the Id even knowing it is that I am dealing with different
How to create pivot table entries for all of the rows available in two separate tables in MYSQL
I need help to create pivot table entries for all of the rows available in two separate tables, basically, I have two separate tables as services and plans as below plans table id name description 1 plan one description for plan one 2 plan two description for plan two services table id name 1 service one 2 services two and
Count users with a condition in MYSQL
I have a table ‘helpdesk’ (detail below) that lists tickets. I’m trying to get the top 10 users who report issues, however there is a complication in the fact that users can report an issue for another user (think secretary for their boss as an example). The table structure is… Using the example above the count should return User 1
Node.js rounds my sql result. how do i prevent this?
I am requesting a bigint from my database. However, Node.js alters the value of my request, so that my program doesn’t work. Here’s my code: The console logs: However, if i run the same statement in PHPmyAdmin, it looks like the following: it returns: Why does Node.JS round the value up and how do i prevent it? Answer This happens
C# Multiple comboBoxes used in MySQL Where
Im trying to learn using MySQl with C# so im creating app that allow sorting and adding data to my tables. That is code that i use to show items selected only by my comboBox_1 value. But now i want to add 2nd comboBox and show data that meets both conditions. The problem is i have no idea how to
MySQL after update trigger with number of affected rows condition
In MySQL, I want to create a trigger with AFTER UPDATE triggering event for my user table. In next, I have a table named user_log which is use to store the modifications that occurred on the parent table user after any update commands. So, data in user_log table need be as follows: As you can see from the data in
SQL to find local count max per primary key
I have a table with PK CustomerId + type. Each customer has a few types. For each customer I want to get type which repeated the most for this customer. I’ve tried to create a column “count” but I want to get the local maxs, and not a global max for the whole col. Is there a native way to
Word unscrambler in MySQL
Let’s say I have the input string “Hello” I want to be able to retrieve these output words: hole, lol, eh, hell All the output words letters should be contained in the input string. How I should be able to achieve that? I’ve tried to use like: But this returns words such as: hi، loop,etc.. but I need the all
Sql list unregistered classroom
There is one student. This student is enrolling in classes. What I want is to list the classes where this student is not registered. My SQL query is like this. Where am I going wrong? Answer I had to assume your table structure and I hope I got it right. The classic approach would be with LEFT JOIN and IS