Dbms Program 15 Mdu
Dbms Program 15 Mdu
PROGRAM NO. 15
Objective: - Create table named student2 that contains following fields: 1. Roll number of integer type (primary key) 2. Class of character type Create another table teacher that contains following fields: 1. Student roll number as referential integrity constraint 2. Faculty name of character type 3. Faculty id of integer type 4. Qualification of character type. Now retrieve the roll number of the students who are being taught by teachers of CSE. SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 12 15:05:18 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SQL> create table student2_cse10409 2 ( 3 roll_no number(5) primary key, 4 class char(5) 5 ); Table created SQL> create table teacher_cse10409 2 ( 3 roll_no number(5), 4 constraint fk_rollno foreign key(roll_no) references student2_cse10409(roll_no), 5 faculty_name char(10), 6 faculty_id number(5), 7 qualification char(10) 8 ); Table created. 1. Retrieving the roll number of the students who are being taught by teachers of CSE. SQL> select teacher_cse10409.roll_no,student2_cse10409.class from teacher_cse10409,student2_cse10409 where student2_cse10409.class='cse' and teacher_cse10409.roll_no=student2_cse10409.roll_no;
SBIT/CSE/IV/DBMS/CSE-212-F
CSE/10/409
SBIT/CSE/IV/DBMS/CSE-212-F
CSE/10/409