Docsity

Introduction to DBMS, MySQL & Database Creation — Practical Notes, Exercises of Database Management Systems (DBMS)

Toggle sidebar
bg1
DATABASE MANAGEMENT SYSTEM LAB
MANUAL
1 | P a g e
M
Database vs File System, DBMS Basics, and Creating Your First Database
1. Objective:
By the end of this lab, students will be able to:
Understand the basic concept of a database.
Understand what a Database Management System (DBMS) is.
Differentiate between a file system and a database system.
Understand the basic components of a database.
Understand the purpose of MySQL.
Explore the basic interface of MySQL Workbench.
Connect to a MySQL server using MySQL Workbench.
Create a database using SQL.
Select and view a database in MySQL Workbench.
Understand the basic relationship between a database, table, rows, and columns.
2. HARDWARE AND SOFTWARE REQUIRED :
Hardware
PC or Laptop
Minimum 4 GB RAM
Keyboard and Mouse
Internet connection
Software
MySQL Server
MySQL Workbench
Windows / Linux / macOS operating system
Web browser for accessing learning resources, if required
Other Requirements
Access to LMS
Student's assigned lab folder for saving screenshots
Basic knowledge of computer operation
3. INTRODUCTION
What is Data?
Data is a collection of raw facts and values that can be stored and processed.
Examples:
Student name
Student ID
Course name
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Introduction to DBMS, MySQL & Database Creation — Practical Notes and more Exercises Database Management Systems (DBMS) in PDF only on Docsity!

DATABASE MANAGEMENT SYSTEM LAB MANUAL 1 | P a g e

Database vs File System, DBMS Basics, and Creating Your First Database

1. Objective:

By the end of this lab, students will be able to:  Understand the basic concept of a database.  Understand what a Database Management System (DBMS) is.  Differentiate between a file system and a database system.  Understand the basic components of a database.  Understand the purpose of MySQL.  Explore the basic interface of MySQL Workbench.  Connect to a MySQL server using MySQL Workbench.  Create a database using SQL.  Select and view a database in MySQL Workbench.  Understand the basic relationship between a database, table, rows, and columns.

2. HARDWARE AND SOFTWARE REQUIRED:

Hardware  PC or Laptop  Minimum 4 GB RAM  Keyboard and Mouse  Internet connection SoftwareMySQL ServerMySQL Workbench  Windows / Linux / macOS operating system  Web browser for accessing learning resources, if required Other Requirements  Access to LMS  Student's assigned lab folder for saving screenshots  Basic knowledge of computer operation

3. INTRODUCTION

 What is Data?

Data is a collection of raw facts and values that can be stored and processed. Examples:  Student name  Student ID  Course name

DATABASE MANAGEMENT SYSTEM LAB MANUAL 2 | P a g e  Marks  Phone number  Address For example: Muqadus 2026-CS- Database Systems These individual values are examples of data.

 WHAT IS A DATABASE?

A database is an organized collection of related data that can be stored, accessed, and managed efficiently. For example, a university may need to store information about:  Students  Teachers  Courses  Departments  Marks  Attendance Instead of keeping this information in separate unorganized files, it can be stored in a structured database. Example: A student database may contain: Student_ID Name Program Semester 101 Ali BSCS 5 102 Sara BSSE 6 103 Ahmed BECSE 4 Here, the information is organized in a structured form.

 WHAT IS A FILE SYSTEM?

A file system stores data in separate files and folders. For example, a university might store: Students.xlsx Teachers.xlsx Courses.xlsx Attendance.xlsx Marks.xlsx Each file may contain related information. A file system can be useful for simple data storage, but managing large amounts of related data can become

DATABASE MANAGEMENT SYSTEM LAB MANUAL 4 | P a g e SQL commands are generally written in the SQL Editor of MySQL Workbench.

PRACTICAL ACTIVITY 1 — OPEN MYSQL WORKBENCH

Objective To open MySQL Workbench and establish a connection with the MySQL Server. Steps

  1. Open MySQL Workbench from the Start Menu.
  2. Locate the available MySQL connection.
  3. Open the connection.
  4. Enter the MySQL password if requested.
  5. Wait for the SQL Editor to load.
  6. Observe the Workbench interface. Explore the following areas:  Navigator  Schemas  SQL Editor  Query execution button  Output area Task Take a screenshot showing:  MySQL Workbench

DATABASE MANAGEMENT SYSTEM LAB MANUAL 5 | P a g e  Active MySQL connection  SQL Editor  Paste the screenshot below:

DATABASE MANAGEMENT SYSTEM LAB MANUAL 7 | P a g e

Step 6 Locate:

UniversityDB in the Schemas panel.

Task

Take a screenshot showing the newly created database. Paste the screenshot below:

PRACTICAL ACTIVITY 3 — VIEW DATABASES

Objective To view the databases available on the MySQL server. Execute: SHOW DATABASES; Observe Look at the output generated by MySQL Workbench. Identify:  System/default databases  The database created by you Task Take a screenshot of the output. Paste the screenshot below:

DATABASE MANAGEMENT SYSTEM LAB MANUAL 8 | P a g e

PRACTICAL ACTIVITY 4 — SELECT THE DATABASE

Objective To select a database for further operations. Execute: USE UniversityDB; After executing the command, observe the message shown by MySQL Workbench. Verify the selected database Execute: SELECT DATABASE(); Observe the result. Task Take a screenshot showing the executed commands and their output. Paste the screenshot below:

DATABASE MANAGEMENT SYSTEM LAB MANUAL 10 | P a g e Take a screenshot showing:  UniversityDB  Tables  Students table Paste the screenshot below: PRACTICAL ACTIVITY 6 — VIEW TABLE STRUCTURE Objective To inspect the structure of the table created in the previous activity. Execute: DESCRIBE Students; or: DESC Students; Observe the output. Students should identify:  Column names  Data types  Null information  Key information  Default values

DATABASE MANAGEMENT SYSTEM LAB MANUAL 11 | P a g e Task Take a screenshot of the output. Paste the screenshot below: PRACTICAL ACTIVITY 7 — VIEW TABLES Execute: SHOW TABLES; Observe the result. Task: Take a screenshot of the output.

DATABASE MANAGEMENT SYSTEM LAB MANUAL 13 | P a g e Column Suggested Data Type Instructor VARCHAR(50)

DATABASE MANAGEMENT SYSTEM LAB MANUAL 14 | P a g e Column Suggested Data Type Task 4 — Verify the Database Display the available databases. Task 5 — Verify the Table Display the tables of the selected database.

DATABASE MANAGEMENT SYSTEM LAB MANUAL 16 | P a g e Task 7 — Workbench Verification Refresh the Schemas panel and verify that: CollegeDB ↓ Tables ↓ Courses is visible.

DATABASE MANAGEMENT SYSTEM LAB MANUAL 17 | P a g e Deliverables must submit screenshots of:

  1. MySQL Workbench connection
  2. Created CollegeDB
  3. Database list
  4. Selected database
  5. Courses table
  6. Table structure
  7. SHOW TABLES output

Questions:

 Which SQL command did you use to create UniversityDB?

Ans: I used CREATE DATABASE UNIVERSITYDB; to create database naming

UniversityDB.

 Which command did you use to display available databases?

Ans: I used SHOW DATABASES; command display available databses.

 Why did you use the USE command?

Ans: To access that database we created recently, and to add/edit info in it.

 Which command did you use to verify the currently selected database?