/Database

[2022-1st Semester] A course, Database

Database course in Konkuk Univ. (2022 first semester)

Organizing about learning things

SQL

  • create table

    • primary key
    • foreign key
    • not null
  • drop table

  • alter table

    • alter table r add A D;
    • alter table r drop A;
  • select from

    • distinct
    • where
      • and, or, not, (not) between
    • as
      • select, from
  • String operation

    • %
    • _
    • like
  • Ordering tuples

    • order by
      • asc
      • desc
  • Set operation

    • union
      • all
    • intersect
      • all
    • except
      • all
  • About NULL values (have to memorize)

  • Aggregate Functions

    • avg
    • min
    • max
    • sum
    • count
      • distinct, *
  • Grouping

    • group by
    • having
  • Subqueries

    • In where clause
      • in, not in
      • some, all
    • In from clause
    • with clause
    • In select clause
  • delete from

    • delete from r where p;
  • insert into values()

    1. insert into r values();
    2. insert into r() values();
    3. insert into r values(..., null, ...);
  • update set

    • case when then else end