This Is Your Brain On Informatics: MariaDB: Difference between revisions
No edit summary |
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 ` | | 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 | | WHERE || || Limits the available values SELECT can pull from each column based on a logical statement (e.g. WHERE ''col1'' < 10) | ||
|- | |- | ||
| AS | | 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'' | |||
|} | |} | ||