0% found this document useful (0 votes)
7 views10 pages

DBMS LabReport

The lab report outlines exercises in SQL database management, including creating databases, tables, and inserting data using XAMPP and phpMyAdmin. It covers fundamental SQL commands like CREATE DATABASE, USE, CREATE TABLE, INSERT INTO, and SELECT, as well as data manipulation techniques such as filtering, sorting, and removing duplicates. The report concludes with successful demonstrations of SQL operations, particularly using the NOT operator for data filtering.
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)
7 views10 pages

DBMS LabReport

The lab report outlines exercises in SQL database management, including creating databases, tables, and inserting data using XAMPP and phpMyAdmin. It covers fundamental SQL commands like CREATE DATABASE, USE, CREATE TABLE, INSERT INTO, and SELECT, as well as data manipulation techniques such as filtering, sorting, and removing duplicates. The report concludes with successful demonstrations of SQL operations, particularly using the NOT operator for data filtering.
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/ 10

Lab Report – 01

Course Title: Database Management System Lab Work


Course Code: CSE 2367

Submitted by Submitted to

Name : Md Mehedi Hassan Rumana Islam


Student ID : 41230301594 Lecturer, CSE
Section :F
Semester : 5th

Date of Submission
23 February, 2025
Objective: To learn the fundamental steps involved in creating a database, defining a table
structure, and inserting data using SQL commands within a XAMPP environment.

Procedure: This lab focused on the core SQL commands for database and table manipulation.
The following steps were performed:

(i). Database Creation:


The first step involved creating a new database. The CREATE DATABASE command was
used for this purpose. The syntax is as follows:
CREATE DATABASE database_name;
Where database_name is the desired name for the new database. For example, to create
a database named “classroom”the command would be:

(ii). Database Selection:


After creating the database, it needs to be selected for subsequent operations. For this the USE
command is used. The syntax for USE command is :
USE database_name;
Continuing the previous example, to use the “classroom" database, the command would be:

(iii).Table Creation:
To store data, we need to define a table with appropriate column names and data types. The
following SQL command creates a table:
CREATE TABLE table_name ( column1_name
datatype(size), column2_name datatype(size)
);
For example, to create a table named "students" with columns for student ID (integer), name
(string), phone(integer) and email(string) the following command is:
(iv).Data Insertion:
Once the table is created, data can be inserted using the INSERT INTO command. The syntax is:
INSERT INTO table_name (column1_name, column2_name,
...)
VALUES (value1, value2, ...);
For example, to insert a record into the "students" table:
(v). Table Verification:

After creating the table and inserting data, it's crucial to verify that the table structure and data
are as expected. This can be done using the following SQL commands:
SELECT * FROM table_name; For
“student” table:
Output:
Conclusion:
This lab provided a hands-on introduction to fundamental database operations using
SQL. The CREATE DATABASE, USE, CREATE TABLE, INSERT INTO and
SELECT commands are essential building blocks for working with relational databases.
Experiment no: 02
Introduction: In this lab, we worked with a database called studentdetails. We have used
different sql commands to select data, remove duplicates, limit results, sort data. We also
worked with where case.
Objective: we done this lab work

• To select data from a table.


• To remove duplicate data from the table using distinct.
• To limit results from the table using limit.
• To sort data in the table using order by.
• To use where case to filter data and apply condition.

Theory: At first, we have created a database named lab 02 and then we have created a table
named studentdetails. Then we inserted information into the table.
Selecting specific attribute from table using select...from: to select specific attributes
from the table we use
Select attribute_name, attribute_name From table_name;

Using distinct: to retrieve unique values from a specified column or set of columns we use
Select distinct attribute_name from table_name;

Using limit: we use limit to specify the number of records a query should return after filtering
data.
Select from table_name limit 2;
Sorting the data in ascending: to sort the data in ascending order we use Select * from
table_name order by attribute_name asc;

Sorting the data in descending: To sort the data in descending order we use Select * from
table_name order by attribute_name desc;
Using where: We use where clause to filter records. It is used to extract only those records that
fulfill a specified condition.
Select *from table_name where attribute_name condition;
Experiment no 03

Introduction: This lab introduces SQL operations using phpMyAdmin, focusing on


the NOT operator. It demonstrates how to filter, insert, and delete data from a student
table.
Objective:
● To use the SQL NOT operator to filter data.
● To execute SELECT, INSERT, and DELETE queries.
● To observe the impact of queries using phpMyAdmin.
● To practice data manipulation in a MySQL database.

Theory: SQL NOT Operator. The NOT operator is used to reverse the result of a
condition. It returns records that do not match the specified condition.

Creating table:
Inserting values:

Showing Values:

Conclusion: This lab successfully demonstrated how to:


Use the SQL NOT operator to filter out specific records. Perform basic operations
like SELECT, INSERT, and DELETE in phpMyAdmin. Visualize and verify the
results directly through the phpMyAdmin interface.

You might also like