0% found this document useful (0 votes)
27 views

Lab 09

This document provides instructions for Lab 9 on data import and export in MySQL Workbench for the course EE432 Computer Networks. It outlines 3 tasks: 1) Creating tables in a database and populating them by importing data from CSV files, then exporting data from 2 tables to CSV files. 2) An introduction to DDL, DML, DCL, and TCL statements. 3) Creating tables with columns and data types, inserting records, and establishing relationships between tables with constraints. The rubric assesses students on conducting the experiment, laboratory safety, data collection, and analysis.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Lab 09

This document provides instructions for Lab 9 on data import and export in MySQL Workbench for the course EE432 Computer Networks. It outlines 3 tasks: 1) Creating tables in a database and populating them by importing data from CSV files, then exporting data from 2 tables to CSV files. 2) An introduction to DDL, DML, DCL, and TCL statements. 3) Creating tables with columns and data types, inserting records, and establishing relationships between tables with constraints. The rubric assesses students on conducting the experiment, laboratory safety, data collection, and analysis.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Department of Electrical Engineering, UET Lahore

EE432: Computer Networks

Course Instructor: Dr. Naveed Nawaz Dated:

Semester: 7th

Session: Fall 2023

LAB 9 Data Import and Export in MySQL Workbench

Name Roll. No. Total Marks Obtained Marks Viva Marks

Checked on: ____________________________

Signature: ____________________________

23
EE432 Computer Networks

9.1 Task 1

Show all steps and attach the files that were used to import data and that were populated after exporting data from database

I. Create a new Database with all the tables as mentioned below:

• HOTEL (HotelNo, hotelName, city)

• GUEST (GuestNo, guestName, guestAddress)

• ROOM (RoomNo, HotelNo, type, price)

• BOOKING (HotelNo, GuestNo, DateFrom, DateTo, RoomNo)

INT: HotelNo, guestNo, RoomNo

FLOAT: Price

DateTime: DateFrom, DateTo

Varchar: HotelName, City, guestName, guestAddress, Type

II. Populate each table with at least 3 rows by importing data from the CSV file

III. Transfer the data of at least 2 tables from DB to CSV files

9.2 Task 2

Introduction to DDL-DML and Constraints

Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:

o CREATE - to create objects in the database

o ALTER - alters the structure of the database

o DROP - deletes objects from the database

o TRUNCATE - removes all records from a table, including all spaces allocated for the records are removed

Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:

o SELECT - retrieves data from the a database

o INSERT - inserts data into a table

o UPDATE - updates existing data within a table

o DELETE - deletes records from a table, the space for the records remain

Data Control Language (DCL) statements. Some examples:

o GRANT - gives user's access privileges to database

o REVOKE - withdraws access privileges given with the GRANT command

24
Error! Reference source not found.

Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to
be grouped together into logical transactions.

o COMMIT - saves work done

o SAVEPOINT - identifies a point in a transaction to which you can later roll back

o ROLLBACK - restores database to original since the last COMMIT

9.3 Task 3

I. Create Table Departments with column DepartmentID, DepartmentName, DeptHeadID with DepartmentID as
primary key. Set the data types in accordance to the real time scenario.

II. Create Table Employees with column EmployeeID, EmployeeName with EmployeeID as primary key. Set the
data types in accordance to the real time scenario.

III. Alter Table Departments by adding new column DepartmentCode.

IV. Insert at least two records in both tables.

V. Develop foreign key relation between two tables.

VI. Implement referential integrity constraint of Set Null on Delete Rule on above relationship.

VII. Implement referential integrity constraint of Set Cascade on Update Rule on above relationship.

Note:

Please zip your report and CSV files and name the zipped folder with your roll no. Please send your zip folder.
EE432 Computer Networks

Assessment Rubrics for EE432: Computer Networks Lab 9


Student Name: ______________________________ Roll Number: _____________________________
Method:
Lab report evaluation and instructor observation during lab sessions.
Outcomes Assessed:
a. Ability to condut experiments as well as to analyze and interpret data
b. Ability to adhere to safety and disciplinary rules
c. Ability to use the techniques, skills and modern engineering tools necessary for engineering practice

Performance Exceeds expectation (5-4) Meets expectation (3-2) Does not meet expectation (1) Marks
Realization Downloads and installs Incapable of selecting relevant
Needs guidance to set up
of required software and sets up software to the experiment and
the system according to the
experiment the system according to the unable to setup the system with
experiment requirements
(a) experiment requirements required software tools
Carries out each procedural Needs assistance or
Conducting step in a satisfactory manner guidance to proceed Unable to carry out procedural
experiment and studies outputs of the through experiment steps, steps and make any useful
(a, c) software application studies outputs with minor observations of outputs
rigorously errors in interpretation
Laboratory
Observes lab safety rules; Observes safety rules and
safety and Disregards lab safety and
adheres to the lab disciplinary disciplinary guidelines with
disciplinary disciplinary rules
guidelines aptly minor deviations
rules (b)
Completes data collection
Completes data collection Fails at collecting data by
from the experiment setup by
with minor error and enters giving proper inputs and
Data following procedural steps,
data in lab manual with observing output states of
collection (c) ensures that the data is entered
slight deviation from experiment setup, unable to fill
in the lab manual according to
guidelines the lab manual properly
the specified instructions
Analyzes the data obtained Analyzes data with minor
from experiment thoroughly error and correlates it with Unable to establish the
and accurately verifies it with theoretical values relationship between practical
Data analysis
theoretical understanding, reasonably. Attempts to and theoretical values and lacks
(a, c)
accounts for any discrepancy account for any the theoretical understanding to
in data from theory with discrepancy in data from explain any discrepancy in data
sound explanation theory

26

You might also like