1. q
Dr. Amany AbdElSamea Saeed
February 2024
PEARSON BTEC International Standards Verifier
ICT Program
Lec. 1 Introduction to DBMS
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 1
2. Course Content
والطاقة الصناعة تكنولوجيا كلية
Module 0: includes an introduction to relational database management systems
Module 1: introduces basic Structured Query Language (SQL)
Module 2: includes SQL data types, operations and expressions.
Module 3: introduces SQL – procedures, functions, triggers.
Module 4: includes SQL constraints.
Module 5: introduces Views & Indexes in Databases
Module 6: discusses SQL Joins
Module 7: discusses query plans and query optimization
Module 8: introduces SQL transactions
Module 9: discusses NoSQL tools.
2/22/2024 11:44 AM 2
3. Outline
والطاقة الصناعة تكنولوجيا كلية
• Types of Database
• Database keys
• Database management systems
• Structured query language
• Types of SQL statements
• MySQL installation
2/22/2024 11:44 AM 3
4. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 4
Database
• A database is a tool used to organize, store, retrieve, and communicate
groups of related information
• A database is an organized collection of related data
• Database Structure:
Table: It is the fundamental object of database structure. The basic
purpose of a table is to store data.
It consists of rows and columns.
Rows/Records:
Rows are the horizontal part of the table
Columns/Fields:
Columns are the vertical part of the table
5. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 5
Types of Database
Non-Relational
Relational
Ideal for quasi-structured and un-structured data
(Key-value pairs, Document-based, Graph database,
Wide-column stores)
Ideal for structured data (Table-based)
Structure
- Data consistency and integrity is not top priority
- Expecting high transaction load
-Don’t anticipate changes to the database
structure
- Working with complex queries and reports
Strength
Designed for scaling out horizontally by adding more
database nodes to handle the increased workload
Designed for scaling up vertically by upgrading the
custom-built hardware
Scalability
Schema free and change management is easy
Change management is difficult due to rigid
schema
Management
No Standard for querying data
Standard SQL is used to query data
Querying
Suitable for social media sites and big web
applications
Suitable for Financial Applications
i.e. Banking Transaction require ACID property
Applications
CouchDB and MongoDB
Cassandra and HBase and Redis
Oracle Database, Microsoft Sql Server, IBM DB2,
and PostgresSQL
Examples
6. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 6
Types of keys
A DBMS key is an attribute or a set of attributes which help you uniquely identify a
record or a row of data in a relation ( table).
• In other words, a candidate
key is super key without any
redundant attribute.
• Except for the primary key,
the remaining attributes are
considered a candidate key.
The candidate keys are as
strong as the primary key.
• The candidate key chosen to
uniquely identify each row of
data in a table.
• No two rows can have the
same primary key value,
primary key value cannot be
NULL and every row must have
a primary key
Primary Key
• The candidate keys that are
not selected as primary key
are known as alternate keys.
Alternate Key
Candidate Key
• A foreign key is an attribute or
a set of attributes in a relation
whose values match a primary
key in another relation.
• Foreign keys are the column of
the table used to point to the
primary key of another table.
Foreign Key
• Whenever a primary
key consists of more
than one attribute, it
known as a composite
key
Composite Key
7. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 7
Relationships
• A relationship is a logical connection between different tables.
• It is established by connecting one or more fields of two tables. The fields
used to connect two tables normally have same name, data type and size.
• Types of relationships are:
- One-to-One relationship
- One-to-Many relationship
- Many-to-Many relationship
8. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 8
Types of Relationships
One-to-One One-to-Many Many-to-Many
- For each record in the first table,
there is only one record in the second
table
- For each record in the second table,
there is only one record in the first
table.
- For each record in the first table,
there are one or more records in the
second table
- For each record in the second table,
there is only one record in the first
table.
- For each record in the first table,
there are one or more records in
the second table
- For each record in the second
table, there are one or more
records in the first table.
9. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 9
Database Management Systems
(DBMS)
• A special computer software program that helps users create and maintain a database
Makes it easy to manage large amounts of information
Handles Security
Backups
Importing/exporting data
Concurrency
Interacts with software applications
oProgramming Languages
• Four main operations of DBMS are create, read, update and delete
• RDBMS uses SQL queries to access the data in the database.
10. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 10
What is SQL?
• SQL is a standardized language used for interacting with RDMS
- You can use SQL to get the RDMS to do things for you
Create, retrieve, update & delete data
Create & manage databases
Design & create database tables
Perform administrative tasks (user management, security, backup,
etc.,)
• SQL is an ANSI (American National Standards Institute) standard
• SQL implementations vary between systems. SQL code used on one RDMS
is not always portable to another without modification
• SQL stands for Structured Query language, pronounced as “S-Q-L” or
sometimes as “See-Quel”
11. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 11
Types of SQL Statements
• Data Query Language (DQL)
oUsed to query the database for information
oGet information that is already stored there
• Data Definition Language (DDL)
oUsed for defining database schemas
• Data Control Language (DCL)
oUsed for controlling access to the data in the
database
oUser & permissions management
• Data Manipulation Language (DML)
oUsed for inserting, updating and deleting data
from the database
• Transaction Control Language
oManage the transactions in the database
13. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 13
What is MYSQL?
• MySQL is a relational database management system
• MySQL is open-source
• MySQL is free
• MySQL is ideal for both small and large applications
• MySQL is very fast, reliable, scalable, and easy to use
• MySQL is cross-platform
• MySQL is compliant with the ANSI SQL standard
• MySQL was first released in 1995
• MySQL is developed, distributed, and supported by Oracle Corporation
• MySQL is supported on a large number of platforms, including Linux, macOS,
Microsoft Windows, etc.,. It also has APIs for large number of languages,
including C, C++, Java, .NET, Perl, PHP, Python.
14. والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 14
Who use MYSQL?
• Huge websites like Facebook, Twitter, Booking.com, Uber, GitHub, YouTube,
etc.
• Content Management Systems like WordPress, Drupal, etc.
• A very large number of web developers around the world
To build a web site that shows data from a database, you will need:
An RDBMS database program (like MySQL)
A server-side scripting language, like PHP
To use SQL to get the data you want
To use HTML / CSS to style the page
15. Installing MySQL
• Step 1: go to https:/ / dev. mysql. com/ downloads/ windows/ installer/
• Step 2: After that, you will see two options to Download. If you have internet
connectivity then you can go forward and choose the mysql-installer-web-
community, else you can choose the other one.
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 15
16. Installing MySQL cont.,
• Step 3: Once, you click on Download, you will be redirected to the following page: If
you aren't interested in logging in or signing up, choose No thanks, just start my
download
• Step 4: Install the file you just downloaded by clicking on it from your browser
downloads or by double-clicking on the file in Windows Explorer.
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 16
17. Installing MySQL cont.,
• Step 5: In the next wizard, you have to choose the
setup type. Here, I will choose the option FULL and
click on Next.
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 17
• Step 6: The products will be downloaded
18. Installing MySQL cont.,
• Step 7: The products will be installed.
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 18
• Step 8: The products configuration
19. • Step 9: Type and networking. Click next
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 19
• Step 10:Now, you have to choose the authentication
method. Here, I will choose the first option and click
on Next.
Installing MySQL cont.,
20. • Step 11: Next, you have to mention the MySQL Root
Password and again click on Next.
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 20
• Step 12:: Finally, you have to choose whether you
want to start the server or not. Then click on Next.
Installing MySQL cont.,
21. • Step 13: Next, you have to choose the server file
permissions. Then click on Next
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 21
• Step 14: Finally, Apply Configuration Then click
on Execute then Finish
Installing MySQL cont.,
22. • Step 15: Next, you will configure MySQL Router.
Click on Next
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 22
Installing MySQL cont.,
• Step 16: Click on Finish
23. • Step 17: Next, you will configure Samples and
examples. Click on Next
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 23
Installing MySQL cont.,
• Step 18: you will see the following wizard, to Connect
to server. Here mention the root password, which you
had set in the previous steps
24. • Step 19: Once, you click on Next, choose the
configurations applied and click on Execute.
Then click on finish
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 24
Installing MySQL cont.,
• Step 20: Installation complete. Click finish
25. • Step 21: Start MySQL Shell and MySQL Workbench
والطاقة الصناعة تكنولوجيا كلية
2/22/2024 11:44 AM 25
Installing MySQL cont.,