Site Tools


webseite:mysql:basic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
webseite:mysql:basic [2014/05/27 14:49] – created lunetikkwebseite:mysql:basic [2014/06/02 10:03] lunetikk
Line 1: Line 1:
 ====== MySQL Basics ====== ====== MySQL Basics ======
  
 +==== Data Definition Language (DDL) ====
 +
 +^^^
 +|  CREATE  |  create new objects in db  |
 +|  ALTER  |  alters / change the structure of the db  |
 +|  DROP  |  delete objects from the db  |
 +
 +==== Data Manipulation Language (DML) ====
 +
 +^^^
 +|  SELECT  |  retrieve data from db  |
 +|  INSERT  |  insert data into a table  |
 +|  UPDATE  |  updates existing data in a table  |
 +|  DELETE  |  deletes all records from a table, space for the records remain  |
 +
 +===== Code examples =====
 ^Code^What it does^ ^Code^What it does^
 |  SELECT * FROM Table WHERE Cell LIKE 'test'  |  select all rows in Table where Cell contains 'test'  | |  SELECT * FROM Table WHERE Cell LIKE 'test'  |  select all rows in Table where Cell contains 'test'  |
 +|  SELECT IdX FROM Table WHERE Cell LIKE '$Var'  |  select IdX from Table where Cell contains variable Var  |
 +|  SELECT * FROM Table ORDER BY IdX DESC LIMIT 0,10  |  select all rows limited by 10, order everything by IdX and from newest top to oldest bottom  |
 +|  SELECT * FROM Table WHERE Cell LIKE '%$Var%'  |  select all rows from table where cell is almost like variable Var  |
 +|  UPDATE `DB`.`Table` SET `Cell1` = '$Var1' WHERE `Table`.`Cell2`='$Var2'  |  update Table Cell2 to Var2 where Cell1 is Var1  |
 +|  INSERT INTO Table (Cell1, Cell2) VALUES ('Text', '$Var1' |  add new row into Table with cell1 as Text and Cell2 as Var1  |
webseite/mysql/basic.txt · Last modified: 2018/12/20 17:40 by lunetikk