This Is Your Brain On Informatics: MariaDB: Difference between revisions

Tikenn (talk | contribs)
No edit summary
Tikenn (talk | contribs)
No edit summary
Line 19: Line 19:
| SELECT || || Selects columns from a database for analysis
| SELECT || || Selects columns from a database for analysis
|-
|-
| FROM || || Denotes which table SELECT pulls the columns from (e.g. SELECT [col1],[col2] FROM `[table]`
| FROM || || Denotes which table SELECT pulls the columns from (e.g. SELECT [col1],[col2] FROM `''table''`
|-
|-
| WHERE || || Limits the available values SELECT can pull from each column based on a logical statement (e.g. WHERE [col1] < 10)
| WHERE || || Limits the available values SELECT can pull from each column based on a logical statement (e.g. WHERE ''col1'' < 10)
|-
|-
| AS [var] || || Sets an output to a variable  
| AS ''vaR'' || || Sets an output to a variable  
|- align = "center"
|- align = "center"
! colspan ="3" | Boolean Operators
! colspan ="3" | Boolean Operators
Line 61: Line 61:
| CREATE TEMPORARY TABLE `[table]` || || Creates a temporary table of the given name
| CREATE TEMPORARY TABLE `[table]` || || Creates a temporary table of the given name
|-
|-
| INTO || INSERT INTO table_name<br />VALUES (value1,value2,value3,...);<br />INSERT INTO table_name (column1,column2,column3,...)<br />VALUES (value1,value2,value3,...); -- specifies the columns the values go into || Inserts new data entries into the specified columns
| INSERT INTO || INSERT INTO ''table_name''<br /><br />VALUES (''value1,value2,value3,...'');<br /><br />INSERT INTO ''table_name'' (''column1,column2,column3,...'')<br /><br />VALUES (''value1,value2,value3,...''); -- specifies the columns the values go into || Inserts new data entries into the specified columns
|-
|-
| SELECT INTO || SELECT * or ''column_name(s)''<br />INTO ''newtable'' [IN ''externaldb'']<br />FROM ''table1'';|| Copies ''column_names'' from ''table1'' into ''newtable''
|}
|}