drop table if exists table_a;
create table table_a as
select a from table where a like %str%
: return records that containsstr
, for example,xxxstryyy
select a from table where a (not) like str%
: return records that start withstr
, for example,strxxxyyy
select a from table where a is null
:a
isnull
, otherwise,a is not null
select a from table where a in (a1, a2, a3)
select count(dept_no) from dept_emp group by dept_no order by count(dept_no) desc
select count(dept_no) from dept_emp group by dept_no having count(dept_no) > 5
show tables in db_name
select e.name, s.salary
from employee e
join salaries s
on e.emp_id = s.emp_id