Nagpal DBMS File

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

CBS Group of Institutions

PRACTICAL FILE
Database Management System

Submitted to:- Submitted by:-


Ms.Pooja Sharma Muskaan Nagpal
Reg.No. 2013061297
INDEX

S.No Program Date Signature


.

1 Create a table 31/03/2022

2 Insert the value in the table 31/03/2022

3 Display all the values in the table 31/03/2022

4 Delete the value in the table 07/04/2022

5 Modify in the table by adding the new 07/04/2022


column in the table

6 Drop a column in the table. 07/04/2022

7 Update the values of in the table. 21/04/2022

8 Arrange the values in the descending 21/04/2022


order.

9 Arrange the values in the ascending 21/04/2022


order.

10 Calculate the average value 28/04/2022

11 Group the result-set by one column 28/04/2022

12 Using HAVING 28/04/2022

13 Create a New Table 05/05/2022

14 Create a view to display details of 05/05/2022


employees working in more than one
project and in one project.

15 Perform the union operations by 05/05/2022


joining the two tables.
16 Display the values between the given 12/05/2022
range.

17 Calculate a length of the string 12/05/2022

18 Display the record using OR operator 12/05/2022

19 Display the record using AND 19/05/2022


operations

20 Display the multiple values. 19/05/2022

21 Using LIKE operator to display a specific 19/05/2022


pattern

22 Display the maximum values in the 26/05/2022


table.

23 Display the minimum values in the 26/05/2022


table

24 Count the total number of rows in the 02/06/2022


table

25 Using NATURAL JOIN. 02/06/2022

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