You are on page 1of 17

DELHI GLOBAL INSTITUTE OF

TECHNOLOGY
PRACTICAL FILE
Database Management System

Submitted to:- MS. PUJA SHARMA


Submitted by:- PULLELA SNEHA LATHA
Reg.No. 2113081370

INDEX
S.No. Program Date Signature
1 Create a table 18/01/2023
2 Insert the value in the table 18/01/2023
3 Display all the values in the table 25/01/2023
4 Delete the value in the table 25/01/2023
5 Modify in the table by adding the new 01/02/2023
column in the table
6 Drop a column in the table. 01/02/2023
7 Update the values of in the table. 08/02/2023
8 Arrange the values in the descending 08/02/2023
order.
9 Arrange the values in the ascending 15/02/2023
order.
10 Calculate the average value 15/02/2023
11 Group the result-set by one column 22/02/2023
12 Using HAVING 22/02/2023
13 Create a New Table 01/03/2023
14 Create a view to display details of 01/03/2023
employees working in more than one
project and in one project.
15 Perform the union operations by 15/03/2023
joining the two tables.
16 Display the values between the given 15/03/2023
range.
17 Calculate a length of the string 22/03/2023
18 Display the record using OR operator 22/03/2023
19 Display the record using AND 29/03/2023
operations
20 Display the multiple values. 29/03/2023
21 Using LIKE operator to display a specific 05/04/2023
pattern
22 Display the maximum values in the 05/04/2023
table.
23 Display the minimum values in the 12/04/2023
table
24 Count the total number of rows in the 12/04/2023
table
25 Using NATURAL JOIN. 19/04/2023
PROGRAM 1
Write a program to create a table .
Syntax : create table <table name>(column_name1 datatype(size),column_name2 datatype size()......);

PROGRAM 2
Create a program to insert the values in the table.

Syntax : insert into <table_name> values (value 1,value


2,....,value n);

PROGRAM 3
Create a program to display all the values in the table.
Syntax : select *from <table name>;

PROGRAM 4
Create a program to delete the value in the table.

Syntax : delete from <table_name>


where <Condition> ;

Table after deleting the value :

PROGRAM 5
Create a program to modify in the table by adding the new
column in the above table.
Syntax : alter table <table_name> add(column_name1
datatype(size), column_name2 datatype(size),.....
column_name n datatype(size));

PROGRAM 6
Create a program to drop a column in the table.

Syntax : alter table <table_name> drop column


<column_name>;

PROGRAM 7
Create a program to update the values of in the table.
Syntax : update <table_name> set column 1=expression where
<condition>;

PROGRAM 8
Create a program to arrange the values in the descending
order.

Syntax : select <column name > from < table_name > order by
< column name > desc ;

PROGRAM 9
Create a program to arrange the values in the ascending order.

Syntax : select < column name > from < table name > order by
< column name > asc ;
PROGRAM 10
Create a program to calculate the average value.

Syntax : select AVG( column name )


from <table name>;

PROGRAM 11
Create a program to group the result- set by one column.

Syntax : select <column name> from <table name> where


<condition> group by <column name>;
PROGRAM 12
Create a program using HAVING .

Syntax : select <column name> from <table name>


group by <column name>
having <conditions> ;

PROGRAM 13
Creating a New Table :

Inserting The Values IN The Table


Displaying the values :

PROGRAM 14
Create a view to display
details of employees
working in more than
one project and in one project.

Syntax : create view view_name AS


select column1, column2, ...
from table_name
where condition;
PROGRAM 15
Create a program to perform the union operations by joining
the two tables.
Syntax : select
table_name1.column_name,table_name2.column_name
from table_name1,table_name2
where condition ;

Table 1 -

Table 2 -
After joining the two tables -

PROGRAM 16
Create a program to display the values between the given
range.

Syntax : select column_name from table_name


where column_name BETWEEN value1 AND value2;
PROGRAM 17 :
Create a program to calculate a length of the string.

Syntax : select LENGTH(column_name) from table_name


where condition ;

PROGRAM 18
Create a program to display the record using OR operator.

Syntax : select from table_name where condition 1 OR


condition2 OR ...condition n;

PROGRAM 19
Create a program to display the record using AND operation.

Syntax : select from table_name where condition1 AND


condition2 AND .... condition n ;

PROGRAM 20
Create a program to display the multiple values .

Syntax : select from table_name where column_name


IN(value 1,value 2,..., value n);

PROGRAM 21
Create a program using LIKE operator to display a specified
pattern .
Syntax : select from table_name where column_name LIKE
pattern ;

PROGRAM 22
Create a program to display the maximum values in the table.

Syntax : select MAX(column_name) from table_name ;

PROGRAM 23
Create a program to display the minimum values in the table .
Syntax : select MIN(column_name) from table_name ;

PROGRAM 24
Create a program to count the total number of rows in the
table.

Syntax : select COUNT(column_name) from table_name ;

PROGRAM 25
Create a program using NATURAL JOIN

Syntax : select from table_name1 NATURAL JOIN table_name2


;

You might also like