0% found this document useful (0 votes)
13 views7 pages

Holiday Homework XII

Uploaded by

harshtpo13
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)
13 views7 pages

Holiday Homework XII

Uploaded by

harshtpo13
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/ 7

Computer Science

Program File
Class XII

1) Consider the table TEACHER given below. Write commands in SQL


TEACHER
ID Name Department Hiredate Category Gender Salary
1 Taniya SocialStudies 03/17/1994 TGT F 25000
2 Abhishek Art 02/12/1990 PRT M 20000
3 Sanjana English 05/16/1980 PGT F 30000
4 Vishwajeet English 10/16/1989 TGT M 25000
5 Aman Hindi 08/1/1990 PRT F 22000
6 Pritam Math 03/17/1980 PRT F 21000
7 RajKumar Science 09/2/1994 TGT M 27000
8 Sital Math 11/17/1980 TGT F 24500

i. Create table Teacher having ID int, Name char(90), Department


char(40), Hiredate(30), Category char(4), Gender char(4), Salary float.
ii. Insert 10 Records in the table.
iii. To display all information about teachers of Female PGT Teachers.
iv. To list names, departments, and date of hiring of all the teachers in
descending order of date of joining.
v. To count the number of teachers and sum of their salary department
wise.
vi. To display all information about teachers whose name starts with “A”.
vii. To increase the salary by 500 of those teachers whose category is PGT.

2) Write SQL commands for the following queries (i) to (v) based on the
relations TRAINER & COURSE given below:
i) Create table Trainer and Course.
ii) Insert 10 Records in the table.
iii) Display all details of Trainers who are living in city CHENNAI.
iv) Display the Trainer Name, City & Salary in descending order of
their Hiredate.
v) Count & Display the number of Trainers in each city.
vi) Display the Course details which have Fees more than 12000 and
name ends with ‘A’.
vii) Display the Trainer Name & Course Name from both tables where
Course Fees is less than 10000.

3) Write SQL commands for the following queries based on the relations
Bank and CUSTOMER.

Bank
Acc_no Cname Bname Amount Dateofopen T_Transaction
1 Karan Bank of baroda 15000 12-jan 1998 10
2 Puneet State bank 25000 01-feb-1997 09
3 Anirban Oriental bank 17000 15-jul1999 05
4 Yatin Standard 38000 10-feb-1999 11
charted
5 Sunny State bank 47000 06-feb-1998 15
6 Jayant Uco bank 34000 10-aug- 07
1998
7 Nikhil Bank of baroda 56000 02-jan-1999 12
8 Tarun Oriental bank 22000 04-apr-1999 08
9 Jisha Uco bank 34500 05-jan-1998 11

CUSTOMER
C_no Tname Tbank
1 Yatin Standard charted
2 Sunny State bank
3 Puneet Uco bank
4 Nikhil Bank of baroda
5 Varun Oriental bank

(i) Create Table Customer and Bank.


(ii) Insert 10 records in both tables.
(iii) To display data for all customers whose transaction is between
8 and 11.
(iv) To display data for all customers sorted by their dateofopen.
(v) To count the number of customers with amount<30000.
(vi) list the minimum and maximum amount from the table bank.
(vii) To increase the amount with 1000 of those customers whose
transactions is more than 10.

Note:
• Font Size- 16
• Font Style- Calibri (Body)
BAL BHARTI SCHOOL,
BAHADURGARH
PRACTICAL FILE

CLASS XII

SUBJECT - COMPUTER SCIENCE

Name of the Student- XYZ


Section – A
Index
Page No. Program T.Sign
6 1. Sql Commands
SQL Commands :
1) Create table Teacher having ID int, Name char(90), Department char(40),
Hiredate(30), Category char(4), Gender char(4), Salary float.

You might also like