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

Esai Seshan Mysql Practical 2

Uploaded by

seshanesai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Esai Seshan Mysql Practical 2

Uploaded by

seshanesai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Mysql Practical 2: Working with DDL and

DML statements.
Esai Seshan , ROLL NO:25
I]Table 1:Member
1]Create the table Member with a Primary key constraint on TNO and NOT
NULL constraints on TNAME, SALARY, AREA, AGE, GRADE, and DEPT. Decide your
own suitable data types.

2] Show the structure of the table

3] Insert records in the table Member.

4] Display all the records from the table Member.


5] Display TNO and TNAME of all employees from the table Member.

6] Drop the NOT NULL constraint of DEPT.

7] Add one more column Address with 20 characters after TNAME

8] Add one more column SNO as an integer data type as the first field.
9] Add one more column BONUS as an integer data type at the end.

10] Modify the data type of TNAME to VARCHAR(30).

11] Drop the primary key constraint.

12] Add a primary key constraint to TNAME.

13] Drop the table Member.


ii]Table 2: Empl
1] Create the table Empl with a Primary key constraint on EMPNO and NOT
NULL constraints on ENAME, JOB, HIREDATE, SAL, and DEPTNO.

2] Insert records into the table Empl.

3] Display all the records from the table Empl.

4] Display EMPNO and ENAME of all employees from the table Empl.
5] Display ENAME, SAL, and SAL added with COMM from the table Empl.

6] Write a query to display employee name, salary, and department


number who are not getting commission from the table Empl.

7] Write a query to display employee number, name, salary, and SAL * 12


as Annual Salary from the table Empl

8] List all records where salary is less than 10000 from the table Empl

9] List all records where salary is between 20000 and 50000 from the
table Empl.
10] List the details of all employees who have four letters in their name.

11] List the details of all employees whose name starts with 'M'.

12] List the details of all employees whose name ends with 'A'.

13] List the names of all employees whose commission is not null.

14] List the names of all employees who are either CLERK or SALESMAN.
15] List all records in descending order of department number.

16] List all records in descending order of salary.

17] Increase the salary of all employees by 1000.

18] Delete all records where commission is null.


19] Drop the table Empl.
III]Table 3:Club
-The table where the following commands is used

1] To show all the information about female coaches.

2] To display a report, showing coach name, pay, age, and bonus (15% of pay)
for all the coaches.
3] Write a SQL query to display all the information of coaches who are getting a
salary in the range of 10000 to 20000.

4] How can you display all the information of coaches who are less than 35 years
of age using SQL?

5] What SQL query would you use to display all the information of KARATE and
BASKETBALL coaches?

6] Write a SQL query to display all the information about male coaches having
age above 35.

7] How can you retrieve all the information of coaches having C05 or C07 as
coach_id using SQL?
8] What SQL query would display all the information of coaches who were hired
in the year 1998?

9] Write a SQL query to display distinct sports from the table.

10] To display information of all the coaches whose name starts with S.

11] To display information of all the coaches whose name ends with A.

12] To display information of all the coaches who have five-letter names.
13] To list the names of all coaches with their date of joining (DATOFJOIN) in
descending order.

14] To list all the information about coaches in ascending order of age.

15] To list all the information about coaches in descending order of age and
ascending order of pay.

16] To list all the information about coaches in ascending order of name.
17] To increase the pay of all the coaches by 1000.

18] To decrease the pay of all the male coaches by 500.

19] To change the age to 40 of coaches whose coach_id is C04.

20] To change the age to 47 and sports to SWIMMING for coaches whose
coach_id is C08.
21] To delete all the records of male coaches who are below 35 years of age.

22] To delete all the records of female coaches.

23] To change the age to 47 of coaches whose name starts with S.

24] To delete the table.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy