• Verkeerd document? Gratis ruilen
  • Geschreven door studenten die geslaagd zijn
  • Direct beschikbaar na je betaling
  • Online lezen of als PDF
Verkopen
Kies je studieland
Kies je taal
Document preview thumbnail
Voorbeeld 3 van de 19 pagina's
College aantekeningen

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

Document preview thumbnail
Voorbeeld 3 van de 19 pagina's

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.

Voorbeeld van de inhoud

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

Documentinformatie

Geüpload op
30 oktober 2026
Aantal pagina's
19
Geschreven in
2026/2027
Type
College aantekeningen
Docent(en)
M. huzaifa yasir khan
Bevat
Alle colleges
€7,04

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Verkocht
0
Volgers
0
Items
7
Laatst verkocht
-

Echte notities, van echte studenten
Elk document op Stuvia is geschreven door een medestudent die hetzelfde vak deed. Zo leer je van iemand die het al heeft gehaald.



Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen