Lab 2
Lab 2
Instructor
Student Name
CMSID
Department
Section
Introduction to Database system and
Lesson Set Tools for Database system and their Installation
2
Purpose 1. To get basic awareness of Database system
2. To understand MySQL workbench and why we are using it
3. To become familiar with the tools used for database and their installation
4. To learn the basics of an editor and compiler and be able to compile and
run sample query
5. To create new database and table from scratch
Procedure 1. Students should read the Pre-lab Reading assignment before coming to lab.
2. Students should complete the Pre-lab Writing assignment before coming to
lab.
3. In the lab, students should complete Labs 2.1 through 2.4 in sequence.
Your instructor will give further instructions as to grading and completion of
the lab.
4. Students should complete the set of lab tasks before the next lab and get
them checked by their lab instructor.
Lab 2
2|Page
PRE-LAB READING ASSIGNMENT
Database Systems
MySQL is a fast, easy-to-use RDBMS being used for many small and big
businesses. MySQL is developed, marketed and supported by MySQL AB,
which is a Swedish company. MySQL is becoming so popular because of
many good reasons −
MySQL is released under an open-source license. So you
have nothing to pay to use it.
MySQL is a very powerful program in its own right. It handles
a large subset of the functionality of the most expensive and
powerful database packages.
MySQL uses a standard form of the well-known SQL data
language.
MySQL works on many operating systems and with many
languages including PHP, PERL, C, C++, JAVA, etc.
MySQL works very quickly and works well even with large
data sets.
MySQL is very friendly to PHP, the most appreciated
language for web development.
MySQL supports large databases, up to 50 million rows or
more in a table. The default file size limit for a table is 4GB,
but you can increase this (if your operating system can handle
it) to a theoretical limit of 8 million terabytes (TB).
MySQL is customizable. The open-source GPL license allows
programmers to modify the MySQL software to fit their own
specific environments.
Types of Database
Relational:
This database is based on the relational data model, which stores data in the
form of rows(tuple) and columns(attributes), and together forms a
table(relation). A relational database uses SQL for storing, manipulating, as
well as maintaining the data. E.F. Codd invented the database in 1970. Each
table in the database carries a key that makes the data unique from others.
NoSQL:
Non-SQL/Not Only SQL is a type of database that is used for storing a wide
range of data sets. It is not a relational database as it stores data not only in
tabular form but in several different ways. It came into existence when the
demand for building modern applications increased. Thus, NoSQL presented
a wide variety of database technologies in response to the demands.
3|Page
Advantage of MySQL Cross platform
Used with multiple languages (PHP, NodeJS, python, C#)
MySQL software is open source
MySQL is RDBMS
The MySQL database server is fast, reliable, scalable and easy to
use
MySQL sever works client/server or embedded system
Integrated
Environments
4|Page
Pre lab writing assignment
5|Page
Lab 2
Lab 2.1
Installing MySQL for
database
Drag the MySQL Server, workbench and shell by selecting through the
drop-down list and then just click the forward arrow icon to move for the
installation. Click next=>next=>next
Now it’s the time to download the selected options, just click the execute
button below to start downloading. This will take some time, Once all
6|Page
three products downloaded just click the next button to move to
the installation page.
After the downloading process you will be directed to the next page just
click the execute button to install all three products.
Once the above process done you just leave everything as default just click
next=>next=>next and so on.
Important: In the configuration page you need to setup password for the
root. By default, there is no password. You need to give password to your root.
The password should be 1234
7|Page
Lab 2.2 Lab Tasks
2. Write SQL statement to create table by name courses. It should have two fields, course_id
and course_name. The course_id should be primary key.
4. Write SQL statement to show all data where course_id is equal to the 3.
8|Page