Skip to content

Instantly share code, notes, and snippets.

@tphdev
Created July 10, 2018 01:52
Show Gist options
  • Save tphdev/6870c5cff163bd47582670003e6ff3fc to your computer and use it in GitHub Desktop.
Save tphdev/6870c5cff163bd47582670003e6ff3fc to your computer and use it in GitHub Desktop.
relational model v sql v mysql

Relational Model A framework for describing data. Data is organized into tables and relations.

SQL stands for Structured Query Language. It’s a standard language for implementing a Relational Model accessing and manipulating Relational databases.

MySQL is a RDMS (Relational Database Management System) that implements SQL .

  • like SQL Server, Oracle, Postgres, etc.
CREATE DATABASE HOSPITAL
  
CREATE TABLE EMPLOYEE (
	id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
	username VARCHAR(50) NOT NULL,
	first_name VARCHAR(25) NOT NULL,
	last_name VARCHAR(25) NOT NULL,
	email VARCHAR(25) NOT NULL,
	salary INT,
	medical_staff BOOL  
	created_at TIMESTAMP DEFAULT "00:00:00 00:00:00"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment