SQL QUERIES
TABLE CREATION
Table: department
create table
department(dno number(5)PRIMARY KEY,dname varchar(15));
Table created.
Table: student
create table
student(regno number(7)NOT NULL, studname varchar(15), dno number(5), bookno
number(6) PRIMARY KEY, issuedon date NOT NULL, tobereturnon date NOT NULL);
Table created.
INSERTION
Department
insert into department values('&dno','&dname');
select * from
department;
DNO
|
DNAME
|
205
|
IT
|
104
|
CSE
|
105
|
ECE
|
107
|
MECH
|
109
|
EEE
|
Student
insert into
student
values('®no','&studno','&dno','&bookno','&issuedon','&tobereturnon');
select * from
student;
REGNO
|
STUDNAME
|
DNO
|
BOOKNO
|
ISSUEDON
|
TOBERETUR
|
10475
|
Vani
|
104
|
7725
|
11-DEC-11
|
10-JAN-12
|
20548
|
Mani
|
205
|
7245
|
16-DEC-11
|
15-JAN-12
|
10568
|
Anu
|
105
|
6662
|
17-DEC-11
|
01-JAN-12
|
20562
|
Risha
|
205
|
7277
|
04-DEC-11
|
03-JAN-12
|
10966
|
Priya
|
109
|
2270
|
05-DEC-11
|
04-JAN-12
|
20548
|
Mani
|
205
|
6675
|
17-DEC-11
|
01-JAN-12
|
10568
|
Anu
|
105
|
6742
|
17-DEC-11
|
01-JAN-12
|
10568
|
Anu
|
105
|
652
|
17-DEC-11
|
01-JAN-12
|
8 rows selected.
No comments:
Post a Comment