Skip to content

Tag: sql

How to do query with multiple condition from 2 table?

I wanna pick cities from worldcity by these conditions: the population of the city exceeds the population of the most populous city in the Filipina. (Meaning: for example city X is the city in the Filipina with the most population. We want to list the cities with a population greater than city X), AND there i…

The Sum of people that have same age in SQL?

I’m taking a SQL class and I need help with a question. I have the following table on a phpmyadmin server with a total of 100 patients I’m told to find the sum of people that have same age using SQL. I wrote this query: but it returns 100 as a result and when I did this query and found

How to select columns after inner join

Once I have joined two dataframes by a specific column I then want to select specific columns from this table – how can I do this? I have tried the following: However I get the following error: near “SELECT”: syntax error Answer Instead of a second select, use the first one. For example, thi…

Group by the specific day, month, and year

I have a table as follow, now I use the group by date and it only group my data based on the year. I want to group the data based on the specific day, month, and year. Do you know how we can do that? Answer Use: Check for more info