Question

Sorry for my lame question I am new to the databases and SQL, Is the any SQL command for the finding out how many people are living in london from the database below?

.....................
Name      | City   
.....................
John      | London  
Watson    | New York  
Sherlock  | London  
Holmes    | Berlin  
Mycroft   | innsbruck  
.....................

Secondly, are the commands for PostgresSQL, MySQL, SQLlite same?

Thanks!

Was it helpful?

Solution

You need to figure out the syntax difference of queries in various DBMS (MySQL , Postgres and SQLLite).

In my opinion this query should be similar in all three DBMS.

SELECT COUNT(Name) AS "No of Peoples" FROM TableName WHERE City = 'London';

OTHER TIPS

Select count(name) from your_db_name where city='London'

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top