0% found this document useful (0 votes)
202 views

Dbms Gtu File Prcs

(1) The document describes several tables - DEPOSIT, BRANCH, CUSTOMERS - and provides the structure and sample data for each using SQL queries. It also lists queries and results to retrieve specific data fields and filter on conditions. (2) Several SELECT queries are run against the tables to list data fields, join tables, and apply filters. Results are shown displaying the requested data fields and rows that meet the criteria. (3) Examples include listing all data from each table, retrieving account numbers and amounts over a threshold, and selecting between date ranges.

Uploaded by

Salah habbi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
202 views

Dbms Gtu File Prcs

(1) The document describes several tables - DEPOSIT, BRANCH, CUSTOMERS - and provides the structure and sample data for each using SQL queries. It also lists queries and results to retrieve specific data fields and filter on conditions. (2) Several SELECT queries are run against the tables to list data fields, join tables, and apply filters. Results are shown displaying the requested data fields and rows that meet the criteria. (3) Examples include listing all data from each table, retrieving account numbers and amounts over a threshold, and selecting between date ranges.

Uploaded by

Salah habbi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

(1) Describe deposit, branch.

Query: DESC DEPOSIT_74;


Output:
Name Null Type
------ ---- ------------
ACTNO VARCHAR2(20)
CNAME VARCHAR2(20)
BNAME VARCHAR2(20)
AMOUNT NUMBER(15,2)
ADATE DATE

Query: DESC BRANCH_74;


Output:
Name Null Type
----- --- ------------
BNAME VARCHAR2(20)
CITY VARCHAR2(20)

(2) Describe borrow, customers.

Query: DESC CUSTOMERS_74;


Output:
Name Null Type
----- ---- ------------
CNAME VARCHAR2(20)
CITY VARCHAR2(20)

(3)List all data from table DEPOSIT

Query: SELECT * FROM DEPOSIT_74;


Output:
ACTNO CNAME BNAME AMOUNT ADATE
-------------------- -------------------- -------------------- ---------- ---------
100 ANIL VRCE 1000 01-MAR-95
101 SUNIL AJNI 5000 04-JAN-96
102 MEHUL KAROLBAGH 3500 17-NOV-95
103 MADHURI CHANDI 1200 17-DEC-95
105 PRMOD M.G ROAD 3000 27-MAR-96
106 SANDEEP ANDHERI 2000 31-MAR-96
107 SHIVANI VIRAR 1000 05-SEP-95
108 KRANTI NEHRU PLACE 5000 02-JUL-95

1
109 MINU POWAI 7000 10-AUG-95
10 rows selected

(4) List all data from table BORROW.

Query: SELECT * FROM BORROW_74;


Output:
LOANNO CNAME BNAME AMOUNT
-------------------- -------------------- -------------------- ----------
201 ANIL VRCE 1000
206 MEHUL AJNI 5000
311 SUNIL DHARAMPETH 3000
321 MADHURI ANDHERI 2000
375 PRMOD VIRAR 8000
481 KRANTI NEHRU PLACE 3000
6 rows selected

(5) List all data from table CUSTOMERS.

Query: SELECT * FROM CUSTOMERS_74;


Output:
CNAME CITY
-------------------- --------------------
ANIL CALCUTTA
SUNIL DELHI
MEHUL BARODA
MANDAR PATNA
MADHURI NAGPUR
PRAMOD NAGPUR
SANDIP SURAT
SHIVANI BOMBAY
KRANTI CALCUTTA
NAREN CALCUTTA
10 rows selected

(6)List all data from table BRANCH.

Query: SELECT * FROM BRANCH_74;


Output:
BNAME CITY
-------------------- --------------------
VRCE NAGPUR
AJNI NAGPUR
CHANDI DELHI
DHARAMPETH NAGPUR
M.G ROAD BANGLORE
ANDHERI BOMBAY
VIRAR BOMBAY
NEHRU PLACE DELHI
POWAI BOMBAY
9 rows selected

(7)Give account no and amount of depositors.

Query: SELECT ACTNO , AMOUNT FROM DEPOSIT_74;


Output:
ACTNO AMOUNT
-------------------- ----------
100 1000
101 5000
102 3500
103 1200
105 3000
106 2000
107 1000
108 5000
109 7000
10 rows selected

2
(8)Give name of depositors having amount greater than 4000.

Query: SELECT CNAME FROM DEPOSIT_74 WHERE AMOUNT > 4000;


Output:
CNAME
-------------------
SUNIL
KRANTI
MINU
3 rows selected

(9)Give name of customers who opened account after date '1-12-96’

Query: INSERT CNAME FROM DEPOSIT_74 WHERE ADATE > ’1-DEC-96’


Output: no rows selected

3
(1) Retrieve all data from employee, jobs and deposit.

Query: SELECT * FROM EMPLOYEE_74;


Output:
EMP_NO EMP_NAME EMP_SAL EMP_COMM DEPT_NO
---------- ------------------------------ ---------- ---------- ----------
101 SMITH 800 20
102 SNEHAL 1600 30 25
103 ADAMA 1100 0 20
104 AMAN 3000 15
105 ANITA 5000 50000 10
106 SNEHA 2450 24500 10
107 ANAMIKA 2975 30

Query: SELECT * FROM JOB_74;


Output:
JOB_ID JOB_TITLE MIN_SAL MAX_SAL
--------------- ------------------------------ ---------- ----------
IT PROGRAM PROGRAMMER 4000 10000
MK MGR MARKETING MANAGER 9000 15000
FI MGR FINANCE MANAGER 8200 12000
FI_ACC ACCOUNT 4200 9000
LEC LECTURER 6000 17000
COMP_OP COMPUTER OPERATOR 1500 3000

Query: SELECT * FROM DEPOSIT_74;


Output:
A_NO CNAME BNAME AMOUNT ADATE
----- --------------- ---------- ---------- ---------
101 ANIL ANDHERI 7000 01-JAN-06
102 SUNIL VIRAR 5000 15-JUL-06
103 JAY VILLEPARLE 6500 12-MAR-06
104 VIJAY ANDHERI 8000 17-SEP-06
105 KEYUR DADAR 7000 19-NOV-06
106 MAYUR BORIVALI 5500 21-DEC-06

4
(2) Give details of account no. and deposited rupees of customers having
account opened between dates 01-01-06 and 25-07-06.

Query: SELECT A_NO , AMOUNT FROM DEPOSIT_74


WHERE ADATE BETWEEN '01-JAN-06' AND '25-JUL-06';

Output:

A_NO AMOUNT
----- ----------
101 7000
102 5000
103 6500

(3) Display all jobs with minimum salary is greater than 4000.

Query: SELECT JOB_ID, JOB_TITLE FROM JOB_74 WHERE MIN_SAL>4000;


Output:
JOB_ID JOB_TITLE
--------------- -------------------------------------

MK MGR MARKETING MANAGER


FI MGR FINANCE MANAGER
FI_ACC ACCOUNT
LEC LECTURER

(4) Display name and salary of employee whose department no is 20.Give


alias name to name of employee.

Query: SELECT EMP_NAME AS NAME , EMP_SAL FROM EMPLOYEE_74 WHERE


DEPT_NO=20;
Output:
NAME EMP_SAL
------------------------------ ----------
SMITH 800
ADAMA 1100

(5) Display employee no,name and department details of those employee


whose department lies in(10,20).

Query: SELECT EMP_NO , EMP_NAME , EMP_SAL FROM EMPLOYEE_74


WHERE DEPT_NO IN (10,20);
Output:
EMP_NO EMP_NAME EMP_SAL
---------- ------------------------------ ----------
101 SMITH 800
103 ADAMA 1100
105 ANITA 5000
106 SNEHA 2450

5
(1) Display all employees whose name start with ‘A’ and third character
is ‘ ‘a’.

Query: SELECT * FROM EMPLOYEE_74 WHERE EMP_NAME LIKE 'A_A%';


Output:
EMP_NO EMP_NAME EMP_SAL EMP_COMM DEPT_NO
---------- ------------------------------ ---------- ---------
103 ADAMA 1100 0 20
104 AMAN 3000 15
107 ANAMIKA 2975 30

(2) Display name, number and salary of those employees whose name is
5 characters long and first three characters are ‘Ani’ .

Query: SELECT EMP_NAME , EMP_NO , EMP_SAL FROM EMPLOYEE_74 WHERE


EMP_NAME LIKE 'ANI%' AND LENGTH(EMP_NAME)=5;
Output:
EMP_NAME EMP_NO EMP_SAL
------------------------------ ---------- ----------
ANITA 105 5000

(3) Display the non-null values of employees and also employee name
second character should be ‘n’ and string should be 5 character
long.

Query: SELECT * FROM EMPLOYEE_74 WHERE EMP_COMM IS NOT NULL AND


EMP_NAME LIKE '_N%' AND LENGTH(EMP_NAME)=5;
Output:
EMP_NO EMP_NAME EMP_SAL EMP_COMM DEPT_NO
---------- ------------------------------ ---------- ---------- ----------
105 ANITA 5000 50000 10
106 SNEHA 2450 24500 10

(4) Display the null values of employee and also employee name’s third
character should ‘a’ .

Query: SELECT * FROM EMPLOYEE_74 WHERE EMP_COMM IS NULL AND


EMP_NAME LIKE '__A%' ;
Output:
EMP_NO EMP_NAME EMP_SAL EMP_COMM DEPT_NO
---------- ------------------------------ ---------- ---------- ----------
104 AMAN 3000 15
107 ANAMIKA 2975 30

6
7
8

You might also like