DBMS LabReport
DBMS LabReport
Submitted by Submitted to
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:
(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
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
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: