SQL basics

SQL Basics

  • when using SQL, begin with select or SELECT with the end ;(semi-colon).

example:

1
2
3
select name, no
from info
where no >= 13;
  • basic sentence to execute SQL (This sentence is the same as in all RDBMS.)
1
2
3
4
5
SELECT columns...
FROM table names
[WHERE condition statement #using the condition statement here! (with arithmetic operator)
ORDER BY columns... #asc (= default) or desc
LIMIT ...];
  • between: in the range

if the number is more than 15, less than 24,
write like the following:

1
2
3
select ~~
from ~~
where no between 15 and 24;
  • in/not in: in = including, not in = not including

  • like: when the specific string is included in data