SlideShare ist ein Scribd-Unternehmen logo
1 von 36
MySQL 5.6 Database System
Presented by : Ms. ARSHI
‱ A database management system (DBMS) defines,
creates, and maintains a database.
‱ RDBMS data is structured in database tables, fields and
records.
What is RDBMS?
Components of a Database System
‱ Commercial software
 Sybase Adaptive Server Enterprise
 IBM DB2
 Oracle
 Microsoft SQL Server
 Teradata
‱ Free/GPL/Opensource:
 MySQL
 PostgreSQL
Who are the main contenders?
Comparison of Relational
database management
systems
Vendor leaders
 For low-medium level servers, Oracle is the leader
in the market share, although growth is declining
 IBM DB2 has the highest market share for high-
end servers and mainframes, increasing growth in
midrange after acquisition of Informix
Operating System Support
Windows Mac OS X Linux BSD UNIX
Adaptive Server Enterprise Yes Yes Yes Yes Yes
DB2 Yes No Yes No Yes
Microsoft SQL Server Yes No No No No
MySQL Yes Yes Yes Yes Yes
Oracle Yes Yes Yes No Yes
PostgreSQL Yes Yes Yes Yes Yes
Teradata Yes No Yes No Yes
 Relational Databases
 Operational Databases
 Database Warehouses
 Distributed Databases
 End-User Databases
Different Types of Database
MySQL is the world's most popular open source database
software, with over 100 million copies of its software
downloaded or distributed throughout it's history.
MySQL is RDBMS which runs a server, providing multi-user
access to a number of databases.
With its superior speed, reliability, and ease of use, MySQL
has become the preferred choice for IT in all sectors or
domains.
Why MySQL?
Many web applications use MySQL as the database component
of a LAMP(Linux (operating system), Apache HTTP Server,
MySQL (database software), and PHP, Perl or Python) software
stack.
Its popularity for use with web applications is closely tied to the
popularity of PHP , which is often combined with MySQL.
Several high-traffic web sites includes: Flickr, Facebook,
Wikipedia, Google, Nokia and YouTube use MySQL for data
storage and logging of user data.
Uses
‱ MySQL is written in C and C++ and its SQL parser is
written in yacc(Yet Another Compiler Compiler).
‱ MySQL uses only just under 1 MB of RAM on your laptop
while Oracle 9i installation uses 128 MB
‱ MySQL is great for database enabled websites while
Oracle is made for enterprises.
‱ MySQL is portable.
‱ MySQL default port number is 3306.
Features of MySQL
∗ A storage engine is a software module that a
database management system uses to create, read,
update data from a database.
∗ MyISAM, InnoDB, Memory, Merge, Archive,
Federated, NDB, CSV, Blackhole, Example.
∗ By Default: InnoDB for versions after 5.5
∗ A transaction-safe (ACID compliant) storage engine for
MySQL that has commit, rollback, and crash-recovery
capabilities to protect user data.
Storage Engines
What is
storage
engine?
Default
storage
engine?
∗ 5 different tables present in MySQL are
Database Tables in MySQL
ISAM(Indexed Sequential Access Method)
What
are
Heap
Tables?
∗ MySQL can be installed on Linux using RPM packages.
∗ shell> rpm -qpl MySQL-server-VERSION.glibc23.i386.rpm
∗ This package will install mysql in /var/lib/mysql
∗ Package can be downloaded from:
http://dev.mysql.com/downloads/mysql/#downloads
Installation Summary
∗ Use a terminal that sets the path to
/var/lib/mysql/bin
∗ The following command connects to the server:
∗ mysql -u root -p
∗ you are prompted for the root password.
∗ you can now send commands and SQL statements to
the server
Connecting to the Server
Client-Server Interaction
MySQL
Server
Client
Program
Make a request
(SQL query)
Get results
Client program can be a MySQL command line client,
GUI client, or a program written in any language such
as C, Perl, PHP, Java that has an interface to the
MySQL server.
MySQL Connectors provide connectivity to the
MySQL server for client programs
MySQL Connectors & API
What are
mysql
connectors?
∗ Connector/J is a JDBC Type 4 Driver for connecting Java to
MySQL
∗ Installation is very simple:
∗ Download the “Production Release” ZIP file from
http://dev.mysql.com/downloads/connector/j/3.1.html
∗ Unzip it
∗ Put the JAR file where Java can find it
∗ Add the JAR file to your CLASSPATH, or
∗ In Eclipse: Project --> Properties --> Java Build Path -->
Libraries --> Add External Jars...
Connector/J
∗ First, make sure the MySQL server is running
∗ In your program,
∗ import java.sql.Connection; // not com.mysql.jdbc.Connection
import java.sql.DriverManager;
import java.sql.SQLException;
∗ Register the JDBC driver,
Class.forName("com.mysql.jdbc.Driver").newInstance();
∗ Invoke the getConnection() method,
Connection con =
DriverManager.getConnection("jdbc:mysql:///myDB",
myUserName,
myPassword);
∗ or getConnection("jdbc:mysql:///myDB?user=dave&password=xxx")
Connecting to the server
∗ As a language, the SQL standard has three major components:
∗ A Data Definition Language (DDL) for defining the database
structure and controlling access to the data.
∗ A Data Manipulation Language (DML) for retrieving and
updating data.
∗ A Data Control Language(DCL) concerns with rights, permissions
and other controls of the database system.
Types of SQL Language statements
∗ A relational database management system consists of
a number of databases.
∗ Each database consists of a number of tables.
∗ Example table
Database concepts
marks
table
rows
(records)
column
headings
studentID first_name last_name mark
∗ Each entry in a row has a type specified by the
column.
∗ Numeric data types
∗ TINYINT, SMALLINT, MEDIUMINT,
∗ INT, BIGINT
∗ FLOAT(display_length, decimals)
∗ DOUBLE(display_length, decimals)
∗ DECIMAL(display_length, decimals)
∗ NUMERIC is the same as DECIMAL
Some SQL data types (1)
What is
difference
between
float and
double?
∗ Date and time types
∗ DATE
∗ format is YYYY-MM-DD
∗ DATETIME
∗ format YYYY-MM-DD HH:MM:SS
∗ TIMESTAMP
∗ format YYYYMMDDHHMMSS
∗ TIME
∗ format HH:MM:SS
∗ YEAR
∗ default length is 4
Some SQL data types (2)
What is
difference
between Now()
and
Current_date()?
∗ String types
∗ CHAR
∗ fixed length string, e.g., CHAR(20)
∗ VARCHAR
∗ variable length string, e.g., VARCHAR(20)
∗ BLOB, TINYBLOB, MEDIUMBLOB, LONGBLOB
∗ same as TEXT, TINYTEXT ...
∗ ENUM
∗ list of items from which value is selected
SQL data types (3)
What is
difference
between
BLOB and
Text ?
∗ SHOW
∗ Display databases or tables in current database;
∗ show databases;
∗ show tables;
∗ USE
∗ Specify which database to use
∗ use bookstore;
SQL commands SHOW, USE
∗ CREATE creates a database table
The CREATE Command (1)
CREATE TABLE table_name
(
column_name1 column_type1,
column_name2 column_type2,
...
column_nameN column_typeN
);
CREATE TABLE table_name
(
column_name1 column_type1,
column_name2 column_type2,
...
column_nameN column_typeN,
PRIMARY KEY (column_name1)
);
How to
create
database?
∗ Specifying primary keys
∗ To delete databases and tables use the DROP
command
∗ Examples
 DROP DATABASE db_name;
 DROP TABLE table_name;
The DROP & INSERT Commands
∗ Inserting rows into a table using INSERT command
INSERT INTO table_name
( col_1, col_2, ..., col_N)
VALUES
( val_1, val_2, ..., val_N);
What is
difference
between
DROP and
DELETE
commands
?
∗ Selecting rows from a table
∗ Simplest form: select all columns
∗ Select specified columns
∗ Conditional selection of rows
The SELECT Command (1)
SELECT column_list FROM table_name;
SELECT * FROM table_name;
SELECT column_list FROM table_name
WHERE condition;
∗ Specifying ascending row ordering
∗ Specifying descending row ordering
10/11/16
The SELECT Command (2)
SELECT column_list FROM table_name
WHERE condition
ORDER by ASC;
SELECT column_list FROM table_name
WHERE condition
ORDER by DESC;
∗ Used to modify an existing record
∗ Conditional update version
10/11/16
The UPDATE Command
UPDATE table_name
SET col_1 = 'new_value1',
..., col_n = 'new_value2';
UPDATE table_name
SET col_1 = 'new_value1',
..., col_n = 'new_value2'
WHERE condition;
∗ Selecting the complete table
10/11/16
The Marks Table
SELECT * FROM marks;
+-----------+------------+-----------+------+
| studentID | first_name | last_name | mark |
+-----------+------------+-----------+------+
| 1 | Fred | Jones | 78 |
| 2 | Bill | James | 67 |
| 3 | Carol | Smith | 82 |
| 4 | Bob | Duncan | 60 |
| 5 | Joan | Davis | 86 |
+-----------+------------+-----------+------+
5 rows in set (0.00 sec)
∗ Select rows according to some criterion
10/11/16
The WHERE Clause (1)
SELECT * FROM marks WHERE studentID > 1
AND studentID < 5;
+-----------+------------+-----------+------+
| studentID | first_name | last_name | mark |
+-----------+------------+-----------+------+
| 2 | Bill | James | 67 |
| 3 | Carol | Smith | 82 |
| 4 | Bob | Duncan | 60 |
+-----------+------------+-----------+------+
3 rows in set (0.01 sec)
∗ Select rows according to some criterion
10/11/16
The ORDER BY Clause
SELECT * FROM marks ORDER BY mark DESC;
+-----------+------------+-----------+------+
| studentID | first_name | last_name | mark |
+-----------+------------+-----------+------+
| 5 | Joan | Davis | 86 |
| 3 | Carol | Smith | 82 |
| 1 | Fred | Jones | 78 |
| 2 | Bill | James | 67 |
| 4 | Bob | Duncan | 60 |
+-----------+------------+-----------+------+
5 rows in set (0.00 sec)
Aggregate Functions
 A fully managed relational mySQL databases on cloud hosted by
Google platform.
 Runs on Google infrastructure
 Google + MySQL
 Cloud SQL provides a database infrastructure for applications
running anywhere

Wordpress sites, e-commerce applications, CRM tools, or any
other application that is compatible with MySQL.
 It doesn't require any software installation.
ïŹ Security:
∗ Cloud SQL customer's data is encrypted i.e. Every Cloud SQL
instance includes a network firewall.
Cloud SQL
10/11/16

Weitere Àhnliche Inhalte

Was ist angesagt?

Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
Anurag
 

Was ist angesagt? (20)

SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
MySQL ppt
MySQL ppt MySQL ppt
MySQL ppt
 
MySQL JOINS
MySQL JOINSMySQL JOINS
MySQL JOINS
 
RDBMS
RDBMSRDBMS
RDBMS
 
String function in my sql
String function in my sqlString function in my sql
String function in my sql
 
Top 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaTop 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | Edureka
 
Sql commands
Sql commandsSql commands
Sql commands
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
PL/SQL TRIGGERS
PL/SQL TRIGGERSPL/SQL TRIGGERS
PL/SQL TRIGGERS
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sql subquery
Sql  subquerySql  subquery
Sql subquery
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
SQL
SQLSQL
SQL
 
RDBMS concepts
RDBMS conceptsRDBMS concepts
RDBMS concepts
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 

Andere mochten auch

Artificial Intelligence Presentation
Artificial Intelligence PresentationArtificial Intelligence Presentation
Artificial Intelligence Presentation
lpaviglianiti
 
best presentation Artitficial Intelligence
best presentation Artitficial Intelligencebest presentation Artitficial Intelligence
best presentation Artitficial Intelligence
jennifer joe
 
MySQL Database with phpMyAdmin
MySQL Database with  phpMyAdminMySQL Database with  phpMyAdmin
MySQL Database with phpMyAdmin
Karwan Mustafa Kareem
 
Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games. Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games.
Nitish Kavishetti
 

Andere mochten auch (20)

Artificial Intelligence Presentation
Artificial Intelligence PresentationArtificial Intelligence Presentation
Artificial Intelligence Presentation
 
working with database using mysql
working with database using mysql working with database using mysql
working with database using mysql
 
Philosophy and Atrificial Inteligence
Philosophy and Atrificial Inteligence Philosophy and Atrificial Inteligence
Philosophy and Atrificial Inteligence
 
MySQL Monitoring Shoot Out
MySQL Monitoring Shoot OutMySQL Monitoring Shoot Out
MySQL Monitoring Shoot Out
 
Php with MYSQL Database
Php with MYSQL DatabasePhp with MYSQL Database
Php with MYSQL Database
 
The care and feeding of a MySQL database
The care and feeding of a MySQL databaseThe care and feeding of a MySQL database
The care and feeding of a MySQL database
 
The ai app
The ai appThe ai app
The ai app
 
The ai app
The ai appThe ai app
The ai app
 
best presentation Artitficial Intelligence
best presentation Artitficial Intelligencebest presentation Artitficial Intelligence
best presentation Artitficial Intelligence
 
MySQL DBA
MySQL DBAMySQL DBA
MySQL DBA
 
MySQL Database with phpMyAdmin
MySQL Database with  phpMyAdminMySQL Database with  phpMyAdmin
MySQL Database with phpMyAdmin
 
Practical AI in Games
Practical AI in GamesPractical AI in Games
Practical AI in Games
 
Artificial intelligence and video games
Artificial intelligence and video gamesArtificial intelligence and video games
Artificial intelligence and video games
 
Artificial Intelligence Progress - Tom Dietterich
Artificial Intelligence Progress - Tom DietterichArtificial Intelligence Progress - Tom Dietterich
Artificial Intelligence Progress - Tom Dietterich
 
Artifical Intelligence in Customer Service
Artifical Intelligence in Customer ServiceArtifical Intelligence in Customer Service
Artifical Intelligence in Customer Service
 
Artificial Intelligence in games
Artificial Intelligence in gamesArtificial Intelligence in games
Artificial Intelligence in games
 
How Twitter Timeline works
How Twitter Timeline worksHow Twitter Timeline works
How Twitter Timeline works
 
What if Things Start to Think - Artificial Intelligence in IoT
What if Things Start to Think - Artificial Intelligence in IoTWhat if Things Start to Think - Artificial Intelligence in IoT
What if Things Start to Think - Artificial Intelligence in IoT
 
Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games. Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games.
 
eMarketer webinar: Mobile App Marketing—Acquiring and Retaining Quality Users...
eMarketer webinar: Mobile App Marketing—Acquiring and Retaining Quality Users...eMarketer webinar: Mobile App Marketing—Acquiring and Retaining Quality Users...
eMarketer webinar: Mobile App Marketing—Acquiring and Retaining Quality Users...
 

Ähnlich wie Mysql database

Fudcon talk.ppt
Fudcon talk.pptFudcon talk.ppt
Fudcon talk.ppt
webhostingguy
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
WrushabhShirsat3
 
Mysqlppt3510
Mysqlppt3510Mysqlppt3510
Mysqlppt3510
Anuja Lad
 
android sqlite
android sqliteandroid sqlite
android sqlite
Deepa Rani
 
NoSQL
NoSQLNoSQL
NoSQL
dbulic
 
iloug2015.Mysql.for.oracle.dba.V2
iloug2015.Mysql.for.oracle.dba.V2iloug2015.Mysql.for.oracle.dba.V2
iloug2015.Mysql.for.oracle.dba.V2
Baruch Osoveskiy
 
Mysql tutorial 5257
Mysql tutorial 5257Mysql tutorial 5257
Mysql tutorial 5257
Phuong Do Anh
 

Ähnlich wie Mysql database (20)

Fudcon talk.ppt
Fudcon talk.pptFudcon talk.ppt
Fudcon talk.ppt
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdl
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)
 
MySQL Baics - Texas Linxufest beginners tutorial May 31st, 2019
MySQL Baics - Texas Linxufest beginners tutorial May 31st, 2019MySQL Baics - Texas Linxufest beginners tutorial May 31st, 2019
MySQL Baics - Texas Linxufest beginners tutorial May 31st, 2019
 
unit-ii.pptx
unit-ii.pptxunit-ii.pptx
unit-ii.pptx
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
 
Mysqlppt3510
Mysqlppt3510Mysqlppt3510
Mysqlppt3510
 
Mysqlppt3510
Mysqlppt3510Mysqlppt3510
Mysqlppt3510
 
android sqlite
android sqliteandroid sqlite
android sqlite
 
Apache Cassandra introduction
Apache Cassandra introductionApache Cassandra introduction
Apache Cassandra introduction
 
Tech-Spark: SQL Server on Linux
Tech-Spark: SQL Server on LinuxTech-Spark: SQL Server on Linux
Tech-Spark: SQL Server on Linux
 
NoSQL
NoSQLNoSQL
NoSQL
 
SQL PPT.pptx
SQL PPT.pptxSQL PPT.pptx
SQL PPT.pptx
 
iloug2015.Mysql.for.oracle.dba.V2
iloug2015.Mysql.for.oracle.dba.V2iloug2015.Mysql.for.oracle.dba.V2
iloug2015.Mysql.for.oracle.dba.V2
 
My sql basic
My sql basicMy sql basic
My sql basic
 
Sql material
Sql materialSql material
Sql material
 
Mysql tutorial 5257
Mysql tutorial 5257Mysql tutorial 5257
Mysql tutorial 5257
 
Mysql
MysqlMysql
Mysql
 
My sql
My sqlMy sql
My sql
 

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

KĂŒrzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Mysql database

  • 1. MySQL 5.6 Database System Presented by : Ms. ARSHI
  • 2. ‱ A database management system (DBMS) defines, creates, and maintains a database. ‱ RDBMS data is structured in database tables, fields and records. What is RDBMS? Components of a Database System
  • 3. ‱ Commercial software  Sybase Adaptive Server Enterprise  IBM DB2  Oracle  Microsoft SQL Server  Teradata ‱ Free/GPL/Opensource:  MySQL  PostgreSQL Who are the main contenders? Comparison of Relational database management systems
  • 4. Vendor leaders  For low-medium level servers, Oracle is the leader in the market share, although growth is declining  IBM DB2 has the highest market share for high- end servers and mainframes, increasing growth in midrange after acquisition of Informix
  • 5. Operating System Support Windows Mac OS X Linux BSD UNIX Adaptive Server Enterprise Yes Yes Yes Yes Yes DB2 Yes No Yes No Yes Microsoft SQL Server Yes No No No No MySQL Yes Yes Yes Yes Yes Oracle Yes Yes Yes No Yes PostgreSQL Yes Yes Yes Yes Yes Teradata Yes No Yes No Yes
  • 6.  Relational Databases  Operational Databases  Database Warehouses  Distributed Databases  End-User Databases Different Types of Database
  • 7. MySQL is the world's most popular open source database software, with over 100 million copies of its software downloaded or distributed throughout it's history. MySQL is RDBMS which runs a server, providing multi-user access to a number of databases. With its superior speed, reliability, and ease of use, MySQL has become the preferred choice for IT in all sectors or domains. Why MySQL?
  • 8. Many web applications use MySQL as the database component of a LAMP(Linux (operating system), Apache HTTP Server, MySQL (database software), and PHP, Perl or Python) software stack. Its popularity for use with web applications is closely tied to the popularity of PHP , which is often combined with MySQL. Several high-traffic web sites includes: Flickr, Facebook, Wikipedia, Google, Nokia and YouTube use MySQL for data storage and logging of user data. Uses
  • 9. ‱ MySQL is written in C and C++ and its SQL parser is written in yacc(Yet Another Compiler Compiler). ‱ MySQL uses only just under 1 MB of RAM on your laptop while Oracle 9i installation uses 128 MB ‱ MySQL is great for database enabled websites while Oracle is made for enterprises. ‱ MySQL is portable. ‱ MySQL default port number is 3306. Features of MySQL
  • 10. ∗ A storage engine is a software module that a database management system uses to create, read, update data from a database. ∗ MyISAM, InnoDB, Memory, Merge, Archive, Federated, NDB, CSV, Blackhole, Example. ∗ By Default: InnoDB for versions after 5.5 ∗ A transaction-safe (ACID compliant) storage engine for MySQL that has commit, rollback, and crash-recovery capabilities to protect user data. Storage Engines What is storage engine? Default storage engine?
  • 11. ∗ 5 different tables present in MySQL are Database Tables in MySQL ISAM(Indexed Sequential Access Method) What are Heap Tables?
  • 12. ∗ MySQL can be installed on Linux using RPM packages. ∗ shell> rpm -qpl MySQL-server-VERSION.glibc23.i386.rpm ∗ This package will install mysql in /var/lib/mysql ∗ Package can be downloaded from: http://dev.mysql.com/downloads/mysql/#downloads Installation Summary
  • 13. ∗ Use a terminal that sets the path to /var/lib/mysql/bin ∗ The following command connects to the server: ∗ mysql -u root -p ∗ you are prompted for the root password. ∗ you can now send commands and SQL statements to the server Connecting to the Server
  • 14. Client-Server Interaction MySQL Server Client Program Make a request (SQL query) Get results Client program can be a MySQL command line client, GUI client, or a program written in any language such as C, Perl, PHP, Java that has an interface to the MySQL server.
  • 15. MySQL Connectors provide connectivity to the MySQL server for client programs MySQL Connectors & API What are mysql connectors?
  • 16. ∗ Connector/J is a JDBC Type 4 Driver for connecting Java to MySQL ∗ Installation is very simple: ∗ Download the “Production Release” ZIP file from http://dev.mysql.com/downloads/connector/j/3.1.html ∗ Unzip it ∗ Put the JAR file where Java can find it ∗ Add the JAR file to your CLASSPATH, or ∗ In Eclipse: Project --> Properties --> Java Build Path --> Libraries --> Add External Jars... Connector/J
  • 17. ∗ First, make sure the MySQL server is running ∗ In your program, ∗ import java.sql.Connection; // not com.mysql.jdbc.Connection import java.sql.DriverManager; import java.sql.SQLException; ∗ Register the JDBC driver, Class.forName("com.mysql.jdbc.Driver").newInstance(); ∗ Invoke the getConnection() method, Connection con = DriverManager.getConnection("jdbc:mysql:///myDB", myUserName, myPassword); ∗ or getConnection("jdbc:mysql:///myDB?user=dave&password=xxx") Connecting to the server
  • 18. ∗ As a language, the SQL standard has three major components: ∗ A Data Definition Language (DDL) for defining the database structure and controlling access to the data. ∗ A Data Manipulation Language (DML) for retrieving and updating data. ∗ A Data Control Language(DCL) concerns with rights, permissions and other controls of the database system. Types of SQL Language statements
  • 19.
  • 20. ∗ A relational database management system consists of a number of databases. ∗ Each database consists of a number of tables. ∗ Example table Database concepts marks table rows (records) column headings studentID first_name last_name mark
  • 21. ∗ Each entry in a row has a type specified by the column. ∗ Numeric data types ∗ TINYINT, SMALLINT, MEDIUMINT, ∗ INT, BIGINT ∗ FLOAT(display_length, decimals) ∗ DOUBLE(display_length, decimals) ∗ DECIMAL(display_length, decimals) ∗ NUMERIC is the same as DECIMAL Some SQL data types (1) What is difference between float and double?
  • 22. ∗ Date and time types ∗ DATE ∗ format is YYYY-MM-DD ∗ DATETIME ∗ format YYYY-MM-DD HH:MM:SS ∗ TIMESTAMP ∗ format YYYYMMDDHHMMSS ∗ TIME ∗ format HH:MM:SS ∗ YEAR ∗ default length is 4 Some SQL data types (2) What is difference between Now() and Current_date()?
  • 23. ∗ String types ∗ CHAR ∗ fixed length string, e.g., CHAR(20) ∗ VARCHAR ∗ variable length string, e.g., VARCHAR(20) ∗ BLOB, TINYBLOB, MEDIUMBLOB, LONGBLOB ∗ same as TEXT, TINYTEXT ... ∗ ENUM ∗ list of items from which value is selected SQL data types (3) What is difference between BLOB and Text ?
  • 24. ∗ SHOW ∗ Display databases or tables in current database; ∗ show databases; ∗ show tables; ∗ USE ∗ Specify which database to use ∗ use bookstore; SQL commands SHOW, USE
  • 25. ∗ CREATE creates a database table The CREATE Command (1) CREATE TABLE table_name ( column_name1 column_type1, column_name2 column_type2, ... column_nameN column_typeN ); CREATE TABLE table_name ( column_name1 column_type1, column_name2 column_type2, ... column_nameN column_typeN, PRIMARY KEY (column_name1) ); How to create database? ∗ Specifying primary keys
  • 26. ∗ To delete databases and tables use the DROP command ∗ Examples  DROP DATABASE db_name;  DROP TABLE table_name; The DROP & INSERT Commands ∗ Inserting rows into a table using INSERT command INSERT INTO table_name ( col_1, col_2, ..., col_N) VALUES ( val_1, val_2, ..., val_N); What is difference between DROP and DELETE commands ?
  • 27. ∗ Selecting rows from a table ∗ Simplest form: select all columns ∗ Select specified columns ∗ Conditional selection of rows The SELECT Command (1) SELECT column_list FROM table_name; SELECT * FROM table_name; SELECT column_list FROM table_name WHERE condition;
  • 28. ∗ Specifying ascending row ordering ∗ Specifying descending row ordering 10/11/16 The SELECT Command (2) SELECT column_list FROM table_name WHERE condition ORDER by ASC; SELECT column_list FROM table_name WHERE condition ORDER by DESC;
  • 29. ∗ Used to modify an existing record ∗ Conditional update version 10/11/16 The UPDATE Command UPDATE table_name SET col_1 = 'new_value1', ..., col_n = 'new_value2'; UPDATE table_name SET col_1 = 'new_value1', ..., col_n = 'new_value2' WHERE condition;
  • 30. ∗ Selecting the complete table 10/11/16 The Marks Table SELECT * FROM marks; +-----------+------------+-----------+------+ | studentID | first_name | last_name | mark | +-----------+------------+-----------+------+ | 1 | Fred | Jones | 78 | | 2 | Bill | James | 67 | | 3 | Carol | Smith | 82 | | 4 | Bob | Duncan | 60 | | 5 | Joan | Davis | 86 | +-----------+------------+-----------+------+ 5 rows in set (0.00 sec)
  • 31. ∗ Select rows according to some criterion 10/11/16 The WHERE Clause (1) SELECT * FROM marks WHERE studentID > 1 AND studentID < 5; +-----------+------------+-----------+------+ | studentID | first_name | last_name | mark | +-----------+------------+-----------+------+ | 2 | Bill | James | 67 | | 3 | Carol | Smith | 82 | | 4 | Bob | Duncan | 60 | +-----------+------------+-----------+------+ 3 rows in set (0.01 sec)
  • 32. ∗ Select rows according to some criterion 10/11/16 The ORDER BY Clause SELECT * FROM marks ORDER BY mark DESC; +-----------+------------+-----------+------+ | studentID | first_name | last_name | mark | +-----------+------------+-----------+------+ | 5 | Joan | Davis | 86 | | 3 | Carol | Smith | 82 | | 1 | Fred | Jones | 78 | | 2 | Bill | James | 67 | | 4 | Bob | Duncan | 60 | +-----------+------------+-----------+------+ 5 rows in set (0.00 sec)
  • 34.  A fully managed relational mySQL databases on cloud hosted by Google platform.  Runs on Google infrastructure  Google + MySQL  Cloud SQL provides a database infrastructure for applications running anywhere  Wordpress sites, e-commerce applications, CRM tools, or any other application that is compatible with MySQL.  It doesn't require any software installation. ïŹ Security: ∗ Cloud SQL customer's data is encrypted i.e. Every Cloud SQL instance includes a network firewall. Cloud SQL
  • 35.

Hinweis der Redaktion

  1. Supports upto 50 million rows or more in a table.
  2. . Both Connectors and the APIs enable you to connect and execute MySQL statements from another language or environment, including ODBC, Java (JDBC), Perl, Python, PHP, Ruby, and native C and embedded MySQL instances.
  3. : Don&amp;apos;t confuse DROP with DELETE which deletes rowsof a table.