Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 29, 2020 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/ca9196dda52df0765d482879bb4d476a to your computer and use it in GitHub Desktop.
Save parzibyte/ca9196dda52df0765d482879bb4d476a to your computer and use it in GitHub Desktop.
CREATE TABLE IF NOT EXISTS employees(
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL
);
CREATE TABLE employee_attendance(
employee_id BIGINT UNSIGNED NOT NULL,
date VARCHAR(10) NOT NULL,
status ENUM('presence', 'absence'),
FOREIGN KEY (employee_id) REFERENCES employees(id) ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE TABLE employee_rfid(
employee_id BIGINT UNSIGNED NOT NULL,
rfid_serial VARCHAR(11),
FOREIGN KEY (employee_id) REFERENCES employees(id) ON UPDATE CASCADE ON DELETE CASCADE
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment