Skip to content

Tag: mysql

Time difference between rows

In a mysql database (ver.5.7.15) I’ve got the following table named operation_list containing the following data: id (autoincrement integer, primary key), operation_date_time (datetime), operation (…

Multiple joins on same table

I’m trying to achieve a query which seems simple but I can’t make it work correctly. Here’s my database tables structures: Here’s what i want to achieve: Mutliple members can register to an activity. Then, i group the registrations by tandems. I want a view with all the tandems listed …

Is there a way I can get output of count values in MySql?

I am dealing with getting the output of some common values. My database is quite big so I am just giving a dummy database here for understanding purposes. Here is the table I have: I have to extract only those variables that have the given common room numbers alotted. This is the table for the required data: …

SQL Getting the party with highest votes

I am trying to make a voting system through a SQL server, and I can’t get it right. What I am trying to do is get the party with the highest amount of votes. I expect something like [DEMS][8], or at the very least, the party name of the party with the highest votes. Answer Rather than using a WHERE

Query for similar phrases

Is there any way to match ‘United States of America’ with ‘United States’ in SQL? I have the country with the name ‘United States’ stored in the database. The query below should retrieve the item from the database with the name ‘United States’. Thank you! Answer…