-
Notifications
You must be signed in to change notification settings - Fork 0
/
Regtables.sql
158 lines (127 loc) · 4.7 KB
/
Regtables.sql
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
DROP TABLE IF EXISTS STUDENT_REG_DETAILS;
DROP TABLE IF EXISTS STUDENT_JEE_DETAILS;
DROP TABLE IF EXISTS STUDENT_DESEASE;
DROP TABLE IF EXISTS STUDENT_PAYMENTS;
DROP TABLE IF EXISTS DD_DB;
DROP TABLE IF EXISTS STUDENT_10_DB;
DROP TABLE IF EXISTS STUDENT_12_DB;
DROP TABLE IF EXISTS STUDENT_CURR_ADD;
DROP TABLE IF EXISTS STUDENT_PER_ADD;
DROP TABLE IF EXISTS STUDENT_DOCUMENTS;
DROP TABLE IF EXISTS STUDENT_JEE_DETAILS;
DROP TABLE IF EXISTS STUDENT_FORM;
CREATE TABLE STUDENT_FORM(
JEE_ROLL_NO INTEGER UNIQUE,
FORM_ID INTEGER auto_increment primary KEY,
DATE_OF_REG DATE
);
CREATE TABLE STUDENT_REG_DETAILS(
JEE_ROLL_NO INTEGER PRIMARY KEY,
SNAME VARCHAR(30),
GENDER VARCHAR(1),
BLOOD_GROUP VARCHAR(5),
DOB DATE,
MOBILE1 VARCHAR(11),
EMAIL VARCHAR(30),
AADHAR_NO VARCHAR(20),
BRANCH VARCHAR(3),
MINORITY VARCHAR(10),
FATHER_NAME VARCHAR(30),
FATHER_OCCUPATION VARCHAR(30),
MOTHER_NAME VARCHAR(30),
MOTHER_OCCUPATION VARCHAR(30),
PARENT_MOBILE VARCHAR(11),
HOSTEL_REQ VARCHAR(5),
PHOTO VARCHAR(30),
SIGN VARCHAR(30),
FOREIGN KEY(JEE_ROLL_NO) REFERENCES STUDENT_FORM(JEE_ROLL_NO)
);
CREATE TABLE STUDENT_DESEASE(
JEE_ROLL_NO INTEGER,
CHRONIC_DISEASE VARCHAR(4),
DETAILS VARCHAR(100),
FOREIGN KEY(JEE_ROLL_NO) REFERENCES STUDENT_FORM(JEE_ROLL_NO)
);
CREATE TABLE DD_DB(
DD_NO VARCHAR(20) PRIMARY KEY,
DD_DATE DATE,
DD_AMOUNT INTEGER
);
CREATE TABLE STUDENT_PAYMENTS(
JEE_ROLL_NO INTEGER PRIMARY KEY,
JOSSA_DD VARCHAR(20),
INST_DD VARCHAR(20),
FOREIGN KEY(JEE_ROLL_NO) REFERENCES STUDENT_FORM(JEE_ROLL_NO),
FOREIGN KEY(JOSSA_DD) REFERENCES DD_DB(DD_NO),
FOREIGN KEY(INST_DD) REFERENCES DD_DB(DD_NO)
);
CREATE TABLE STUDENT_10_DB(
JEE_ROLL_NO INTEGER PRIMARY KEY,
BOARD_NAME VARCHAR(30),
PASSING_YEAR VARCHAR(4),
PERCENTAGE INTEGER,
FOREIGN KEY(JEE_ROLL_NO) REFERENCES STUDENT_FORM(JEE_ROLL_NO)
);
CREATE TABLE STUDENT_12_DB(
JEE_ROLL_NO INTEGER PRIMARY KEY,
BOARD_NAME VARCHAR(30),
SUBJECT VARCHAR(30),
PASSING_YEAR VARCHAR(4),
PERCENTAGE INTEGER,
FOREIGN KEY(JEE_ROLL_NO) REFERENCES STUDENT_FORM(JEE_ROLL_NO)
);
CREATE TABLE STUDENT_CURR_ADD(
JEE_ROLL_NO INTEGER PRIMARY KEY,
ADDRESS VARCHAR(100),
CITY VARCHAR(30),
STATE VARCHAR(30),
PIN_CODE VARCHAR(6),
PHONE VARCHAR(11),
FOREIGN KEY(JEE_ROLL_NO) REFERENCES STUDENT_FORM(JEE_ROLL_NO)
);
CREATE TABLE STUDENT_PER_ADD(
JEE_ROLL_NO INTEGER PRIMARY KEY,
ADDRESS VARCHAR(100),
CITY VARCHAR(30),
STATE VARCHAR(30),
PIN_CODE VARCHAR(6),
PHONE VARCHAR(11),
FOREIGN KEY(JEE_ROLL_NO) REFERENCES STUDENT_FORM(JEE_ROLL_NO)
);
CREATE TABLE STUDENT_DOCUMENTS(
JEE_ROLL_NO INTEGER PRIMARY KEY,
ALLOTMENT_LETTER VARCHAR(30),
JEE_RANK_CARD VARCHAR(30),
PHOTO_ID VARCHAR(30),
DOB VARCHAR(30),
QEXAM VARCHAR(30),
INCOME_CERTIFICATE VARCHAR(30),
CAST_CERTIFICATE VARCHAR(30),
CAST_VALIDITY VARCHAR(30),
OBC_CERTIFICATE VARCHAR(30),
DISABILITY_CERTIFICATE VARCHAR(30),
TRANSFER_CERTIFICATE VARCHAR(30),
MIGRATION_CERTIFICATE VARCHAR(30),
AADHAR_CARD VARCHAR(30),
GAP_CARD VARCHAR(30),
FOREIGN KEY(JEE_ROLL_NO) REFERENCES STUDENT_FORM(JEE_ROLL_NO)
);
CREATE TABLE STUDENT_JEE_DETAILS(
JEE_ROLL_NO INTEGER PRIMARY KEY,
ALLOTMENT_ROUND VARCHAR(2),
AIR INTEGER,
PERCENTILE INTEGER,
ALLOTMENT_CATEGORY VARCHAR(10),
CANDIDATE_CATEGORY VARCHAR(10),
FOREIGN KEY(JEE_ROLL_NO) REFERENCES STUDENT_FORM(JEE_ROLL_NO)
);
INSERT INTO STUDENT_FORM VALUES(1,1);
-- INSERT INTO STUDENT_REG_DETAILS(JEE_ROLL_NO,SNAME,GENDER,BLOOD_GROUP,DOB,MOBILE1,MOBILE2,EMAIL,AADHAR_NO,BRANCH,MINORITY,FATHER_NAME,FATHER_OCCUPATION,MOTHER_NAME,MOTHER_OCCUPATION,PARENT_MOBILE,HOSTEL_REQ,PHOTO,SIGN)
-- VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);
INSERT INTO STUDENT_DESEASE( JEE_ROLL_NO,CHRONIC_DISEASE,DETAILS) VALUES(?,?,?);
INSERT INTO DD_DB(DD_NO,DD_DATE,DD_AMOUNT) VALUES(?,?,?);
INSERT INTO STUDENT_PAYMENTS( JEE_ROLL_NO,JOSSA_DD,INST_DD) VALUES(?,?,?);
INSERT INTO STUDENT_10_DB(JEE_ROLL_NO,BOARD_NAME,PASSING_YEAR,PERCENTAGE) VALUES(?,?,?,?);
INSERT INTO STUDENT_CURR_ADD(JEE_ROLL_NO,ADDRESS,CITY,STATE,PIN_CODE,PHONE) VALUES(?,?,?,?,?,?);
INSERT INTO STUDENT_JEE_DETAILS(JEE_ROLL_NO,ALLOTMENT_ROUND,AIR,PERCENTILE,ALLOTMENT_CATEGORY,CANDIDATE_CATEGORY) VALUES(?,?,?,?,?,?);
INSERT INTO STUDENT_DOCUMENTS( JEE_ROLL_NO, ALLOTMENT_LETTER, JEE_RANK_CARD , PHOTO_ID , DOB , QEXAM, INCOME_CERTIFICATE, CAST_CERTIFICATE, CAST_VALIDITY , OBC_CERTIFICATE , DISABILITY_CERTIFICATE, TRANSFER_CERTIFICATE , MIGRATION_CERTIFICATE, AADHAR_CARD , GAP_CARD) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);