Popular

Java backend part 20

 SQL script:


DROP DATABASE IF EXISTS FullStackDev;

CREATE DATABASE IF NOT EXISTS FullStackDev;

USE FullStackDev;


-- Create table Employee --

CREATE TABLE `Employee` (

id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,

    `type` VARCHAR(50) NOT NULL, -- regular/contract

    `name` VARCHAR(50) NOT NULL,

salary INT,

    bonus INT,

    pay_per_hour INT,

    contract_duration VARCHAR(50)

);


INSERT INTO `Employee` (`type`,`name`, salary, bonus, pay_per_hour, contract_duration)

VALUE ('regular', 'name1', 2000, 100, null, null),

  ('regular', 'name2', 2000, 200, null, null),

      ('contract', 'name3', null, null, 10, '3 years');


Comments