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

Computer Science (1)

idk

Uploaded by

asanonae0
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Computer Science (1)

idk

Uploaded by

asanonae0
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

SQL PART

1. Create a database flRACTICAL

2. Call the database flRACTICAL

3. Create a table COURSE

4. Insert values into table COURSE

5. Display the table COURSE


6. Write MySQL commands for the following
a. To show all information about the students of
history department.

b. To list the names of female students who are in


indi Department.

c. To list names of all the students with their date of


admission in ascending order.

d. To display student’s name, fees, age for male students


only.
e. List details of students paid fees between 500 and 900.

f. To calculate and display fees paid for each department.

g. To insert a new row in the table.

h. To set date of admission to 17th May 2009 of student with


ID 7.
i. To delete records of female students who have paid
less than 500.

j. To add a new column named “Duration” of integer type to


record period in months for the course.

k. To display departments without repetition.

l. To display details of students age wise.


m. To list details of those whose name starts with s and
ends with l.
7. Create table STAFF and SALARY
8. Insert values into tables STAFF and SALARY
9. Write MySQL commands for the following:
a. To create table Staff with ID as flrimary Key and ame
should not be null.

b. To list the names of all male employees working in


finance department.

c. To list the names fi departments of employees in lower case.

d. To display details of employees in descending


order of experience.

e. To display details of employees who have experience of


5 to 10 years using BETWEE operator.
f. To set experience of employee with ID 114 to 5yrs.

g. To list names fi gender of all employees getting basic


salary more than 25000.

h. To delete records of employee getting allowance more than

1500.
i. To display records of employees who have letter a in their

name.
j. To display names of all employees along with tax to be
deducted with a column alias. (Tax = 20% of salary)

k. To display no of employees working in each department.

l. To add a column Address in table staff of varchar type


with size 30.

m. To display department wise total salary of employees.

n. To delete the Salary table permanently.


10. Write MySQL commands for the following:
a. Select ID, Allowance+ Allowance* comm /100 As “Sal”
from salary where ID>109;

b. Select name, dept from staff where name like ‘_a%’;

c. Select count(Distinct dept) from staff;

d. Select Min(experience) from staff where

department=’Sales’;

You might also like