Basic Tools of SQL 1-2

Sungju Kim·2024년 7월 3일

SQL equalities

  • =: equal
  • <>: not equal
  • others are same as python

SQL range definitions

  • between a and b
    • both a and b are inclusive
  • in (a, b, c)
    • finds matches with the value a, b and c.
select *
from customers
where age in (21,25,27)

SQL searches

  • like ‘abc%’ OR like ‘%abc’
    • finds all objects that start/end with ‘abc’
select *
from customers
where name like '김%' 

setting multiple filters

  • and
  • or
  • not
select * 
from customers c 
where age=21 and
not gender='male'
profile
Fully ✨committed✨ developer, always eager to learn!

0개의 댓글