-- create db called users
CREATE DATABASE my_app;

-- delete db
DROP DATABASE my_app;

-- use db
USE my_app;

-- create table
CREATE TABLE users (
  id INT NOT NULL AUTO_INCREMENT,
  first_name VARCHAR(255) NOT NULL,
  last_name VARCHAR(255) NOT NULL,
  PRIMARY KEY (id)
);

-- alter table
ALTER TABLE users
ADD email VARCHAR(255) NOT NULL;

-- drop table
DROP TABLE users;

-- create table with foreign key
CREATE TABLE posts (
  id INT NOT NULL AUTO_INCREMENT,
  text VARCHAR(140) NOT NULL,
  user_id INT NOT NULL,
  PRIMARY KEY (id),
  FOREIGN KEY (user_id) REFERENCES users(id)
);