Lesson 45
Japanese Cities' Names | SQL Basic Select | HackerRank Solution
Summary
Summary of Transcript
The speaker discusses a programming challenge related to querying Japanese city names from a database table called city
. This table contains the columns: ID, name, country code, district, and population.
Key Points:
- Objective: To query the names of all Japanese cities.
- Filtering Criteria: Use the country code 'JPN' to identify Japanese cities.
- SQL Query:
SELECT name FROM city WHERE country_code = 'JPN';
- The speaker mentions compatibility with DB2 and other SQL flavors and proceeds to submit the query code.
The talk focuses on performing a simple SQL selection based on given criteria.
Video Transcript
Hey everybody, I will do the challenge Japanese cities names from the sections basic select of sequel and hacker rank.
So let's get started. We have this table called city with the columns ID name country code district and population.
We are asked to query the names of all Japanese cities.
To do that, we have to filter by the country code being JPN.
So we can use DB2 and the other flavors. So we're going to do select.
Now the column we want to select is name from the table is city.
Now we have to add a filter. So where the country code that's the column, the value has to be equal to JPN so that we capture only the rows that have Japanese cities.
Now I'm going to submit the code.
No comments yet (loading...)
No comments yet (loading...)
Did you like the lesson? 😆👍
Consider a donation to support our work: