1.select
select col_name_1,col_name_2
from table_name
select col_name_1 || col_name_2
from table_name
select col_name_1 + col_name_2 , col_name3/100
from table_name
select col_name_1 as “new column name”
from table_name
select col_name_1 “new column name”
from table_name
select col_name_1 as new_column_name
from table_name
select col_name_1 new_column_name
from table_name
2.where
select *
from table_name
where condition
condition
เช่น frist_name = ‘John’ and (salary > 2000)
3.Single row function
function — > manipulate data
character
-upper()
-lower()
-initcap()
-concap()
-supstr()
-instr()
-trim()
-replace()
-length()
number
-round() ปัดขึ้น ปัดลง
2.6 → 3.0 (1 digit)
2.3→ 2.0 (1 digit)
2.6153 → 2.62 (2 digit)
2.6153 → 2.615 (3 digit)
-trunc() ปัดทิ้ง
2.6 → 2.0 (1 digit)
2.3→ 2.0 (1 digit)
2.6153 → 2.61 (2 digit)
2.6153 → 2.615 (3 digit)
-date

นับความยาวของตัวอักษร

ตัวใหญ่

ครอบแบบ มี 2 ข้อมูลแล้วปรับ ตัวใหญ่ตัวเล็ก

ตัวแรกของคำเป็นตัวใหญ่

แบบฝึกหัดหน้า15


แบบฝึกหัดหน้า17

ต่อตัวอักษร ในที่นี้ใช้ || ได้เหมือนกัน