Skip to content

Latest commit

 

History

History
24 lines (24 loc) · 1.21 KB

Basic_commands.md

File metadata and controls

24 lines (24 loc) · 1.21 KB

SQL Basic Commands

  • Use ; after completed commands.
  • Use , when continuing or adding more.
  • Use () for parentheses, e.g., adding rows, columns, and numbers.
  • int - integer. Use AUTO_INCREMENT with it for unique numbers.
  • varchar - variable character or strings.
  • describe to show details about tables.
  • Defining the table with columns and rows is defining the schema or how our database is arranged.
  • Write strings in "".
  • insert into inserts data into the specified table.
  • select pulls data from tables.
  • Use * wildcard to pull everything from the table.
  • asc = ascending, desc = descending.
  • alter to change a table that is already created.
  • boolean = true/false (1 = true, 0 = false).
  • ctrl+l = clear screen.
  • now() = for current date and time.
  • Use distinct to avoid repetition of words.
  • Use between to find ranges.
  • Use like for text or specific finding.
  • Use not like for the opposite or exclude.
  • Use IN for specific finding in a column.
  • Use % for any number of characters. e.g., "a$" for after a, "$a" for before a, "$a$" for before and after a.
  • Use _ for specifics. Can be combined with $ like "_a$" means that one letter before a and anythign after a.