You are on page 1of 14

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.47 1
Objectives:

On the completion of this period you would


be able to know
 The commands associated with SQL reports

CCP505.47 2
Recap

We learned about
 SQL Reports

CCP505.47 3
Creation of Report in SQL*PLUS
 SQL*PLUS provides us with the several
commands for formatting query results

CCP505.47 4
Creation of Report in SQL*PLUS
(contd..)

 Column commands
 Compute commands
 Title commands
 Setting page dimensions
 Storage and printing commands

CCP505.47 5
Title Commands

 Title commands compressing ‘ttitle’ and ‘btitle’


are used to place top title and bottom title on
each page

CCP505.47 6
Syntax

SQL> title position_clause char_value position_clause

CCP505.47 7
Example
 SQL> ttitle center ‘EMPLOYEE DETAILS’;
 SQL> btitle center ‘PREPARED BY XXXX’;
 SQL>Select * from emp;

CCP505.47 8
Title Commands (contd..)

To suppress the title definition,


SQL > ttitle off;
SQL >btitle off;

CCP505.47 9
Title Commands (contd..)

 Generate a report in the format given below:


EMPLOYEE RECORD
DEPARTMENT_NO EMP_NAME SALARY
xxx xxxx xxx
prepared by xxxxx

CCP505.47 10
Query
 Ttitle ‘EMPLYEE RECORD’ skip 1
 Btitle center ‘prepared by xxxx’
 Column deptno heading ‘DEPARTMENT_NO’
 Column ename heading ‘EMP_NAME’
 Column sal heading ‘SALARY’
 Select deptno,ename,sal from emp;

CCP505.47 11
Summary
We have discussed about
 Title command

CCP505.47 12
Quiz
1. To place top title on each page_________
Command is used
a) Btitle
b) Ttitle
c) Column command
d) all

CCP505.47 13
Frequently Asked Questions

1. Explain any four formatting commands used in


SQL PLUS

CCP505.47 14

You might also like