

CREATE DATABASE `dataencrypt` ;



USE `dataencrypt`;



/*Table structure for table `appusers` */



DROP TABLE IF EXISTS `appusers`;



CREATE TABLE `appusers` (
  `iduser` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `username` VARCHAR(50) NOT NULL,
  `password` VARCHAR(50) NOT NULL,
  `email` VARCHAR(255) NOT NULL,
  `last_loggedin` TIMESTAMP NULL DEFAULT NULL,
  `status` ENUM('active','inactive') NOT NULL DEFAULT 'active',
  `recordtime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `user_type` VARCHAR(45) NOT NULL,
  PRIMARY KEY (`iduser`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `appusers` */






/*Table structure for table `course` */



DROP TABLE IF EXISTS `course`;



CREATE TABLE `course` (
  `courseid` INT(11) NOT NULL AUTO_INCREMENT,
  `course` VARCHAR(256) NOT NULL,
  `status` ENUM('active','inactive') DEFAULT 'active',
  `recorddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`courseid`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `course` */





/*Table structure for table `fileupload` */



DROP TABLE IF EXISTS `fileupload`;



CREATE TABLE `fileupload` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `title` VARCHAR(255) NOT NULL,
  `course` INT(11) NOT NULL,
  `semester` INT(11) NOT NULL,
  `subject` INT(11) NOT NULL,
  `unit` INT(11) NOT NULL,
  `language` INT(11) NOT NULL,
  `university` VARCHAR(255) NOT NULL,
  `uploaded_file` VARCHAR(255) NOT NULL,
  `comments` TEXT NOT NULL,
  `status` ENUM('active','inactive') DEFAULT 'active',
  `recorddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `fileupload` */




/*Table structure for table `language` */



DROP TABLE IF EXISTS `language`;



CREATE TABLE `language` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `language` VARCHAR(256) NOT NULL,
  `status` ENUM('active','inactive') DEFAULT 'active',
  `recorddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `language` */





/*Table structure for table `mapping_course_sem` */



DROP TABLE IF EXISTS `mapping_course_sem`;



CREATE TABLE `mapping_course_sem` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `courseid` INT(11) NOT NULL,
  `idsem` INT(11) NOT NULL,
  `status` ENUM('active','inactive') DEFAULT 'active',
  `recorddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `mapping_course_sem` */




/*Table structure for table `mapping_sem_subject` */



DROP TABLE IF EXISTS `mapping_sem_subject`;



CREATE TABLE `mapping_sem_subject` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `idsem` INT(11) NOT NULL,
  `subjectid` INT(11) NOT NULL,
  `status` ENUM('active','inactive') DEFAULT 'active',
  `recorddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `mapping_sem_subject` */





/*Table structure for table `mapping_subject_unit` */



DROP TABLE IF EXISTS `mapping_subject_unit`;



CREATE TABLE `mapping_subject_unit` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `subjectid` INT(11) NOT NULL,
  `unitid` INT(11) NOT NULL,
  `status` ENUM('active','inactive') DEFAULT 'active',
  `recorddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `mapping_subject_unit` */





/*Table structure for table `semester` */



DROP TABLE IF EXISTS `semester`;



CREATE TABLE `semester` (
  `idsem` INT(11) NOT NULL AUTO_INCREMENT,
  `semester` VARCHAR(256) NOT NULL,
  `status` ENUM('active','inactive') DEFAULT 'active',
  `recorddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`idsem`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `semester` */



/*Table structure for table `subject` */



DROP TABLE IF EXISTS `subject`;



CREATE TABLE `subject` (
  `subjectid` INT(11) NOT NULL AUTO_INCREMENT,
  `subject` VARCHAR(256) NOT NULL,
  `status` ENUM('active','inactive') DEFAULT 'active',
  `recorddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`subjectid`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `subject` */





/*Table structure for table `units` */



DROP TABLE IF EXISTS `units`;



CREATE TABLE `units` (
  `unitid` INT(11) NOT NULL AUTO_INCREMENT,
  `units` VARCHAR(256) NOT NULL,
  `status` ENUM('active','inactive') DEFAULT 'active',
  `recorddate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`unitid`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



/*Data for the table `units` */



