Himalayan Group of Professional Institutions Kala Amb, Sirmaur, H.P
Himalayan Group of Professional Institutions Kala Amb, Sirmaur, H.P
PRACTICAL
FILE ON
DATABASE MANAGEMENT
SYSTEM
BTECH CSE 4 TH
2023
SUMITTED TO:-SUBMITTED BY
MS. ANJANA SHARMAKULBHUSHAN
BTECH ROLL NO.
21011303018
S PRACTICAL Name DATE SIGN
NO.
01 Demonstration of create DATABASE
and user SQL commands.
02 Demonstration of create table with not
null, unique, primary key and auto
increment constraints and describe
table SQL commands.
03 Demonstration of insert into SQL
commands.
04 Demonstration of select SQL
commands with different methods.
05 Demonstration of where clause with
select SQL commands.
06 Demonstration of the SQL AND, OR,
and NOT operators.
07 Demonstration of the ALTER,TABLE
ADD column, DROP column SQL
commands.
08
Demonstration of update SQL
commands.
09 Demonstration of AGGREGATE
function such as SUM(), AVG(), MIN(),
MAX(), COUNT().
10 Demonstration of joint clause.
PRACTICAL --1
The USE DATABASE statement is used to select the existing SQL databases.
PRACTICAL—2
SELECT Syntax
SELECT column1, column2, ...
FROM table_name;
Here, column1, column2, ... are the field names of the table you want to select data from.
If you want to select all the fields available in the table, use the following
syntax:
SELECT * FROM table_name;
PRACTICAL--5
DEMO 1
DEMO 2
PRACTICAL--6
The AND operator displays a record if all the conditions separated by AND are TRUE.
DEMO TABLE
(1)AND Operator
AND Syntax
SELECT column1, column2, ...
FROM table_name
WHERE condition1 AND condition2 AND condition3 ...;
(1) OR Operator
OR Syntax
SELECT column1, column2, ...
FROM table_name
WHERE condition1 OR condition2 OR condition3 ...;
Demonstration of the ALTER TABLE, ADD Column, DROP Column SQL Commands.
PRACTICAL--9
Demonstration of AGGREGATE FUNCTION such as SUM(), AVG(), MIN(), MAX(), COUNT().
(1) AGGREGATE FUNCTION An aggregate function in SQL performs a calculation on multiple values
and returns asingle value.
DEMO Record
(2) SUM () FUNCTION The SUM () function returns the total sum of a numeric column .
SUM () Syntax
SELECT SUM(column_name)
FROM table_name
WHERE condition;
(3)AVG () FUNCTION
The AVG () function returns the average value of a numeric column.
AVG () Syntax
SELECT AVG(column_name)
FROM table_name
WHERE condition;
(4) COUNT () FUNCTION
The COUNT () function returns the number of rows that matches a specified criterion.
COUNT () Syntax
SELECT COUNT(column_name)
FROM table_name
WHERE condition;
DEPARTMENT TABLE: