• Mauvais document ? Échangez-le gratuitement
  • Rédigé par des étudiants ayant réussi
  • Disponible immédiatement après paiement
  • Lire en ligne ou en PDF
Vendre
Où étudie-tu ?
La langue
Document preview thumbnail
Aperçu 3 sur 19 pages
Notes de cours

Lab 06: Sql Dml | Insert Update Delete | Hbo | 2026/27

Document preview thumbnail
Aperçu 3 sur 19 pages

Lab manual for Database Management Systems covering SQL Data Manipulation Language (DML) at HBO Facility Management. This practical lab focuses on INSERT, UPDATE, and DELETE operations in MySQL, with hands-on activities using a university student database and MySQL Workbench. Essential for mastering data modification techniques and understanding best practices like using WHERE clauses safely before executing changes.

Aperçu du contenu

DATABASE SYSTEMS LAB MANUAL




LAB 06
SQL : Data Manipulation Language (DML)
Topic: INSERT, UPDATE, DELETE
1. Objective:
By the end of this lab, you will be able to:
1. Understand the purpose of Data Manipulation Language (DML).
2. Differentiate between inserting, updating, and deleting records.
3. Insert a single record into a MySQL table.
4. Insert multiple records into a table.
5. Update existing records using the UPDATE statement.
6. Use the WHERE clause to identify specific records for modification.
7. Delete selected records using the DELETE statement.
8. Verify database changes using the SELECT statement.
9. Execute SQL commands in MySQL Workbench.
10. Understand the consequences of executing UPDATE or DELETE without a WHERE clause.


2. HARDWARE AND SOFTWARE REQUIRED:
Hardware
 PC or laptop
 Keyboard and mouse
Software
 MySQL Server
 MySQL Workbench
 Windows, Linux, or macOS
Other requirements
 Access to the university LMS
 Lab manual and a folder for saving screenshots
 Completion of introductory SQL labs, particularly database creation, table creation,
and basic SELECT queries

3. INTRODUCTION TO DML
3.1 What is SQL?
SQL stands for Structured Query Language. It is used to communicate with relational database systems.
Through SQL, users can create database structures, insert data, retrieve records, modify information, and remove records.
For example, a university database may contain student names, roll numbers, programs, and semesters. SQL allows the university
to add new students, correct existing information, or remove records when required.
3.2 What is DML?
DML stands for Data Manipulation Language.
DML commands are used to manipulate the data stored inside database tables.
In this lab, we will study three important DML commands:
1|Page

, DATABASE SYSTEMS LAB MANUAL
Command Purpose Real-life example
INSERT Adds new records Registering a new student
UPDATE Modifies existing records Correcting a student's semester
DELETE Removes existing records Removing a test record
Important distinction: These commands manipulate the records inside a table. They do not create the database or table structure
itself.

4. UNDERSTANDING THE PRACTICAL EXAMPLE
Throughout this lab, we will use a university student database.
Suppose a university maintains the following student information:
Student_ID Student_Name Program Semester
101 Ali BSCS 2
102 Sara BSAI 3
103 Ahmed BSSE 2
Each row represents one student, while each column represents a particular attribute of that student.
Our practical activities will demonstrate how to add, modify, and remove these records.



PRACTICAL ACTIVITIES:
Practical Activity 1: PREPARE THE DATABASE AND TABLE
Step 1: Open MySQL Workbench
Open MySQL Workbench and connect to your MySQL Server.
Step 2: Create or select the database
If you have already created UniversityDB in an earlier lab, execute:
USE UniversityDB;
If the database does not exist, create it first:
CREATE DATABASE UniversityDB;

USE UniversityDB;
Step 3: Create the Students table
Execute the following SQL statement:
CREATE TABLE Students (
Student_ID INT PRIMARY KEY,
Student_Name VARCHAR(50),
Program VARCHAR(30),
Semester INT
);
Understanding the code
 CREATE TABLE Students creates a table named Students.
 Student_ID INT stores an integer student ID.
 Student_ID INT PRIMARY KEY makes the student ID unique and prevents duplicate or NULL
IDs.
 Student_Name VARCHAR(50) stores a student's name.
 Program VARCHAR(30) stores the program name.
 Semester INT stores the semester number.

2|Page

, DATABASE SYSTEMS LAB MANUAL
If you created the table in a previous lab, do not run the same CREATE TABLE statement again. Use
the existing table.
Step 4: Verify the table
DESCRIBE Students;
Observe the table structure displayed in the output area.
Screenshot requirement: Capture the table structure in MySQL Workbench.




Practical Activity 2 : INSERT A SINGLE RECORD
 What does INSERT do?
The INSERT statement adds a new record to a database table.
For example, when a new student registers at a university, their information must be added to the student
database.
Syntax
INSERT INTO table_name
(column1, column2, column3)
VALUES
(value1, value2, value3);
 INSERT INTO specifies the target table.
 The column list specifies where the data will be stored.
 VALUES provides the actual data.
Activity:
Insert the following student into the Students table:
Student_ID Student_Name Program Semester
101 Ali BSCS 2
Execute:
3|Page

Infos sur le Document

Cours
Publié le
30 octobre 2026
Nombre de pages
19
Écrit en
2026/2027
Type
Notes de cours
Professeur(s)
M. huzaifa yasir khan
Contient
Toutes les classes
€7,19

Mauvais document ? Échangez-le gratuitement Dans les 14 jours suivant votre achat et avant le téléchargement, vous pouvez choisir un autre document. Vous pouvez simplement dépenser le montant à nouveau.
Rédigé par des étudiants ayant réussi
Disponible immédiatement après paiement
Lire en ligne ou en PDF

Vendu
0
Abonnés
0
Éléments
7
Dernière vente
-



Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions