Today we get to jump into SQL
Each manufacturer of a DBMS adds a few special features to differentiate their product. This can cause problems.
We will be using MySQL, which was open source and was then eaten by oracle.
There’s a fork called MariaDB, it’s a drop-in, open-source substitute.
Create a database
CREATE DATABASE databasename
Remove a database
DROP DATABASE databasename
Show databases with SHOW
Comments work like this:
-- Single line comments
-- hyphen hyphen space
/*
Multi-line comments are like Java
*/
‘Open’ a database with USE databasename
CREATE TABLE tablename (
attributeName datatype,
attributeName datatype,
CONSTRAINT constraint_name PRIMARY KEY (attributeName)
);
TODO - insert link here to datatypes
DESCRIBE tablename
will show the metadata about a table