You are on page 1of 1

CREATE TABLE STUDENT

(RNO NUMBER(5),
NAME VARCHAR2(20),
BRANCH VARCHAR2(20));
INSERT INTO STUDENT (RNO,NAME,BRANCH) VALUES (101,’RAJU’,’CE’);
INSERT INTO STUDENT (RNO,NAME,BRANCH) VALUES (102,’AMIT’,’CE’);
INSERT INTO STUDENT (RNO,NAME,BRANCH) VALUES (103,’SANJAY’,’ME’);
INSERT INTO STUDENT (RNO,NAME,BRANCH) VALUES (104,’NEHA’,’EC’);
INSERT INTO STUDENT (RNO,NAME,BRANCH) VALUES (105,’MEERA’,’EE’);
INSERT INTO STUDENT (RNO,NAME,BRANCH) VALUES (106,’MAHESH’,’ME’);

CREATE TABLE RESULT


(RNO NUMBER(5),
SPI NUMBER(5,2));

INSERT INTO RESULT (RNO,SPI) VALUES (101,8.8);


INSERT INTO RESULT (RNO,SPI) VALUES (102,9.2);
INSERT INTO RESULT (RNO,SPI) VALUES (103,7.6);
INSERT INTO RESULT (RNO,SPI) VALUES (104,8.2);
INSERT INTO RESULT (RNO,SPI) VALUES (105,7);
INSERT INTO RESULT (RNO,SPI) VALUES (101,8.9);

Combine information from student and result table using cross join or Cartesian product.

Display Rno, Name, Branch and SPI of all students.

Display Rno, Name, Branch and SPI of CE branch’s student only.

Display Rno, Name, Branch and SPI of other than EC branch’s student only.

Display average result of each branch.

Display average result of each branch and sort them in ascending order by SPI.

Display average result of CE and ME branch.

Perform the left outer join on Student and Result tables.

Perform the right outer join on Student and Result tables.

You might also like