Skip to content

Latest commit

 

History

History
40 lines (34 loc) · 788 Bytes

database.md

File metadata and controls

40 lines (34 loc) · 788 Bytes

Database

MySql Notes

Query statement

SELECT DISTINCT column, column, ...
    FROM table
    INNER JOIN another_table
        ON table.id = another_table.id
    WHERE condition
        AND|OR condition
        AND|OR condition
    ORDER BY column ASC|DESC
    LIMIT num_lim OFFSET num_off;
  • SELECT
  • JOIN: tableL.id = tableR.id (omit: idL = idR)
  • WHERE
    • condition operator
      • =
      • !=, <>
      • LIKE, NOT LIKE
      • %, _
      • IN (...), NOT IN (...)
      • IS/IS NOT NULL
  • ORDER BY
  • LIMIT, OFFSET: from num_off on count for num_lim
SELECT <expression> AS newcolumn
    FROM table
    WHERE <expression>
    ...;

Convert

mdb to sqlite