z
Introduction to Database Management System (DBMS)
Database Management System (DBMS) - A database management
system is a software package with computer programs that controls the
creation, maintenance and use of a database. A DBMS allows different user
application programs to concurrently access the same database. Some of
the DBMSs are Oracle,Microsoft Access, PostgreSQL, MySQL, FoxPro
[Link] database programs are used to organize the data as per our
needs in the computer system.
What is a Database? – A database is an organized collection of data. For
example: In a stationary shop, detailed records of the materials/items (such
as pencils,erasers, notebooks, etc.) that are available in the shop are called
a [Link] keep track of these items on a computer, we must first install
a database program.
Database Concepts:- A database is made up of objects that are
used to store and manage information.
Advantages of a Database System
Reduces Data Redundancy : Removes the duplicacy of the data
Sharing of Data : Sharing of the data can be done easily Data Integrity :
Data integrity means that the data in the database is correct and
consistent.
Data Security : Only authorised users with a user id and password are
permitted to access the database.
Privacy : Users can work on a database based on the permissions
granted by the administrator.
Backup and Recovery : It automatically takes care of
backup and recovery.
Data Consistency : Data consistency means that there should be
no mismatching of the same data.
Database Servers – Database servers are dedicated computers that hold
the actual databases and run only the DBMS and related software.
RDBMS:- A relational database management system (RDBMS) is a
database management system where the data is organized into tables (i.e.
rows and columns). These tables are called relations.
The above example is showing a relationship between the data tables
RELATIONAL MODEL TERMINOLOGY - A few terms used in
RDBMS are listed below.
1. Relation : A table storing logically related data is called a
Relation.
2. Tuple : A tuple is a row of a relation.
3. Attribute : An attribute is a column of a relation.
[Link] Key : This is a set of one or more attributes that can
uniquely identify tuples within the relation.
INTRODUCTION TO MySQL
It is a freely available open source Relational Database
Management System (RDBMS) that uses Structured Query
Language(SQL). In the MySQL database , information is stored in
Tables. A single MySQL database can contain many tables at once
and store thousands of individual records.
SQL (Structured Query Language)
SQL is a language that enables you to create and operate on
relational databases, which are sets of related information stored in
tables.
Who uses MySQL?
● Some of the most famous websites like Facebook, Wikipedia, Google
(not for search), YouTube, Flickr.
●A large number of web developers worldwide are using MySQL to
develop web applications.
Installing MySQL
● Installing MySQL on one window is relatively simple. You only need to
download the MySQL installation package for the window version and
install the installation package.
● Under Windows, you can download the community edition from
[Link] (Select the version of MySQL
Community Server for the respective platform that you need.)
● [Link] use the given link to work on MySQL
online.
SQL Commands are divided into five broad categories –
1. DDL- Data Definition Language
2. DQL- Data Query Language
3. DML- Data Manipulation Language
4. DCL- Data Control Language
5. TCL- Transaction Control Language
Each category is further explained below:
Data Types in MySQL
Data types are a way of identifying the type of data and the operations that
go with it.
Numeric
1. int – used for numbers without [Link] 1,56,-4 etc
2. Decimal(m,d) – used for floating/real numbers. m denotes the total length
of a number and d is the number of decimal digits. Eg. 12.4,16.9 etc
Date and time
1. date – used to store date in YYYY-MM-DD format. (Year,Month,Date) 2.
time – used to store time in HH:MM:SS format.(Hours,Minutes,Seconds)
String
CHAR
(size)
VARCHAR (size)
A FIXED length string (can contain
letters, numbers, and special
characters). The size parameter
specifies the column length in
characters - can be from 0 to 255.
Default is 1
A VARIABLE length string (can
contain letters, numbers, and special
characters). The size parameter
specifies the maximum column
length in characters - can be from 0
to 65535