-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
30 lines (27 loc) · 811 Bytes
/
Copy pathdatabase.sql
File metadata and controls
30 lines (27 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
CREATE DATABASE loan_management;
USE loan_management;
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(100) UNIQUE,
password VARCHAR(255),
role ENUM('admin','user') DEFAULT 'user',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE loans (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
loan_amount DECIMAL(10,2),
interest_rate DECIMAL(5,2),
loan_term INT,
emi DECIMAL(10,2),
status ENUM('Pending','Approved','Rejected') DEFAULT 'Pending',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE repayments (
id INT AUTO_INCREMENT PRIMARY KEY,
loan_id INT,
amount DECIMAL(10,2),
paid_date DATE,
status ENUM('Paid','Unpaid') DEFAULT 'Unpaid'
);