Skip to content

Instantly share code, notes, and snippets.

@sajithdilshan
Created July 17, 2017 05:29
Show Gist options
  • Save sajithdilshan/b543e6a28f6776a06f3ac50d1bbcdd74 to your computer and use it in GitHub Desktop.
Save sajithdilshan/b543e6a28f6776a06f3ac50d1bbcdd74 to your computer and use it in GitHub Desktop.
CREATE DATABASE zenythzdb;
USE zenythzdb;
CREATE TABLE machine (
factory_id SMALLINT,
machine_id SMALLINT,
hours SMALLINT,
restarts SMALLINT,
minor_repairs SMALLINT,
major_repairs SMALLINT,
extra_cost INT,
PRIMARY KEY (machine_id, factory_id)
);
GRANT ALL PRIVILEGES ON zenythzdb.* TO 'zenythz'@'localhost' IDENTIFIED BY 'zenythz';
INSERT INTO machine VALUES (1, 1, 0, 0, 0, 0, 0), (1, 2, 0, 0, 0, 0, 0), (1, 3, 0, 0, 0, 0, 0), (1, 4, 0, 0, 0, 0, 0),
(2, 1, 0, 0, 0, 0, 0), (2, 2, 0, 0, 0, 0, 0), (2, 5, 0, 0, 0, 0, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment