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

Second File

IP practical file

Uploaded by

Somay Virmani
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 views

Second File

IP practical file

Uploaded by

Somay Virmani
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/ 13

Informatics Practices

Practical File
Term 2

Submitted by –
Name: Yogita Bhagchandani
Class: 11 COM A
Teacher in charge: Mrs. Vidya V

THE INDIAN HIGH SCHOOL


DUBAI
2021 - 2022
THE INDIAN HIGH SCHOOL, DUBAI
BONAFIDE CERTIFICATE

Certified that this Practical file of Informatics Practices is the


bonafide work of Yogita Bhagchandani of class 11 COM A
during the year 2021 – 2022 (Term 2)who carried out the
practical file under my supervision.
Teacher in charge:
Name: Mrs. Vidya V
Sign:
Date:
INDEX
S.No Topic
1. Data Definition Commands:
CREATE
DROP
ALTER
2. Data Query Commands:
SELECT-FROM- WHERE,
LIKE
BETWEEN,
IN,
ORDER BY
3. Manipulation Commands:
INSERT,
UPDATE,
DELETE.

Q1.
a. Display the names of all Games with their GCodes.

SELECT Gcode, Game_Name FROM club;

b. Display the details of those games which are having Fees more
than 7000

SELECT Fees FROM club WHERE fees >7000;

c. Display the record of all the member whose fees is less than
8000

SELECT * FROM club WHERE fees<8000;

d. To display the GameName whose fees is 5000

SELECT Game_Name FROM club WHERE fees=5000;

e. To display the GameName whose fees is 5000

SELECT * FROM club WHERE Game_Name='Chess';


Q2.

a. Display the Ename and salary of all employees whose salary more
than 20000

SELECT Ename, salary FROM employee WHERE salary>20000;

b. Display all the records

SELECT * FROM employee;

c. Display the details of employees whose dept id is D01

SELECT * FROM employee where DeptId='D01';

d. Display the name and salary of employees whose name id Joseph

Code:
Select Ename, salary from employee where ename='Joseph';

e. Display the distinct department id’s

Select distinct DeptId from employee;

f. Display the empno and name of employees whose salary is less than
12000

Select Empno,Ename from employee where salary <12000;

g. Display the details of employees whose Bonus is 566 and more

Select * from employee where Bonus >=566;


Q3. Write MySQL queries for the following

a. To create a database

Ans. CREATE DATABASE school;

b. To create a student table with the student id, class, section, gender,
name, dob, and marks as attributes where the student id is the
primary key.

Ans. CREATE TABLE student (Studentid int primary key, Name


varchar(10), DOB date, Gender char(6), Class int, Section char(5), Marks
int);

c. To insert the details of at least 10 students in the above table

Ans. INSERT INTO student VALUES (1, ‘Chaarvi’, ‘2005-01-01’, ‘Female’,


11, ‘B’, 30);
INSERT INTO student VALUES (2, ‘Tanish’, ‘2005-02-04’, ‘Male’, 11, ‘O’,
25);
INSERT INTO student VALUES (3, ‘Diya’, ‘2005-08-12’, ‘Female’, 11, ‘D’,
23);
INSERT INTO student VALUES (4, ‘Saaniya’, ‘2005-05-07’, ‘Female’, 11,
‘E’, 29);
INSERT INTO student VALUES (5, ‘Mansi’, ‘2005-04-09’, ‘Female’, 11, ‘E’,
19);
INSERT INTO student VALUES (6, ‘Yogita’, 2005-03-02’, ‘Female’, 11, ‘A’,
22);
INSERT INTO student VALUES (7, ‘Pari’, ‘2005-05-06’, ‘Female’, 11, ‘B’,
15);
INSERT INTO student VALUES (8, ‘Shomanshi’, ‘2005-04-05’, Female’, 11,
‘C’, 18);
INSERT INTO student VALUES (9, ‘Tamanna’, ‘2005-10-11’, ‘Female’, 11,
‘D’, 20);
INSERT INTO student VALUES (10, ‘Rahul’, ‘2005-09-10’, ‘Male’, 11, ‘E’,
27);
d. To delete the details of a particular student in the above table.

Ans. DELETE FROM student WHERE studentid=10;

SELECT * FROM STUDENT;

e. To increase marks by 5% for those students who have marks more


than 20.

Ans. UPDATE student SET marks = marks + (marks * 0.5) where marks >20;

SELECT * FROM STUDENT;

f. To display the entire content of the table


Ans. SELECT * FROM student;

g. To display Studentid, Name, Marks of those students who are scoring


marks more than 20

Ans. SELECT studentid, name, marks FROM student WHERE marks>20;

h. To find number of students who are from section ‘A’

Ans. SELECT * FROM student WHERE section=‘A’;

i. To add a new column email in the above table with appropriate data
type

Ans. ALTER TABLE student ADD email varchar (20);

j. To add the email ids of each student in previously created email


column

Ans. UPDATE student SET email=('[email protected]') where studentid=1;


UPDATE student SET email=('[email protected]') where studentid=2;
UPDATE student SET email=('[email protected]') where studentid=3;
UPDATE student SET email=('[email protected]') where studentid=4;
UPDATE student SET email=('[email protected]') where studentid=5;
UPDATE student SET email=('[email protected]') where studentid=6;
UPDATE student SET email=('[email protected]') where studentid=7;
UPDATE student SET email=('[email protected]') where studentid=8;
UPDATE student SET email=('[email protected]') where studentid=9;
SELECT * FROM student;

k. To display the information of all students whose names starts with


AN

Ans. SELECT * FROM student WHERE name LIKE ‘an%’;

l. To display Studentid, Name, DOB of those students who are born


between ‘2005-01-01’ and ‘2005-12-31’

Ans. SELECT studentid, name, dob FROM student WHERE dob BETWEEN
‘2005-01-01’ AND ‘2005-12-31’;
m. To display Studentid, Name, DOB, Marks, Email of those male
students in ascending order

Ans. SELECT studentid, name, dob, marks, email FROM student WHERE
gender=‘Male’ ORDER BY name;

n. To display Studentid, Gender, Name, DOB, Marks, Email in


descending order of marks

Ans. SELECT studentid, name, dob, gender, marks, email FROM student
ORDER BY marks DESC;

o. To display the unique section available in the table

Ans. SELECT DISTINCT section FROM student;

You might also like