Laboratory Activity#4
Laboratory Activity#4
Laboratory Activity#4
Objective:
The objective of this laboratory exercise is to provide students with hands-on experience of the basic
process of creating and managing databases in MYSQL. The students will be able to create database
and tables, insert data, and manage data through MYSQL workbench or the command-line client
Materials:
• Computers with MYSQL Server and Workbench installed
Duration:
This exercise is designed for a single 2 to 2:30 -hour session.
Instructions:
Part 1: Creating a Database and Tables
From the given diagram create database and tables
2. Discuss the role of primary keys in ensuring data integrity within a table.
Answer: Primary keys are the identifier of the table in which they can be borrowed to other tables as
foreign keys.
3. What challenges did you encounter when inserting, updating, or deleting data, and how did you
resolve them?
Answer: Main problems I encountered are ensuring that each row should have their own data types
and whether it should be auto incremented or not. I just stick to what I have learned to which data types rows
should be for example for the ID it should be an INT not a string also updating it should be auto incremented
so that every time the admin will input new data it will generate new ID in order, but not all ID should be auto
incremented, such as course id, they have their own ID which will led to that course and course name.
4. Reflect on how SQL queries can be used to retrieve meaningful data from a database. Provide
examples based on the queries you ran during the exercise.
Answer: If you want to find all students enrolled in a particular program, you can join the students and
programs tables.
This query provides the names of students enrolled in the "Information Technology" program, showing how
SQL joins help connect student records to specific programs. It is really convenient, you can pinpoint where
and what data you want to retrieve from the database.
IT69: System Administration and Maintenance
5. Why is it important to understand how to manage and manipulate data within a database, and how
does this skill apply to real-world applications?