text: CREATE DATABASE  IF NOT EXISTS `MySchools`;
  USE `MySchools`;
  
  DROP TABLE IF EXISTS `images`;
  CREATE TABLE `images` (
    `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `content` MEDIUMBLOB NOT NULL,
    `created_on` datetime DEFAULT NULL,
    `updated_on` datetime DEFAULT NULL,
    `is_deleted` BIT(1) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  DROP TABLE IF EXISTS `schools`;
  CREATE TABLE `schools` (
    `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) DEFAULT NULL,
    `about` varchar(255) DEFAULT NULL,
    `email` varchar(255) DEFAULT NULL,
    `address` varchar(255) DEFAULT NULL,  
    `phone` int(15) DEFAULT NULL,
    `city` varchar(50) DEFAULT NULL,
    `state` varchar(50) DEFAULT NULL,
    `pincode` int(5) DEFAULT NULL,
    `image_id` BIGINT(20) DEFAULT NULL,
    `created_on` datetime DEFAULT NULL,
    `updated_on` datetime DEFAULT NULL,
    `is_deleted` BIT(1) DEFAULT NULL,
    PRIMARY KEY (`id`),  
    KEY `fk_image_id` (`image_id`),
    CONSTRAINT `fk_image_id` FOREIGN KEY (`image_id`) REFERENCES `images` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  DROP TABLE IF EXISTS `users`;
  CREATE TABLE `users` (
    `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
    `first_name` varchar(255) DEFAULT NULL,
    `last_name` varchar(255) DEFAULT NULL,
    `username` varchar(255) NOT NULL,
    `password` varchar(255) NOT NULL,
    `email` varchar(255) DEFAULT NULL,
    `address` varchar(255) DEFAULT NULL,  
    `phone` int(15) DEFAULT NULL,
    `city` varchar(50) DEFAULT NULL,
    `state` varchar(50) DEFAULT NULL,
    `pincode` int(5) DEFAULT NULL,
    `dob` datetime DEFAULT NULL,  
    `school_id` BIGINT(20) DEFAULT NULL,
    `image_id` BIGINT(20) DEFAULT NULL,  
    `gender` INT(11) DEFAULT NULL,
    `user_type` int(11) DEFAULT NULL,
    `created_on` datetime DEFAULT NULL,
    `updated_on` datetime DEFAULT NULL,
    `is_deleted` BIT(1) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `fk_usr_school_id` (`school_id`),
    KEY `fk_usr_image_id` (`image_id`),
    CONSTRAINT `fk_usr_school_id` FOREIGN KEY (`school_id`) REFERENCES `schools` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `fk_usr_image_id` FOREIGN KEY (`image_id`) REFERENCES `images` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  
  
  