Sample commands

From www.ReeltoReel.nl Wiki
Revision as of 05:47, 3 September 2015 by Pvdm (talk | contribs) (Created page with "testdatabase 'testsietske'; <pre> > mysql -u root MariaDB [testsietske]> use testsietske; MariaDB [testsietske]> show tables; MariaDB [testsietske]> select * from City; Ma...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

testdatabase 'testsietske';

> mysql -u root

MariaDB [testsietske]> use testsietske;

MariaDB [testsietske]> show tables;

MariaDB [testsietske]> select * from City;

MariaDB [testsietske]> select * from City where Countrycode = "NLD";

MariaDB [testsietske]> select * from City where District = "Noord-Holland";

MariaDB [testsietske]> select * from City where Countrycode = "NLD" and  population > "100000";


MariaDB [testsietske]> show tables;

MariaDB [testsietske]> select * from Country where Continent = "Europe";

----


SHOW COLUMNS FROM City;

You can use db_name.tbl_name as an alternative to the tbl_name FROM db_name syntax. In other words, these two statements are equivalent:

MariaDB [testsietske]> SHOW COLUMNS FROM mytable FROM mydb;
MariaDB [testsietske]> SHOW COLUMNS FROM mydb.mytable;

MariaDB [testsietske]> select * from City limit 10;

      LIMIT limit OFFSET offset