
-- Scholars Database Table Starts Here
 CREATE TABLE `scholars` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL,
  `Sclass` varchar(100) NOT NULL,
  `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Scholars Database Table Ends Here


-- Teachers Database Table Starts Here
 CREATE TABLE `teachers` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `tclass` varchar(100) NOT NULL,
  `Subjects` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Admin Database Table Ends Here



-- NewTake Database Table Starts Here
 CREATE TABLE `newscholars` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL,
  `Rclass` varchar(100) NOT NULL ,
  `Sclass` varchar(100) NOT NULL DEFAULT "newtake",
  `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- NewTake Database Table Ends Here


-- Time Database Table Starts Here
 CREATE TABLE `times` (
  `id` int NOT NULL,
  `sclass` varchar(100) NOT NULL,
  `Hours` varchar(100) NOT NULL DEFAULT 0,
  `Minutes` varchar(100) NOT NULL DEFAULT 10,
  `Seconds` varchar(100) NOT NULL DEFAULT 60
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Time Database Table Ends Here


-- NewTake Database Table Starts Here
 CREATE TABLE `subjects` (
  `id` int NOT NULL,
  `sclass` varchar(100) NOT NULL,
  `Allsubjects` varchar(100) NOT NULL DEFAULT 'SSS3'
  
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- NewTake Database Table Ends Here


-- Question Database Table for Grade1 Starts Here
 CREATE TABLE `qgrade1` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for Grade1  Ends Here


-- Question Database Table for Grade2 Starts Here
 CREATE TABLE `qgrade2` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for Grade2  Ends Here


-- Question Database Table for Grade3 Starts Here
 CREATE TABLE `qgrade3` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for Grade3  Ends Here

-- Question Database Table for Grade4 Starts Here
 CREATE TABLE `qgrade4` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for Grade4  Ends Here

-- Question Database Table for Grade1 Starts Here
 CREATE TABLE `qgrade5` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for Grade5  Ends Here



-- Question Database Table for Jss1 Starts Here
 CREATE TABLE `qjss1` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for Jss1  Ends Here


-- Question Database Table for Jss2 Starts Here
 CREATE TABLE `qjss2` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for Jss2  Ends Here


-- Question Database Table for Jss3 Starts Here
 CREATE TABLE `qjss3` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for Jss3  Ends Here

-- Question Database Table for SSS1 Starts Here
 CREATE TABLE `qsss1` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for SSS1  Ends Here


-- Question Database Table for SSS2 Starts Here
 CREATE TABLE `qsss2` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for SSS2  Ends Here

 -- Question Database Table for SSS3 Starts Here
 CREATE TABLE `qsss3` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for SSS3  Ends Here



 -- Question Database Table for nursery1 Starts Here
 CREATE TABLE `qnursery1` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


 -- Question Database Table for nursery1 Starts Here
 CREATE TABLE `qnursery2` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



-- Question Database Table for nursery1 Starts Here
 CREATE TABLE `qfoundation` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



-- Question Database Table for qnewtake Starts Here
 CREATE TABLE `qnewtake` (
  `id` int NOT NULL,
  `Teacherq` varchar(255) NOT NULL,
  `OptA` varchar(100) NOT NULL,
  `OptB` varchar(100) NOT NULL,
  `OptC` varchar(100) NOT NULL,
  `OptD` varchar(100) NOT NULL,

  `ValA` varchar(100) NOT NULL,
  `ValB` varchar(100) NOT NULL,
  `ValC` varchar(100) NOT NULL,
  `ValD` varchar(100) NOT NULL,
 
  `Date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Question Database Table for qnewtake  Ends Here



-- Result Database Table for Grade1 Starts Here
 CREATE TABLE `grade1` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `Science` varchar(50) NOT NULL DEFAULT 0,
  `Humanities` varchar(50) NOT NULL DEFAULT 0,
  `CCA` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0
  
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Result Database Table for Grade1  Ends Here

 -- Result Database Table for Grade2 Starts Here
 CREATE TABLE `grade2` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `Science` varchar(50) NOT NULL DEFAULT 0,
  `Humanities` varchar(50) NOT NULL DEFAULT 0,
  `CCA` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0
 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Result Database Table for Grade2  Ends Here


-- Result Database Table for Grade3 Starts Here
 CREATE TABLE `grade3` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `Science` varchar(50) NOT NULL DEFAULT 0,
  `Humanities` varchar(50) NOT NULL DEFAULT 0,
  `CCA` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0,
  `Prevocational` varchar(50) NOT NULL DEFAULT 0

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Result Database Table for Grade3  Ends Here

-- Result Database Table for Grade4 Starts Here
 CREATE TABLE `grade4` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `Science` varchar(50) NOT NULL DEFAULT 0,
  `Humanities` varchar(50) NOT NULL DEFAULT 0,
  `CCA` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0,
  `Prevocational` varchar(50) NOT NULL DEFAULT 0

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Result Database Table for Grade4  Ends Here

 -- Result Database Table for Grade5 Starts Here
 CREATE TABLE `grade5` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `Science` varchar(50) NOT NULL DEFAULT 0,
  `Humanities` varchar(50) NOT NULL DEFAULT 0,
  `CCA` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0,
  `Prevocational` varchar(50) NOT NULL DEFAULT 0

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Result Database Table for Grade5  Ends Here

 -- Result Database Table for Jss1 Starts Here
 CREATE TABLE `jss1` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `CRK` varchar(50) NOT NULL DEFAULT 0,
  `IRK` varchar(50) NOT NULL DEFAULT 0,
  `CCA` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0,
  `BasicTech` varchar(50) NOT NULL DEFAULT 0,
  `PHE` varchar(50) NOT NULL DEFAULT 0,
  `French` varchar(50) NOT NULL DEFAULT 0,
  `BasicSci` varchar(50) NOT NULL DEFAULT 0,
  `Hausa` varchar(50) NOT NULL DEFAULT 0,
  `BusinessStudies` varchar(50) NOT NULL DEFAULT 0,
  `Prevocational` varchar(50) NOT NULL DEFAULT 0

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Result Database Table for Jss1  Ends Here

 -- Result Database Table for Jss2 Starts Here
 CREATE TABLE `jss2` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `CRK` varchar(50) NOT NULL DEFAULT 0,
  `IRK` varchar(50) NOT NULL DEFAULT 0,
  `CCA` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0,
  `BasicTech` varchar(50) NOT NULL DEFAULT 0,
  `PHE` varchar(50) NOT NULL DEFAULT 0,
  `French` varchar(50) NOT NULL DEFAULT 0,
  `BasicSci` varchar(50) NOT NULL DEFAULT 0,
  `Hausa` varchar(50) NOT NULL DEFAULT 0,
  `BusinessStudies` varchar(50) NOT NULL DEFAULT 0,
  `Prevocational` varchar(50) NOT NULL DEFAULT 0

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Result Database Table for Jss2  Ends Here

 -- Result Database Table for Jss3 Starts Here
 CREATE TABLE `jss3` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `CRK` varchar(50) NOT NULL DEFAULT 0,
  `IRK` varchar(50) NOT NULL DEFAULT 0,
  `CCA` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0,
  `BasicTech` varchar(50) NOT NULL DEFAULT 0,
  `PHE` varchar(50) NOT NULL DEFAULT 0,
  `French` varchar(50) NOT NULL DEFAULT 0,
  `BasicSci` varchar(50) NOT NULL DEFAULT 0,
  `Hausa` varchar(50) NOT NULL DEFAULT 0,
  `BusinessStudies` varchar(50) NOT NULL DEFAULT 0,
  `Prevocational` varchar(50) NOT NULL DEFAULT 0

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Result Database Table for Jss3  Ends Here

  -- Result Database Table for Jss3 Starts Here
 CREATE TABLE `newtake` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `Generalstudies` varchar(50) NOT NULL DEFAULT 0
  
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 -- Result Database Table for Jss3  Ends Here



 -- Result Database Table for  nursery 1 Starts Here
 CREATE TABLE `nursery1` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Literacy` varchar(50) NOT NULL DEFAULT 0,
  `Numeracy` varchar(50) NOT NULL DEFAULT 0,
  `KUW` varchar(50) NOT NULL DEFAULT 0,
  `Phonics` varchar(50) NOT NULL DEFAULT 0,
  `HandWritting` varchar(50) NOT NULL DEFAULT 0,
  `Rhymes` varchar(50) NOT NULL DEFAULT 0,
  `ShapesColo` varchar(50) NOT NULL DEFAULT 0,
  `PSED` varchar(50) NOT NULL DEFAULT 0,
  `HealthHabit` varchar(50) NOT NULL DEFAULT 0,
  `French` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0
  
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



-- Result Database Table for  nursery 2 Starts Here
 CREATE TABLE `nursery2` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Literacy` varchar(50) NOT NULL DEFAULT 0,
  `Numeracy` varchar(50) NOT NULL DEFAULT 0,
  `KUW` varchar(50) NOT NULL DEFAULT 0,
  `Phonics` varchar(50) NOT NULL DEFAULT 0,
  `HandWritting` varchar(50) NOT NULL DEFAULT 0,
  `Rhymes` varchar(50) NOT NULL DEFAULT 0,
  `ShapesColo` varchar(50) NOT NULL DEFAULT 0,
  `PSED` varchar(50) NOT NULL DEFAULT 0,
  `HealthHabit` varchar(50) NOT NULL DEFAULT 0,
  `French` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0
  
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


-- Result Database Table for Foundation Starts Here
 CREATE TABLE `foundation` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Literacy` varchar(50) NOT NULL DEFAULT 0,
  `Numeracy` varchar(50) NOT NULL DEFAULT 0,
  `KUW` varchar(50) NOT NULL DEFAULT 0,
  `Phonics` varchar(50) NOT NULL DEFAULT 0,
  `HandWritting` varchar(50) NOT NULL DEFAULT 0,
  `Rhymes` varchar(50) NOT NULL DEFAULT 0,
  `ShapesColo` varchar(50) NOT NULL DEFAULT 0,
  `PSED` varchar(50) NOT NULL DEFAULT 0,
  `HealthHabit` varchar(50) NOT NULL DEFAULT 0,
  `French` varchar(50) NOT NULL DEFAULT 0,
  `ICT` varchar(50) NOT NULL DEFAULT 0
  
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


 -- Result Database Table for sss1 Starts Here
 CREATE TABLE `SSS1` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `CRK` varchar(50) NOT NULL DEFAULT 0,
  `IRK` varchar(50) NOT NULL DEFAULT 0,
  `Biology` varchar(50) NOT NULL DEFAULT 0,
  `ComputerSci` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0,
  `Commerce` varchar(50) NOT NULL DEFAULT 0,
  `Accounting` varchar(50) NOT NULL DEFAULT 0,
  `French` varchar(50) NOT NULL DEFAULT 0,
  `Arabic` varchar(50) NOT NULL DEFAULT 0,
  `Hausa` varchar(50) NOT NULL DEFAULT 0,
  `Economics` varchar(50) NOT NULL DEFAULT 0,
  `Geography` varchar(50) NOT NULL DEFAULT 0,
  `History` varchar(50) NOT NULL DEFAULT 0,
  `Government` varchar(50) NOT NULL DEFAULT 0,
  `Marketing` varchar(50) NOT NULL DEFAULT 0,
  `FurtherMath` varchar(50) NOT NULL DEFAULT 0,
  `TechDrawing` varchar(50) NOT NULL DEFAULT 0,
  `Physics` varchar(50) NOT NULL DEFAULT 0,
  `Chemistry` varchar(50) NOT NULL DEFAULT 0,
  `Literature` varchar(50) NOT NULL DEFAULT 0,
  `FoodNutri` varchar(50) NOT NULL DEFAULT 0,
  `DataPro` varchar(50) NOT NULL DEFAULT 0
  

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;




 -- Result Database Table for sss1 Starts Here
 CREATE TABLE `SSS2` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `CRK` varchar(50) NOT NULL DEFAULT 0,
  `IRK` varchar(50) NOT NULL DEFAULT 0,
  `Biology` varchar(50) NOT NULL DEFAULT 0,
  `ComputerSci` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0,
  `Commerce` varchar(50) NOT NULL DEFAULT 0,
  `Accounting` varchar(50) NOT NULL DEFAULT 0,
  `French` varchar(50) NOT NULL DEFAULT 0,
  `Arabic` varchar(50) NOT NULL DEFAULT 0,
  `Hausa` varchar(50) NOT NULL DEFAULT 0,
  `Economics` varchar(50) NOT NULL DEFAULT 0,
  `Geography` varchar(50) NOT NULL DEFAULT 0,
  `History` varchar(50) NOT NULL DEFAULT 0,
  `Government` varchar(50) NOT NULL DEFAULT 0,
  `Marketing` varchar(50) NOT NULL DEFAULT 0,
  `FurtherMath` varchar(50) NOT NULL DEFAULT 0,
  `TechDrawing` varchar(50) NOT NULL DEFAULT 0,
  `Physics` varchar(50) NOT NULL DEFAULT 0,
  `Chemistry` varchar(50) NOT NULL DEFAULT 0,
  `Literature` varchar(50) NOT NULL DEFAULT 0,
  `FoodNutri` varchar(50) NOT NULL DEFAULT 0,
  `DataPro` varchar(50) NOT NULL DEFAULT 0

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


  -- Result Database Table for sss1 Starts Here
 CREATE TABLE `SSS3` (
  `id` int NOT NULL,
  `Names` varchar(255) NOT NULL,
  `RegNumber` varchar(100) NOT NULL ,
  `Mathematics` varchar(50) NOT NULL DEFAULT 0,
  `English` varchar(50) NOT NULL DEFAULT 0,
  `CRK` varchar(50) NOT NULL DEFAULT 0,
  `IRK` varchar(50) NOT NULL DEFAULT 0,
  `Biology` varchar(50) NOT NULL DEFAULT 0,
  `ComputerSci` varchar(50) NOT NULL DEFAULT 0,
  `Civic` varchar(50) NOT NULL DEFAULT 0,
  `Commerce` varchar(50) NOT NULL DEFAULT 0,
  `Accounting` varchar(50) NOT NULL DEFAULT 0,
  `French` varchar(50) NOT NULL DEFAULT 0,
  `Arabic` varchar(50) NOT NULL DEFAULT 0,
  `Hausa` varchar(50) NOT NULL DEFAULT 0,
  `Economics` varchar(50) NOT NULL DEFAULT 0,
  `Geography` varchar(50) NOT NULL DEFAULT 0,
  `History` varchar(50) NOT NULL DEFAULT 0,
  `Government` varchar(50) NOT NULL DEFAULT 0,
  `Marketing` varchar(50) NOT NULL DEFAULT 0,
  `FurtherMath` varchar(50) NOT NULL DEFAULT 0,
  `TechDrawing` varchar(50) NOT NULL DEFAULT 0,
  `Physics` varchar(50) NOT NULL DEFAULT 0,
  `Chemistry` varchar(50) NOT NULL DEFAULT 0,
  `Literature` varchar(50) NOT NULL DEFAULT 0,
  `FoodNutri` varchar(50) NOT NULL DEFAULT 0,
  `DataPro` varchar(50) NOT NULL DEFAULT 0

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


  -- Result Database Table for Assignment, Note, Result Starts Here
  CREATE TABLE `assignment` (
  `id` int NOT NULL,
  `subjects` varchar(20) NOT NULL,
  `assignment` longtext NOT NULL ,
  `sclass` varchar(20) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 

CREATE TABLE `note` (
  `id` int NOT NULL,
  `subjects` varchar(20) NOT NULL,
  `note` longtext NOT NULL ,
  `sclass` varchar(20) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE `submitass` (
  `id` int NOT NULL,
  `names` varchar(20) NOT NULL,
  `regNumber` varchar(20) NOT NULL,
  `sclass` varchar(20) NOT NULL,
  `subjects` varchar(20) NOT NULL,
  `ans` longtext NOT NULL,
  `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP
 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE `uploadedresult` (
  `id` int NOT NULL,
  `regNumber` varchar(20) NOT NULL,
  `resultName` varchar(255) NOT NULL,
  `resultid` varchar(255) NOT NULL,
  `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP
 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



 -- Result Database Table for Assignment, Note, Result close Here


 -- Index for Primary keys & Unique keys

 ALTER TABLE `scholars` 
 ADD PRIMARY KEY (`id`),
 ADD UNIQUE KEY `RegNumber`(`RegNumber`);

 ALTER TABLE `newscholars` 
 ADD PRIMARY KEY (`id`),
 ADD UNIQUE KEY `RegNumber`(`RegNumber`);

 ALTER TABLE `teachers` 
 ADD PRIMARY KEY (`id`);

  ALTER TABLE `times` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `subjects` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `assignment` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `note` 
 ADD PRIMARY KEY (`id`); 

 ALTER TABLE `submitass` 
 ADD PRIMARY KEY (`id`);

ALTER TABLE `uploadedresult` 
 ADD PRIMARY KEY (`id`);
-- ********************* FOR RESULTS*************************
  ALTER TABLE `grade1` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `grade2` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `grade3` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `grade4` 
 ADD PRIMARY KEY (`id`);

ALTER TABLE `grade5` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `jss1` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `jss2` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `jss3` 
 ADD PRIMARY KEY (`id`);

ALTER TABLE `newtake` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `sss1` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `sss2` 
 ADD PRIMARY KEY (`id`);   

 ALTER TABLE `sss3` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `nursery1` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `nursery2` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `foundation` 
 ADD PRIMARY KEY (`id`);

-- **********************************************

-- Index for AUTO_INCREMENT
 ALTER TABLE `scholars`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `newscholars`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `teachers`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `times`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `subjects`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;


ALTER TABLE `assignment`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `note`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `submitass`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `uploadedresult` 
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

-- ************************FOR RESULTS******************************
 ALTER TABLE `grade1`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `grade2`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `grade3`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `grade4`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `grade5`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `jss1`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;
 ALTER TABLE `jss2`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;
 ALTER TABLE `jss3`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `newtake`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `sss1`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `sss2`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `sss3`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `nursery1`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `nursery2`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

 ALTER TABLE `foundation`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;
 
-- ************************************************
INSERT INTO `times`( `sclass`) values ( 'Grade1');
INSERT INTO `times`( `sclass`) values ( 'Grade2');
INSERT INTO `times`( `sclass`) values ( 'Grade3');
INSERT INTO `times`( `sclass`) values ( 'Grade4');
INSERT INTO `times`( `sclass`) values ( 'Grade5');

INSERT INTO `times`( `sclass`) values ('Jss1');
INSERT INTO `times`( `sclass`) values ('Jss2');
INSERT INTO `times`( `sclass`) values ('Jss3');

INSERT INTO `times`( `sclass`) values ('sss1');
INSERT INTO `times`( `sclass`) values ('sss2');
INSERT INTO `times`( `sclass`) values ('sss3');
INSERT INTO `times`( `sclass`) values ('Newtake');

INSERT INTO `times`( `sclass`) values ('nursery1');
INSERT INTO `times`( `sclass`) values ('nursery2');
INSERT INTO `times`( `sclass`) values ('foundation');
-- ********************************************************

INSERT INTO `subjects`( `sclass`) values ( 'Grade1');
INSERT INTO `subjects`( `sclass`) values ( 'Grade2');
INSERT INTO `subjects`( `sclass`) values ( 'Grade3');
INSERT INTO `subjects`( `sclass`) values ( 'Grade4');
INSERT INTO `subjects`( `sclass`) values ( 'Grade5');

INSERT INTO `subjects`( `sclass`) values ('Jss1');
INSERT INTO `subjects`( `sclass`) values ('Jss2');
INSERT INTO `subjects`( `sclass`) values ('Jss3');

INSERT INTO `subjects`( `sclass`) values ('sss1');
INSERT INTO `subjects`( `sclass`) values ('sss2');
INSERT INTO `subjects`( `sclass`) values ('sss3');
INSERT INTO `subjects`( `sclass`) values ('Newtake');

INSERT INTO `subjects`( `sclass`) values ('nursery1');
INSERT INTO `subjects`( `sclass`) values ('nursery2');
INSERT INTO `subjects`( `sclass`) values ('foundation');




-- New DB to run
ALTER TABLE scholars
ADD COLUMN passwords VARCHAR(255) NOT NULL DEFAULT "0000" AFTER Sclass;

ALTER TABLE scholars
ADD COLUMN classstype VARCHAR(20) NOT NULL DEFAULT "juniorsec" AFTER passwords;

CREATE TABLE `timetable` (
  `id` int NOT NULL,
  `days` varchar(20) NOT NULL,
  `monipaper1` varchar(255) NOT NULL,
  `monipaper2` varchar(255) NOT NULL,

  `noonpaper1` varchar(255) NOT NULL,
  `noonpaper2` varchar(255) NOT NULL,

  `typess` varchar(255) NOT NULL,
  `classs` varchar(255) NOT NULL,

  `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP
 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `timetable` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `timetable` 
 MODIFY `id` int NOT NULL AUTO_INCREMENT;


 CREATE TABLE `schemes` (
  `id` int NOT NULL,
  `subjects` varchar(20) NOT NULL,
  `schem` longtext NOT NULL ,
  `sclass` varchar(20) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 ALTER TABLE `schemes` 
 ADD PRIMARY KEY (`id`); 

 ALTER TABLE `schemes`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;



 CREATE TABLE `calendas` (
  `id` int NOT NULL,
  `dates` varchar(20) NOT NULL,
  `eventtitle` varchar(20)NOT NULL ,
  `eventdecs` varchar(220) NOT NULL 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

 ALTER TABLE `calendas` 
 ADD PRIMARY KEY (`id`); 

 ALTER TABLE `calendas`
 MODIFY `id` int NOT NULL AUTO_INCREMENT;


 CREATE TABLE `performschart` (
  `id` int NOT NULL,
  `regNumber` varchar(20) NOT NULL,
  `subjects1` varchar(255) NOT NULL,
  `subjects2` varchar(255) NOT NULL,
  `subjects3` varchar(255) NOT NULL,
  `subjects4` varchar(255) NOT NULL,
  `subjects5` varchar(255) NOT NULL,
  `scores` varchar(255) NOT NULL,
  `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP
 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
 ALTER TABLE `performschart` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `performschart` 
 MODIFY `id` int NOT NULL AUTO_INCREMENT;


 CREATE TABLE `attendancee` (
  `id` int NOT NULL,
  `regNumber` varchar(20) NOT NULL,
  `weeks` varchar(255) NOT NULL,
  `monday` varchar(255) NOT NULL,
  `tuesday` varchar(255) NOT NULL,
  `wednesday` varchar(255) NOT NULL,
  `thursday` varchar(255) NOT NULL,
  `friday` varchar(255) NOT NULL,
  `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP
 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
 ALTER TABLE `attendancee` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `attendancee` 
 MODIFY `id` int NOT NULL AUTO_INCREMENT;



 CREATE TABLE `evideos` (
  `id` int NOT NULL,
  `Sclass` varchar(200) NOT NULL,
  `linkss` varchar(255) NOT NULL,
  `subjects` varchar(255) NOT NULL,
  `RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP
 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
 ALTER TABLE `evideos` 
 ADD PRIMARY KEY (`id`);

 ALTER TABLE `evideos` 
 MODIFY `id` int NOT NULL AUTO_INCREMENT;

