Intro To SQL
Intro To SQL
Intro To SQL
Is a collection of Tables
Table name Attribute names
Tables
Product
Tuples or rows
Contents of a Table
+------+------------+-------+-------------+---------+
| ID | Name | CCode | District | Populatn
+------+---------------+------------------+---------+
| 3320 | Bangkok | THA | Bangkok | 6320174 |
| 3321 | Nonthaburi | THA | Nonthaburi | 292100 |
| 3323 | Chiang Mai | THA | Chiang Mai | 171100 |
+------+------------+-------+-------------+---------+
Selecting single columns
A query is a request for data from a database table
Note
• Keywords are not case-sensitive which means you can write it upper
case or lower case
• Preferred use keyword in upper case to distinguish them from other
parts of your query like column and table names
SELECT *
FROM Product
WHERE category=‘Gadgets’
• console command