Index: Page No
Index: Page No
Page No.
5
Q1.
b. Display the details of those games which are having Fees more
than 7000
c. Display the record of all the member whose fees is less than
8000
1
d. To display the GameName whose fees is 5000
2
Q2.
a. Display the Ename and salary of all employees whose salary more
than 20000
3
d. Display the name and salary of employees whose name id Joseph
Code:
f. Display the empno and name of employees whose salary is less than
12000
4
Q3. Write MySQL queries for the following
a. To create a database
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.
5
d. To delete the details of a particular student in the above table.
Ans. UPDATE student SET marks = marks + (marks * 0.5) where marks >20;
6
Ans. SELECT * FROM student;
i. To add a new column email in the above table with appropriate data
type
7
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;
Ans. SELECT studentid, name, dob FROM student WHERE dob BETWEEN
‘2005-01-01’ AND ‘2005-12-31’;
8
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;
Ans. SELECT studentid, name, dob, gender, marks, email FROM student
ORDER BY marks DESC;