0% found this document useful (0 votes)
79 views19 pages

Dbms File

This document contains instructions for performing various SQL commands on database tables. It includes commands to create and populate tables, select data, order and group results, update table contents, and alter table structures. The instructions are demonstrated on sample tables for employees and departments that are created and populated throughout the document. Various selection criteria and ordering are applied to the employee data and outputs are displayed after each query.
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)
79 views19 pages

Dbms File

This document contains instructions for performing various SQL commands on database tables. It includes commands to create and populate tables, select data, order and group results, update table contents, and alter table structures. The instructions are demonstrated on sample tables for employees and departments that are created and populated throughout the document. Various selection criteria and ordering are applied to the employee data and outputs are displayed after each query.
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/ 19

AMITY SCHOOL OF ENGINEERINNG TECHNOLOGY

DATABASE MANAGEMENT SYSTEM


PRACTICAL FILE

NAME 
COURSE & SECTION 
ENROLLMENT NO. 

Submitted To: -

1
INDEX

S.NO. SQL COMMANDS SIGN


1 CREATE TABLE command

2 The INSERT command

3 THE SELECT and DISPLAY command

4 The ORDER BY CLAUSE

5 The DISTINCT command

6 The IN, NOT IN command

7 The GROUP BY -HAVING CLAUSE

8 The JOIN command

9 THE UPDATE command

10 THE ALTER TABLE command

11 CREATING TABLE FROM EXISITING TABLE

12 The DROP TABLE command

13

14

15

16

17

18

19

2
SQL COMMANDS

1 To create table EMP.


2. To Insert values in table EMP.

Output:-

3
3.To display table EMP.
4. To insert more values in table EMP.
5. To show table EMP.

Output: -

4
6.To select maximum salary from table EMP.
7.To select minimum salary from table EMP.
8.To calculate sum of salary from table EMP.

Output: -

5
9. To display the salary of employees in alphabetical order whose salary is
greater than 5000.
10. To display the list of employee’s salary in descending order of EMPNO.
11. To list employees whose name begins with letter ‘A’.

Output: -

6
12. To List Details of employees whose name is having letter ‘A’ at second
position.
13. To List Employee details whose length of name is 3.
14. To List Employee details whose length of name is 4.
15. To List Employee details whose length of name is 5.

Output: -

7
16. To list details of DEPTNO in table EMP with distinct values.
17. To Count number of repeating Deptno. from table EMP.
18. To count no. of employees in Table EMP with reference to their
department wise.
19. To display maximum salary of employees as per their Deptno from
table EMP .
20. To display Deptno where the number of employees are greater than 2
from table EMP.

Output: -

8
21. To display the detail of that employee whose having maximum salary
from table EMP.
22.To display the detail of employee whose Empno=15 from table EMP.
23.To display the detail of employee whose name is SPARSH.
24.To display the detail of employee whose name is TIA.
25. To display the name of employee whose salary is greater than 5000 but
less than 15000.

Output: -

9
23.To display the ENAME and EMPNO of employees whose DEPTNO is
either 10 or 20 from table EMP.
27. To display the details of employees whose DEPTNO lies between 10
,20 or 30 from table EMP.
28. To display the details of employees whose DEPTNO do not lies
between 10 ,20 or 30 from table EMP.
29. To display the details of employees whose DEPTNO lies between 20 or
30 from table EMP.

Output: -

10
30. Create new table DEPT with its no., name and its location.
31. Insert values into table DEPT as per the columns.
32.Display table DEPT.

Output: -

11
33. To display the details of employees with their department name and
department no. from table EMP and DEPT.

Output: -

34. To show table MANAGER


Output: -

12
35. Create another table as EMP2 and copy all values from table EMP.
36. To delete table EMP2.

Output: -

13
37. To add coloumn JOB in table EMP.
38. To change the salaray of employee RIDHIMA to 45000 in table emp.
39. display the table EMP.
40. To change the salaray of employee RUHI to 16000 in table emp.
Output: -

14
41. To change the JOB of employee SUBHASH to ‘pilate’ in table emp.
Output: -

15
42. To change the JOB of employee RIDHIMA to ‘engineer’ in table emp.
43. To change the JOB of employee JOHN to ‘STAFF’ in table emp.
44. To change the JOB of employee NRG to ‘TEACHER’ in table emp.
45.To change the JOB of employee TIA to ‘LAWYER’ in table emp.
46. To change the JOB of employee KSHVI to ‘DOCTOR’ in table emp.
47. To change the JOB of employee ARMAN to ‘GARDENER’ in table emp.
48. To change the JOB of employee ISHAN to ‘MANAGER’ in table emp.
49. To change the JOB of employee SPARSH to ‘ENGINEER’ in table
emp.
50. To change the JOB of employee MANIKA to ‘TEACHER’ in table emp.
52. Display the details of EMP.
Output: -
Next Page

16
17
53. To change the JOB of employee RUHI to ‘CHEF’ in table emp.
54. To display the distinct jobs of employees from table EMP.
Output: -

18
55. To count number of distinct jobs of employees in table EMP.
Output: -

19

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