Making New Tables in SQL

Table With Columns Instead of Legs?

Creating the Database

CREATE DATABASE awesomedatabase
SHOW DATABASE

Backing Up Your Database

BACKUP DATABASE awesomedatabase
TO DISK = 'D:\somewhere\awesomedatabase.bak'

Creating a Table

CREATE TABLE movie (
movieID int,
title varChar(255),
mov_year int,
genre varChar(255),
runtime varChar(255),
);

Datatypes

Changing a Table

ALTER TABLE movie 
MODIFY COLUMN mov_year year
ALTER TABLE movie
ADD director varChar(255);
ALTER TABLE movie 
DROP COLUMN genre;

Dropping Shtuff

DROP TABLE movie;
DROP DATABASE awesomedatabase;

Get CREATE ing

I love traveling, music, and movies.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store