0% found this document useful (0 votes)
2 views26 pages

MySQL Final File

This document is a practical file for Computer Science Class XII, focusing on MySQL commands and data manipulation. It includes acknowledgments, an introduction to MySQL, a list of contents, and various SQL queries related to different tables. The file demonstrates the use of commands like SELECT, UPDATE, and INSERT through structured questions and inputs.

Uploaded by

rajpoots13209
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)
2 views26 pages

MySQL Final File

This document is a practical file for Computer Science Class XII, focusing on MySQL commands and data manipulation. It includes acknowledgments, an introduction to MySQL, a list of contents, and various SQL queries related to different tables. The file demonstrates the use of commands like SELECT, UPDATE, and INSERT through structured questions and inputs.

Uploaded by

rajpoots13209
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/ 26

LOVELY PUBLIC

SR. SEC. SCHOOL

MySQL File
Computer Science - Class XII
By - Sinjan Roy
Class - XII-C
Roll No - 23

1
Acknowledgement
I extend my sincere appreciation to all those
who played a crucial role in the completion of
this practical file.

This endeavor was made possible through


the support and guidance of my dedicated
teacher Mr. Arun Khanna Sir, who provided
invaluable assistance throughout the project.

I would also like to thank our Principal Mrs.


Bhawna Malik Mam for providing us with the
computer facilities

Furthermore, my friends and classmates


deserve special acknowledgment for their
collaborative efforts, which greatly enriched
the final result.

-​ Thank You

2
Introduction
In this data-oriented world, MySQL has
become a highly powerful tool to store and
manipulate data

Hence it has become important to


understand and program on SQL

In this file, a few tables have been created


and several commands has been performed
over them

Commands such as SELECT, UPDATE,


ORDER BY and INSERT have been used

Every program is written is a simple and


easy-to-understand manner

The names and code for each table has been


provided as well

Each Question comprises of 2 individual


tables

3
List of Contents
1)​ Tables Used………………………………………………………………..5

i) Question 1………………………………………………………………..5

ii) Question 2………………………………………………………………6

iii) Question 3……………………………………………………………...8

iv) Question 4……………………………………………………………10

v) Question 5……………………………………………………………..11

2)​Questions and Inputs……………………………………………….13

i) Question 1………………………………………………………………13

ii) Question 2……………………………………………………………..16

iii) Question 3……………………………………………………………18

iv) Question 4……………………………………………………………21

v) Question 5…………………………………………………………….23

4
Tables Used
Question 1

Table - STOCK

5
Table - DEALERS

Question 2)

Table - TEACHER

6
Table - POSTING

7
Question 3)

Table - STORE

8
Table - PRODUCTS

9
Question 4)

Table - TRAINER

Table - COURSE

10
Question 5)

Table - SCHOOL

11
Table - ADMIN

12
Questions and Inputs
Question 1)

Write SQL commands for the following statements

Table - STOCK

Table - DEALERS

i) To Display all items in STOCK table in ascending order

Input -

Output -

13
ii) To display ItemNo and Item name of those items from
STOCK table whose UnitPrice is more than Rupees 10

Input-

Output -

14
iii) To display the details of those items whose dealer code
(Dcode) is 102 or quantity in STOCK (Qty) is more than 100
from the table Stock.

Input-

Output-

iv) To display maximum UnitPrice of items for each dealer


individually as per Dcode from the table STOCK.

Input-

Output-

15
Question 2)

Table - TEACHERS

i) To display number of teacher and their departments


from the tables TEACHER and DEPARTMENT

Input-

Output-

16
ii) Select the earliest and oldest date of joining of the
teachers from table TEACHER

Input -

Output-

iii) Display the name and department of teacher where the


posting location is Delhi

Input -

Output-

iv) Increment the Salary of all teachers who are from


Computer Science department and whose Salary is less
than 20000

17
Input -

Output-

Question 3)

18
i) To display details of all the items in the STORE table in
ascending order of LastBuy

Input -

Output-

ii) To display Item No and Item Name of those items from


STORE table whose Rate is more than 15 Rupees

Input-

19
Output-

iii) To display the details of those items whose supplier


code (Scode) is 22 or Quantity in Store is more than 110
from the table STORE

Input-

Output-

iv) Display the amount of capital generated by the item


whose ItemNo = 2004;

Input-

20
Output-

Question 4)

i) Display the Trainer name, City & Salary in the


descending order of their Hiredate.

Input-

Output-

21
ii) To display the Tname and City of Trainer who joined the
Institute in the month of December 2001

Input-

Output-

iii) To display Teacher name, Hiredate, Course name,


joining date from tables TRAINER and COURSE of all
those courses whose fees is less than or equal to 10000

Input-

Output-

iv) To display number of trainer from each city

22
Input-

Output-

Question 5)

23
i) To display Teacher Name, Periods of all teachers whose
periods are more than 25

Input-

Output-

ii) To display the information from the table SCHOOL in


descending order of experience

Input-

Output-

24
iii) To display designation without duplicate entries from
the table ADMIN

Input-

Output-

iv) To display Teacher Name, Teacher Code, and


corresponding Designation from tables SCHOOL ad
ADMIN of Male teachers

Input-

Output-

25
*************************************************

26

You might also like