You are on page 1of 8

CONTENTS






ER diagram of college database
Queries for creating tables of college database
Class Table
Student Table
Subject Table
Lecturer Table

ER diagram of college database:- .

Queries for creating tables of college database Class Class_id description Student Student_name Student_id Address Class_identi Subjects Class_iden Subject_id Subject_name Lecturer Lecturer_id Lecturer_name Class_ident Subject_ide .

Creating Class table:create table class100( class_id number. output:- CLASS_ID --------- DESCRIPTION --.'tenth_standard'). insert into class100 values(75. description varchar(20).'tenth_standard'). insert into class100 values(13.------------- 10 eight_standard 13 ninth_standard 45 tenth_standard 67 eight_standard .'eight_standard').'eight_standard'). inserting the values for class table:insert into class100 values(10. insert into class100 values(67.'ninth_standard'). primary key(class_id)). insert into class100 values(45.

Vijayanagar.-----------#290.Bogadhi. insert into student101 values('Nishanth'.Bangalore'.Mysore'.2nd cross.75).'#57.Mysore'.------.5.Moodalapalya.2nd cross. student_id number.'#533.'#45.'#109.Vidyaranyapuram.45). insert into student101 values('Shreyas'.75 tenth_standard Creating student table:create table student101( student_name varchar(10).20. insert into student101 values('Ravi'.10).------- --------- Dighanth 17 Ashok 5 ADDRESS CLASS_IDENTI .Mysore #109.Mysore'.17.67). Inserting the values for student table:insert into student101 values('Dighanth'.Kuvempunagar.'#290.21.Bangalore 10 13 . primary key(student_name). class_identi number.Bangalore'.Kuvempunagar.Vijayanagar. address varchar(40).13). foreign key(class_identi)references class100(class_id)). insert into student101 values('Ashok'.34. output:STUDENT_NA STUDENT_ID ---------.---------------------------------------.

1532.Mysore Creating subjects table:create table subjects100( class_iden number. insert into subjects100 values(67.Ravi 20 #533.Moodalapalya. insert into subjects100 values(45.----------- 10 1531 social 13 1532 science 45 1538 maths 67 1539 english 45 67 75 . primary key(subject_id).1531.1538.'kannada' Output:CLASS_IDEN ---------- SUBJECT_ID --------- SUBJECT_NA ---.'english'). subject_name varchar(10).1540. subject_id number. insert into subjects100 values(75.Bangalore Shreyas 34 #45.'social'). foreign key(class_iden)references class100(class_id)).Vidyaranyapuram.Bogadhi.1539.'science').Mysore Nishanth 21 #57.'maths'). Inserting the values for subjects table:insert into subjects100 values(10. insert into subjects100 values(13.

75.1540).45.1539). insert into lecturer102 values(25.'Suresh'. Output:LECTURER_ID ----------- LECTURER_N CLASS_IDENT SUBJECT_IDE ---------. foreign key(subject_ide)references subjects100(subject_id)). insert into lecturer102 values(19. lecturer_name varchar(10).67.'Kumar'.13. class_ident number.75 1540 kannada Creating lecturer table:- create table lecturer102( lecturer_id number.1532).'Rakesh'.1538).--- -------- ----------- 12 Shobha 10 1531 15 Rakesh 13 1532 . subject_ide number.1531). insert into lecturer102 values(15.'Shobha'. insert into lecturer102 values(21. primary key(lecturer_id). Inserting the values for lecturer table:insert into lecturer102 values(12.10.'Geetha'.

19 Kumar 45 1538 21 Suresh 67 1539 25 Geetha 75 1540 .