Query all columns for a city in CITY with the ID 1661.
The CITY table is described as follows:
THEORY:
What is a SELECT
Statement?
The SELECT
statement is used to retrieve data from one or more tables in a database. It is the most commonly used command in SQL (Structured Query Language).
Types of SELECT Queries
-
Simple SELECT
-
SELECT with WHERE
-
SELECT with Aggregates
-
SELECT with JOIN
-
SELECT with Subquery
🔹 Important Notes
-
SQL is not case-sensitive, but common practice is to write keywords in UPPERCASE.
-
You can alias columns and tables for readability:
SOLUTION:
SELECT * FROM CITY WHERE ID='1661';