├── README.md └── ebms.sql /README.md: -------------------------------------------------------------------------------- 1 | # Electricity Bill Management System 2 | 3 | 1. ER Diagram 4 | 5 | ![image](https://user-images.githubusercontent.com/64922494/126759470-a90c39af-11d0-4c68-9db0-178d8a1d9d08.png) 6 | 7 | 2. Schema Diagram 8 | 9 | ![image](https://user-images.githubusercontent.com/64922494/126759647-ba58b8c2-9ec4-4ce9-be25-a595b20ea177.png) 10 | 11 | 12 | List of entries for the tables: 13 | 14 | 15 | 1. Customer 16 | 17 | ![image](https://user-images.githubusercontent.com/64922494/125331111-2d87ab00-e365-11eb-8ffa-803e02007a88.png) 18 | 19 | 2. Admin 20 | 21 | ![image](https://user-images.githubusercontent.com/64922494/125331238-590a9580-e365-11eb-9103-0b0607ab5a0c.png) 22 | 23 | 3. Account 24 | 25 | ![image](https://user-images.githubusercontent.com/64922494/125331286-6aec3880-e365-11eb-8c5d-ba227a6ca5e0.png) 26 | 27 | 4. Billing 28 | 29 | ![image](https://user-images.githubusercontent.com/64922494/125331377-88b99d80-e365-11eb-92ad-a9bddb19816a.png) 30 | 31 | 5. Elec_board 32 | 33 | ![image](https://user-images.githubusercontent.com/64922494/125331440-9d963100-e365-11eb-8cae-7809d155aabc.png) 34 | 35 | 6. Tariff 36 | 37 | ![image](https://user-images.githubusercontent.com/64922494/125331831-20b78700-e366-11eb-9688-5c71e26087fd.png) 38 | 39 | 7. Invoice 40 | 41 | ![image](https://user-images.githubusercontent.com/64922494/125331529-bc94c300-e365-11eb-9551-31dd28fbdcdb.png) 42 | -------------------------------------------------------------------------------- /ebms.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 8.0.24, for Win64 (x86_64) 2 | -- 3 | -- Host: localhost Database: ebms 4 | -- ------------------------------------------------------ 5 | -- Server version 8.0.24 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!50503 SET NAMES utf8mb4 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `account` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `account`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!50503 SET character_set_client = utf8mb4 */; 25 | CREATE TABLE `account` ( 26 | `acc_id` int NOT NULL, 27 | `cust_id` int DEFAULT NULL, 28 | `account_no` varchar(50) DEFAULT NULL, 29 | `name` varchar(50) NOT NULL, 30 | PRIMARY KEY (`acc_id`), 31 | KEY `cust_id` (`cust_id`), 32 | CONSTRAINT `account_ibfk_1` FOREIGN KEY (`cust_id`) REFERENCES `customer` (`cust_id`) 33 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 34 | /*!40101 SET character_set_client = @saved_cs_client */; 35 | 36 | -- 37 | -- Dumping data for table `account` 38 | -- 39 | 40 | LOCK TABLES `account` WRITE; 41 | /*!40000 ALTER TABLE `account` DISABLE KEYS */; 42 | INSERT INTO `account` VALUES (401,111,'11345','Abhay'),(403,112,'12455','Vishnu'),(405,113,'98754','Anant'),(407,211,'34557','Vijay'),(409,212,'24567','Deekshith'),(411,311,'76314','Farhaan'),(413,312,'54327','Ajay'),(415,313,'74123','Nikhil'),(417,411,'43567','Preetham'),(419,412,'98764','Sridhar'),(421,345,'43561','Rohanjit'),(423,325,'78654','Ayushman'),(425,347,'67452','Anwesh'),(427,367,'91294','Devash'),(429,324,'89123','Tushar'); 43 | /*!40000 ALTER TABLE `account` ENABLE KEYS */; 44 | UNLOCK TABLES; 45 | 46 | -- 47 | -- Table structure for table `admin` 48 | -- 49 | 50 | DROP TABLE IF EXISTS `admin`; 51 | /*!40101 SET @saved_cs_client = @@character_set_client */; 52 | /*!50503 SET character_set_client = utf8mb4 */; 53 | CREATE TABLE `admin` ( 54 | `admin_id` int NOT NULL, 55 | `admin_name` varchar(50) NOT NULL, 56 | `cust_id` int DEFAULT NULL, 57 | PRIMARY KEY (`admin_id`), 58 | KEY `cust_id` (`cust_id`), 59 | CONSTRAINT `admin_ibfk_1` FOREIGN KEY (`cust_id`) REFERENCES `customer` (`cust_id`) 60 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 61 | /*!40101 SET character_set_client = @saved_cs_client */; 62 | 63 | -- 64 | -- Dumping data for table `admin` 65 | -- 66 | 67 | LOCK TABLES `admin` WRITE; 68 | /*!40000 ALTER TABLE `admin` DISABLE KEYS */; 69 | INSERT INTO `admin` VALUES (1,'Sahil',111),(2,'Karan',112),(3,'Rahul',113),(4,'Nikhil',211),(5,'Sushmitha',212),(6,'Priyanka',311),(7,'Shikha',312),(8,'Ritesh',313),(9,'Aman',411),(10,'Nitin',412),(11,'Akshat',345),(12,'Ankit',325),(13,'Shashi',347),(14,'Ritika',367),(15,'Kamchin',324); 70 | /*!40000 ALTER TABLE `admin` ENABLE KEYS */; 71 | UNLOCK TABLES; 72 | 73 | -- 74 | -- Table structure for table `billing` 75 | -- 76 | 77 | DROP TABLE IF EXISTS `billing`; 78 | /*!40101 SET @saved_cs_client = @@character_set_client */; 79 | /*!50503 SET character_set_client = utf8mb4 */; 80 | CREATE TABLE `billing` ( 81 | `meter_number` varchar(10) NOT NULL, 82 | `acc_id` int DEFAULT NULL, 83 | `cust_id` int DEFAULT NULL, 84 | `monthly_units` int DEFAULT NULL, 85 | `amount_per_unit` int DEFAULT NULL, 86 | `total_amount` int DEFAULT NULL, 87 | PRIMARY KEY (`meter_number`), 88 | KEY `acc_id` (`acc_id`), 89 | KEY `cust_id` (`cust_id`), 90 | CONSTRAINT `billing_ibfk_1` FOREIGN KEY (`acc_id`) REFERENCES `account` (`acc_id`), 91 | CONSTRAINT `billing_ibfk_2` FOREIGN KEY (`cust_id`) REFERENCES `customer` (`cust_id`) 92 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 93 | /*!40101 SET character_set_client = @saved_cs_client */; 94 | 95 | -- 96 | -- Dumping data for table `billing` 97 | -- 98 | 99 | LOCK TABLES `billing` WRITE; 100 | /*!40000 ALTER TABLE `billing` DISABLE KEYS */; 101 | INSERT INTO `billing` VALUES ('101',401,111,500,10,5000),('102',403,112,390,10,3900),('103',405,113,208,10,2080),('104',407,211,800,10,8000),('105',409,212,200,10,2000),('106',411,311,600,10,6000),('107',413,312,250,10,2500),('108',415,313,400,10,4000),('109',417,411,450,10,4500),('110',419,412,550,10,5500),('111',421,345,320,10,3200),('112',423,325,590,10,5900),('113',425,347,670,10,6700),('114',427,367,230,10,2300),('115',429,324,650,10,6500); 102 | /*!40000 ALTER TABLE `billing` ENABLE KEYS */; 103 | UNLOCK TABLES; 104 | 105 | -- 106 | -- Table structure for table `customer` 107 | -- 108 | 109 | DROP TABLE IF EXISTS `customer`; 110 | /*!40101 SET @saved_cs_client = @@character_set_client */; 111 | /*!50503 SET character_set_client = utf8mb4 */; 112 | CREATE TABLE `customer` ( 113 | `cust_id` int NOT NULL, 114 | `cust_name` varchar(50) NOT NULL, 115 | `address` varchar(50) NOT NULL, 116 | `state` varchar(30) NOT NULL, 117 | `city` varchar(30) NOT NULL, 118 | `pincode` int NOT NULL, 119 | PRIMARY KEY (`cust_id`) 120 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 121 | /*!40101 SET character_set_client = @saved_cs_client */; 122 | 123 | -- 124 | -- Dumping data for table `customer` 125 | -- 126 | 127 | LOCK TABLES `customer` WRITE; 128 | /*!40000 ALTER TABLE `customer` DISABLE KEYS */; 129 | INSERT INTO `customer` VALUES (111,'Abhay','MG Road','Karnataka','Mysore\n',570008),(112,'Vishnu','Basaveshwara Nagar','Karnataka','Bangalore',570042),(113,'Anant','HD Kote Road','Karnataka','Mysore',570009),(211,'Vijay','Devaraja Urs Road','Karnataka','Mysore',570034),(212,'Deekshith','RK Block','Karnataka','Tumkur',580054),(311,'Farhaan','KG Koppal','Karnataka','Mysore',570046),(312,'Ajay','Pamban Bridge Road','Tamil Nadu','Rameshwaram',590065),(313,'Nikhil','HSR Layout','Karnataka','Bangalore',570075),(324,'Tushar','MS Raod','Uttar Pradesh','Lucknow',640092),(325,'Ayushman','Kanakapura Road','Karnataka','Bangalore',570049),(345,'Rohanjit','Kuvempunagar','Karnataka','Mysore',570048),(347,'Anwesh','DFG Layout','Madhya Pradesh','Indore ',620089),(367,'Devash','Chambal Road','Tamil Nadu','Chennai',590068),(411,'Preetham','AB Block','Uttar Pradesh','Ayodhya',640055),(412,'Sridhar','Gwalior Road','Madhya Pradesh','Gwalior',620067); 130 | /*!40000 ALTER TABLE `customer` ENABLE KEYS */; 131 | UNLOCK TABLES; 132 | 133 | -- 134 | -- Table structure for table `elec_board` 135 | -- 136 | 137 | DROP TABLE IF EXISTS `elec_board`; 138 | /*!40101 SET @saved_cs_client = @@character_set_client */; 139 | /*!50503 SET character_set_client = utf8mb4 */; 140 | CREATE TABLE `elec_board` ( 141 | `eboard_id` int NOT NULL, 142 | `board_name` varchar(50) DEFAULT NULL, 143 | PRIMARY KEY (`eboard_id`) 144 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 145 | /*!40101 SET character_set_client = @saved_cs_client */; 146 | 147 | -- 148 | -- Dumping data for table `elec_board` 149 | -- 150 | 151 | LOCK TABLES `elec_board` WRITE; 152 | /*!40000 ALTER TABLE `elec_board` DISABLE KEYS */; 153 | INSERT INTO `elec_board` VALUES (1010,'Chamundeshwari Power Corporation'),(2010,'Karnataka Power Corporation'),(3010,'Bangalore Power Corporation'),(4010,'Tamil Nadu Power Corporation'),(5010,'Uttar Pradesh Power Corporation'),(6010,'Madhya Pradesh Power Corporation'); 154 | /*!40000 ALTER TABLE `elec_board` ENABLE KEYS */; 155 | UNLOCK TABLES; 156 | 157 | -- 158 | -- Table structure for table `invoice` 159 | -- 160 | 161 | DROP TABLE IF EXISTS `invoice`; 162 | /*!40101 SET @saved_cs_client = @@character_set_client */; 163 | /*!50503 SET character_set_client = utf8mb4 */; 164 | CREATE TABLE `invoice` ( 165 | `invoice_id` int NOT NULL, 166 | `eboard_id` int DEFAULT NULL, 167 | `account_no` varchar(50) DEFAULT NULL, 168 | `tariff_id` int DEFAULT NULL, 169 | `reading_date` date DEFAULT NULL, 170 | `Meter_number` varchar(10) DEFAULT NULL, 171 | PRIMARY KEY (`invoice_id`), 172 | KEY `eboard_id` (`eboard_id`), 173 | KEY `tariff_id` (`tariff_id`), 174 | KEY `Meter_number` (`Meter_number`), 175 | CONSTRAINT `invoice_ibfk_1` FOREIGN KEY (`eboard_id`) REFERENCES `elec_board` (`eboard_id`), 176 | CONSTRAINT `invoice_ibfk_2` FOREIGN KEY (`tariff_id`) REFERENCES `tariff` (`tariff_id`), 177 | CONSTRAINT `invoice_ibfk_3` FOREIGN KEY (`Meter_number`) REFERENCES `billing` (`meter_number`) 178 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 179 | /*!40101 SET character_set_client = @saved_cs_client */; 180 | 181 | -- 182 | -- Dumping data for table `invoice` 183 | -- 184 | 185 | LOCK TABLES `invoice` WRITE; 186 | /*!40000 ALTER TABLE `invoice` DISABLE KEYS */; 187 | INSERT INTO `invoice` VALUES (1000,6010,'98764',12,'2020-06-10','110'),(1047,4010,'91294',15,'2020-06-03','114'),(1111,1010,'11345',12,'2020-06-23','101'),(1888,1010,'43561',15,'2020-06-26','111'),(1999,3010,'78654',13,'2020-06-18','112'),(2017,6010,'67452',12,'2020-06-09','113'),(2222,3010,'12455',13,'2020-06-17','102'),(3333,1010,'98754',12,'2020-06-22','103'),(4444,1010,'34557',14,'2020-06-14','104'),(5555,2010,'24567',15,'2020-06-21','105'),(6666,1010,'76314',13,'2020-06-05','106'),(7777,4010,'54327',14,'2020-06-11','107'),(8014,5010,'89123',15,'2020-06-06','115'),(8888,3010,'74123',12,'2020-06-12','108'),(9999,5010,'43567',14,'2020-06-13','109'); 188 | /*!40000 ALTER TABLE `invoice` ENABLE KEYS */; 189 | UNLOCK TABLES; 190 | 191 | -- 192 | -- Table structure for table `tariff` 193 | -- 194 | 195 | DROP TABLE IF EXISTS `tariff`; 196 | /*!40101 SET @saved_cs_client = @@character_set_client */; 197 | /*!50503 SET character_set_client = utf8mb4 */; 198 | CREATE TABLE `tariff` ( 199 | `tariff_id` int NOT NULL, 200 | `tariff_type` varchar(50) DEFAULT NULL, 201 | PRIMARY KEY (`tariff_id`) 202 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; 203 | /*!40101 SET character_set_client = @saved_cs_client */; 204 | 205 | -- 206 | -- Dumping data for table `tariff` 207 | -- 208 | 209 | LOCK TABLES `tariff` WRITE; 210 | /*!40000 ALTER TABLE `tariff` DISABLE KEYS */; 211 | INSERT INTO `tariff` VALUES (12,'Power factor tariff'),(13,'Peak Load tariff'),(14,'Two part tariff'),(15,'Three part tariff'); 212 | /*!40000 ALTER TABLE `tariff` ENABLE KEYS */; 213 | UNLOCK TABLES; 214 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 215 | 216 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 217 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 218 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 219 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 220 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 221 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 222 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 223 | 224 | -- Dump completed on 2021-06-29 12:31:55 225 | --------------------------------------------------------------------------------