You are on page 1of 12

DEPARTMENT OF TECHNICAL

EDUCATION ANDHRA PRADESH


Name : M.Bhagya Lakshmi,
Designation : Lecturer in CCP,
Institution : GMR Polytechnic, Gajwel
Branch : DCCP
Semester : V Semester
Major Topic : SQL Plus
Sub –Topic : SQL EDITOR
Subject name : RDBMS
Subject Code : CCP- 505
Duration : 50 min.
Teaching Aids : PPT
CCP505.48 1
Objectives:
On the completion of this period you
would be able to know
 Compute command
 Break command

CCP505.48 2
Recap

We have learned about


 The Commands related to the SQL Reports

CCP505.48 3
Compute and break command

 To organize rows of reports into subsets


 To perform summation on group of rows, break
and compute commands are used
 The break command also suppresses duplicate
values

CCP505.48 4
Break command
Syntax:
BREAK ON <break_column> skip n;

Example:
SQL BREAK ON deptno skip 2;
SQL>select deptno from emp;

CCP505.48 5
Compute command

 To perform computation on the row in each


subset we use the ‘COMPUTE’ command
 We cannot perform the ‘COMPUTE’ function
without issuing a ‘BREAK’ command

CCP505.48 6
Syntax:-
BREAK ON <col_name>
Compute function of column.. On break_column..;

CCP505.48 7
Example:

 SQL>BREAK ON deptno;
 SQL>COMPUTE SUM OF sal ON deptno;
 SQL>SELECT deptno,sal FROM emp;

CCP505.48 8
 COMPUTE command has no effect without a
corresponding BREAK command.
 COMPUTE function of column on break_column;
 FUNCTIONS
SUM,MIN,MAX,AVG,STD,VAR,COUNT,NUM

CCP505.48 9
Summary

We have discussed about


 Compute command
 Break command

CCP505.48 10
Quiz

1. To remove COMPUTE definitions we use


a) Clear break
b) Clear compute
c) Clear column heading
d) all

CCP505.48 11
Frequently Asked Questions

1. Explain the use of COMPUTE and BREAK


commands in SQL PLUS

CCP505.48 12

You might also like