Sei sulla pagina 1di 2

COMSATS Institute of Information Technology,

Department of Computing

CSC271: Database Systems

Lab 08: Data Manipulation Language

Instructor: Dr. Khalid Latif

CSC271: Database Systems Page 1




Introduction
SQL provides a subset of commands, known as data manipulation language (DML), for working
with data in the tables. This subset includes INSERT, SELECT, UPDATE and DELETE commands
to cover all create, read, update, and delete (CRUD) rows in the tables.

Objectives
After performing this lab students should be able to:

1. Manipulate data in a database using INSERT, UPDATE and DELETE commands.

Tools/Software Requirement
MySQL Community Server 5.6
MySQL Workbench 6.1

Description

1. This lab assumes that MySQL Community Server is running and the query window is
open.

Lab Task
1. Load the Alpha Auto Insurance database created in the previous lab. The schema
included following tables:
a) Persons (cnic, name, address, city, age)
b) Vehicles (registration number, district, maker, model, year, owner cnic)
c) Accidents (report number, registration number, date/time, location, region,
comments)
d) Damages (accident report number, body part, assessed amount, repair summary)
2. Insert at least couple of records in every relation using INSERT command.
a) One of the persons should have CNIC value as 12345-1234567-1.
b) Registration year of some of vehicle should be 2012 or earlier and some others
after 2012.
c) Some of the accidents should be from Islamabad region.
3. Update name of the person with 12345-1234567-1 to Ahmad.
4. Delete all vehicles registered in the year 2011.

Deliverable
Submit a PDF or plain-text document including the SQL statements to implement the given tasks in
MySQL using the Workbench.

CSC271: Database Systems Page 2

Potrebbero piacerti anche