PRACTICAL FILE - Term-1
PRACTICAL FILE - Term-1
OF
INFORMATION TECHNOLOGY
Subject Code: - 802
Sr. Page
Date of Practical Topic Teacher’s Signature
No. No.
MySQL
Software and Hardware requirement for MYSQL
Hardware Requirement
Software Requirement
➢Database Languages
❖Data Definition Language
• CREATE:This command is used to create a new table or relation. The syntax for this command is:
• ALTER:
• DROP:
• RENAME:
❖Data Manipulation Language
• SELECT:
• INSERT:
• UPDATE:
• DELETE:
❖Data Control Language
• GRANT:
• REVOKE:
• SAVEPOINT:
• ROLLBACK:
Database Activity-1
Write SQL commands for the following queries based on the above relations:
1) Write an SQL query to create the above table and also insert the values in to it.
FIRST_NAME CHAR(25),
LAST_NAME CHAR(25),
SALARY INT(15),
JOINING_DATE DATETIME,
DEPARTMENT CHAR(25));
…………………………………………………………………….
INSERT INTO Worker WORKER_ID, FIRST_NAME, LAST_NAME, SALARY, JOINING_DATE, DEPARTMENT) VALUES
3) Write an SQL query to fetch unique values of DEPARTMENT from Worker table.
4) Write an SQL query to print all Worker details from the Worker table order by FIRST_NAME Ascending.
5) Write an SQL query to print all Worker details from the Worker table order by FIRST_NAME Ascending
and DEPARTMENT Descending.
6) Write an SQL query to print details for Workers with the first name as “Vipul” and “Satish” from Worker
table.
7) Write an SQL query to print details of workers excluding first names, “Vipul” and “Satish” from Worker
table.
8) Write an SQL query to print details of Workers with DEPARTMENT name as “Admin”.
9) Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘a’.
10) Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘h’ and contains six
alphabets.
11) Write an SQL query to print details of the Workers whose SALARY lies between 100000 and 500000.
12) Write an SQL query to print details of the Workers who have joined in Feb’2014.
13) Write an SQL query to fetch the count of employees working in the department ‘Admin’.
14) Write an SQL query to fetch the no. of workers for each department in the descending order.
15) Write an SQL query to fetch duplicate records having matching data in some fields of a table.
16) Write an SQL query to fetch departments along with the total salaries paid for each of them.
Database Activity-2
Consider the following tables CARDEN and CUSTOMER. Write SQL commands for the
following statements:
TABLE: CARDEN
TABLE: CUSTOMER
I. To display the customer name and the corresponding name of the cars hired by them
Ans: Select Cname,Carname from CUSTOMER cus, CARDEN car where cus.Ccode=car.Ccode
IV. To display the highest charges at which a vehicle can be hired from