SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Training on Koha ILS organized by BALID Institute of
Information Management
3-7 September
Basic of MySQL
Prepared by
Nur Ahammad
Junior Assistant Librarian
Independent University, Bangladesh
MySQL
The world's most widely used open
source database application. MySQL is a
relational database management system.
World Class SQL Server.
MySQL was originally founded and
developed in Sweden by two Swedes and
a Finn: David Axmark, Allan Larsson
and Michael "Monty" Widenius, who
had worked together since the 1980's.
There are four type of
commands in MySQL:
1. Data Definition
Language
2. Data Manipulation
Language
3. Transactional Control
Language
4. Data Control Language
FACTS Of MySQL
• MySQL is the largest growing
relational database out on the market.
• MySQL acts as a DBMS
• MySQL is one of the most used open
source databases in the world.
• Capacity to handle 50,000,000+
records.
• Very fast command execution, perhaps
the fastest to be found on the market.
• Easy and efficient user privilege
system.
SQL Tools in MySQL
• DBTools Manager
• DBUI
• exportSQL
• ForwardSQL
• Intelligent Converters Software
• KMySQLAdmin
• Mac SQL
• MyAccess
• MySQL Data Manager
• MySQL WebClient
• MySQL Admin
• Phpmyadmin
1. Data Definition Language is used to create and
modify the structure of database objects in
database.
Examples:
CREATE, ALTER, DROP statements
CREATE
Creates objects in the database the
queery used to create the object is
create database [databasename];
Example :
create database koha;
ALTER
Alters objects of the database
ALTER TABLE <table_name>
ADD <column_name1> <datatype1> <constraint1>
ALTER TABLE <table_name>
ALTER COLUMN <column_name1> <datatype1>
<constraint1>
ALTER TABLE <table_name>
DROP COLUMN <column_name1> <datatype1>
Add a new column to Table.
mysql> alter table borrowers add column
cardnumber varchar (20);
Change column name.
mysql> alter table [table name] change [old
column name] [new column name] varchar
(50);
DROP
Deletes objects of the database the syntax for
dorp
DROP TABLE [ IF EXISTS ] table_name1, table_name2, ....
drop database koha;
Removes the table(s) from the database.
The IF EXISTS clause will drop the table only
if it exists. If this clause is not present an
error is generated if the table does not exist.
Any data that was in a dropped table is lost
so use with care.
Data Manipulation Language is used
to retrieve, store, modify, delete,
insert and update data in database.
Examples:
SELECT, UPDATE, INSERT statements
SELECT
SELECT * FROM table_name WHERE column_name='some
value';
SELECT borrowers.cardnumber, borrowers.surname,
borrowers.firstname, borrowers.dateenrolled FROM
borrowers;
The SELECT statement is used to form queries
for extracting information out of the database.
The above example query will return the card
number, name and enrolment date of all
borrowers.
UPDATE
There may be a requirement where
existing data in a MySQL table needs
to be modified. You can do so by using
SQL UPDATE command. This will
modify any field value of any MySQL
table.
UPDATE table_name
SET col_name1 = expression1, col_name2 =
expres sion2, ....
[ WHERE expression ]
[ LIMIT limit_amount ]
UPDATE table_name SET
([column_name],[...column_name],...)
VALUES ( [column_va
lue],[..column_value]);
UPDATE borrowers SET sur_name=‘Sumona'
WHERE id=‘102981'";
INSERT
To insert data into MySQL table,
you would need to use SQL INSERT
INTO command.
INSERT INTO table_name ( field1, field2,
...fieldN ) VALUES ( value1, value2,...valueN );
INSERT INTO borrowers (borrowers_title,
sur_name, first_name) VALUES (“Ms", “Islam",
‘Sumona');
Transactional Control Language is used to
manage different transactions
occurring within a database.
Examples: COMMIT, ROLLBACK
statements
These two keywords Commit and Rollback are mainly
used for MySQL Transactions.
• When a successful transaction is completed, the
COMMIT command should be issued so that the changes
to all involved tables will take effect.
• If a failure occurs, a ROLLBACK command should be
issued to return every table referenced in the
transaction to its previous state.
START TRANSACTION; SELECT @A:=SUM(salary)
FROM table1 WHERE type=1; UPDATE table2 SET
summary=@A WHERE type=1; COMMIT;
START TRANSACTION [WITH CONSISTENT
SNAPSHOT] | BEGIN [WORK] COMMIT
ROLLBACK SET autocommit = {0 | 1}
Data Control Language is used to create
roles, permissions, and referential
integrity as well it is used to control
access to database by securing it.
Examples:
GRANT, REVOKE statements
grant all privileges on koha.* to ‘kohaadmin'@'localhost'
identified by 'your_kohaadmin_password';
revoke all privileges on koha.* to ‘kohaadmin'@'localhost'
identified by 'your_kohaadmin_password';
More commands
Describe
Show
Set
mysqldump
Database Backup & restore
The following use to take backup MySQL database:
mysqldump –u root –p koha>/home/koha/Desktop/koha.sql
To restore the database use the following command:
mysql –u root –p koha</home/koha/Desktop/koha.sql
Useful sites
• http://www.mysql.org/
• http://www.mysql.org/documentation
• http://www.devshed.com/Server_Side/MySQL
My s qlbalidfnl
My s qlbalidfnl

Contenu connexe

Tendances

Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL ISankhya_Analytics
 
SQL Tutorial - How To Create, Drop, and Truncate Table
SQL Tutorial - How To Create, Drop, and Truncate TableSQL Tutorial - How To Create, Drop, and Truncate Table
SQL Tutorial - How To Create, Drop, and Truncate Table1keydata
 
SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4jeetendra mandal
 
SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2jeetendra mandal
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?CPD INDIA
 
Difference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleDifference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleSteve Johnson
 
SQL interview questions jeetendra mandal - part 5
SQL interview questions jeetendra mandal - part 5SQL interview questions jeetendra mandal - part 5
SQL interview questions jeetendra mandal - part 5jeetendra mandal
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHPTaha Malampatti
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL CommandsShrija Madhu
 

Tendances (20)

Mysql Ppt
Mysql PptMysql Ppt
Mysql Ppt
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
SQL Differences SQL Interview Questions
SQL Differences  SQL Interview QuestionsSQL Differences  SQL Interview Questions
SQL Differences SQL Interview Questions
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL I
 
Sql – pocket guide
Sql – pocket guideSql – pocket guide
Sql – pocket guide
 
SQL Tutorial - How To Create, Drop, and Truncate Table
SQL Tutorial - How To Create, Drop, and Truncate TableSQL Tutorial - How To Create, Drop, and Truncate Table
SQL Tutorial - How To Create, Drop, and Truncate Table
 
SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
MySQL lecture
MySQL lectureMySQL lecture
MySQL lecture
 
SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2
 
Group Members
Group MembersGroup Members
Group Members
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
 
Difference Between Sql - MySql and Oracle
Difference Between Sql - MySql and OracleDifference Between Sql - MySql and Oracle
Difference Between Sql - MySql and Oracle
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
SQL interview questions jeetendra mandal - part 5
SQL interview questions jeetendra mandal - part 5SQL interview questions jeetendra mandal - part 5
SQL interview questions jeetendra mandal - part 5
 
Introduction to my_sql
Introduction to my_sqlIntroduction to my_sql
Introduction to my_sql
 
MySQL for beginners
MySQL for beginnersMySQL for beginners
MySQL for beginners
 
Sql - Structured Query Language
Sql - Structured Query LanguageSql - Structured Query Language
Sql - Structured Query Language
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 

En vedette

Under the Hood with MySQL
Under the Hood with MySQLUnder the Hood with MySQL
Under the Hood with MySQLohiocore
 
Koha Presentation
Koha PresentationKoha Presentation
Koha PresentationKen Ouma
 
Why do you consider to adopt Koha Open Source Integrated Library System for y...
Why do you consider to adopt Koha Open Source Integrated Library System for y...Why do you consider to adopt Koha Open Source Integrated Library System for y...
Why do you consider to adopt Koha Open Source Integrated Library System for y...Md. Zahid Hossain Shoeb
 
SLANZA Presentation: Koha the open source library management system
SLANZA Presentation: Koha the open source library management systemSLANZA Presentation: Koha the open source library management system
SLANZA Presentation: Koha the open source library management systemMark Osborne
 
CHMK Library
CHMK LibraryCHMK Library
CHMK LibraryMadhu Vt
 
MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)Karthik .P.R
 

En vedette (8)

Under the Hood with MySQL
Under the Hood with MySQLUnder the Hood with MySQL
Under the Hood with MySQL
 
Koha Presentation
Koha PresentationKoha Presentation
Koha Presentation
 
Why do you consider to adopt Koha Open Source Integrated Library System for y...
Why do you consider to adopt Koha Open Source Integrated Library System for y...Why do you consider to adopt Koha Open Source Integrated Library System for y...
Why do you consider to adopt Koha Open Source Integrated Library System for y...
 
SLANZA Presentation: Koha the open source library management system
SLANZA Presentation: Koha the open source library management systemSLANZA Presentation: Koha the open source library management system
SLANZA Presentation: Koha the open source library management system
 
CHMK Library
CHMK LibraryCHMK Library
CHMK Library
 
Koha: ILS
Koha: ILSKoha: ILS
Koha: ILS
 
SQL Reports in Koha
SQL Reports in KohaSQL Reports in Koha
SQL Reports in Koha
 
MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)MySQL Query Optimization (Basics)
MySQL Query Optimization (Basics)
 

Similaire à My s qlbalidfnl

Mysql-overview.pptx
Mysql-overview.pptxMysql-overview.pptx
Mysql-overview.pptxTamilHunt
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxEliasPetros
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxEliasPetros
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytWrushabhShirsat3
 
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfmysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfpradnyamulay
 
MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.sudhasuryasnata06
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowPavithSingh
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETEAbrar ali
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL Rc Os
 

Similaire à My s qlbalidfnl (20)

Mysql-overview.pptx
Mysql-overview.pptxMysql-overview.pptx
Mysql-overview.pptx
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
 
MySQL ppt
MySQL ppt MySQL ppt
MySQL ppt
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
 
sql.pptx
sql.pptxsql.pptx
sql.pptx
 
unit-ii.pptx
unit-ii.pptxunit-ii.pptx
unit-ii.pptx
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
 
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfmysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
 
MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.
 
SQL | DML
SQL | DMLSQL | DML
SQL | DML
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
 
SQL basics.pptx
SQL basics.pptxSQL basics.pptx
SQL basics.pptx
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
 
SQL_NOTES.pdf
SQL_NOTES.pdfSQL_NOTES.pdf
SQL_NOTES.pdf
 
Mysql
MysqlMysql
Mysql
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL
 
Sql lite android
Sql lite androidSql lite android
Sql lite android
 
Unit - II.pptx
Unit - II.pptxUnit - II.pptx
Unit - II.pptx
 
MySQL Record Operations
MySQL Record OperationsMySQL Record Operations
MySQL Record Operations
 

Plus de Nur Ahammad

Creating Research profile
Creating Research profileCreating Research profile
Creating Research profileNur Ahammad
 
Library orientation: Resources and Finding overview
Library orientation: Resources  and  Finding overviewLibrary orientation: Resources  and  Finding overview
Library orientation: Resources and Finding overviewNur Ahammad
 
MARC 21 Training at Daffodil International University
MARC 21 Training at Daffodil International UniversityMARC 21 Training at Daffodil International University
MARC 21 Training at Daffodil International UniversityNur Ahammad
 
Plagiarism: Detect and Prevent
Plagiarism: Detect and PreventPlagiarism: Detect and Prevent
Plagiarism: Detect and PreventNur Ahammad
 
Koha Presentation at Uttara University
Koha Presentation at Uttara UniversityKoha Presentation at Uttara University
Koha Presentation at Uttara UniversityNur Ahammad
 
Daffodil International University Permanent Campus Library Orientation
Daffodil International University Permanent Campus Library OrientationDaffodil International University Permanent Campus Library Orientation
Daffodil International University Permanent Campus Library OrientationNur Ahammad
 
Dspace-1.8.2 Installation on Centos-6.3
Dspace-1.8.2 Installation on Centos-6.3Dspace-1.8.2 Installation on Centos-6.3
Dspace-1.8.2 Installation on Centos-6.3Nur Ahammad
 
DSpace Manual for BALID Trainee
DSpace Manual for BALID Trainee DSpace Manual for BALID Trainee
DSpace Manual for BALID Trainee Nur Ahammad
 
Two day-long training on "DSpace" Institutional Repository
Two day-long training on "DSpace" Institutional RepositoryTwo day-long training on "DSpace" Institutional Repository
Two day-long training on "DSpace" Institutional RepositoryNur Ahammad
 
DSpace Self archiving
DSpace Self archivingDSpace Self archiving
DSpace Self archivingNur Ahammad
 
Workshop on Discovery of Library Resources
Workshop on Discovery of Library ResourcesWorkshop on Discovery of Library Resources
Workshop on Discovery of Library ResourcesNur Ahammad
 
Presentation on Koha
Presentation on KohaPresentation on Koha
Presentation on KohaNur Ahammad
 
Koha installation BALID
Koha installation BALIDKoha installation BALID
Koha installation BALIDNur Ahammad
 
Providing First World Library services By using Koha, DSpace, vufind and Drupal
Providing First World Library services By using  Koha, DSpace, vufind and DrupalProviding First World Library services By using  Koha, DSpace, vufind and Drupal
Providing First World Library services By using Koha, DSpace, vufind and DrupalNur Ahammad
 
DSpace Installation
DSpace InstallationDSpace Installation
DSpace InstallationNur Ahammad
 

Plus de Nur Ahammad (15)

Creating Research profile
Creating Research profileCreating Research profile
Creating Research profile
 
Library orientation: Resources and Finding overview
Library orientation: Resources  and  Finding overviewLibrary orientation: Resources  and  Finding overview
Library orientation: Resources and Finding overview
 
MARC 21 Training at Daffodil International University
MARC 21 Training at Daffodil International UniversityMARC 21 Training at Daffodil International University
MARC 21 Training at Daffodil International University
 
Plagiarism: Detect and Prevent
Plagiarism: Detect and PreventPlagiarism: Detect and Prevent
Plagiarism: Detect and Prevent
 
Koha Presentation at Uttara University
Koha Presentation at Uttara UniversityKoha Presentation at Uttara University
Koha Presentation at Uttara University
 
Daffodil International University Permanent Campus Library Orientation
Daffodil International University Permanent Campus Library OrientationDaffodil International University Permanent Campus Library Orientation
Daffodil International University Permanent Campus Library Orientation
 
Dspace-1.8.2 Installation on Centos-6.3
Dspace-1.8.2 Installation on Centos-6.3Dspace-1.8.2 Installation on Centos-6.3
Dspace-1.8.2 Installation on Centos-6.3
 
DSpace Manual for BALID Trainee
DSpace Manual for BALID Trainee DSpace Manual for BALID Trainee
DSpace Manual for BALID Trainee
 
Two day-long training on "DSpace" Institutional Repository
Two day-long training on "DSpace" Institutional RepositoryTwo day-long training on "DSpace" Institutional Repository
Two day-long training on "DSpace" Institutional Repository
 
DSpace Self archiving
DSpace Self archivingDSpace Self archiving
DSpace Self archiving
 
Workshop on Discovery of Library Resources
Workshop on Discovery of Library ResourcesWorkshop on Discovery of Library Resources
Workshop on Discovery of Library Resources
 
Presentation on Koha
Presentation on KohaPresentation on Koha
Presentation on Koha
 
Koha installation BALID
Koha installation BALIDKoha installation BALID
Koha installation BALID
 
Providing First World Library services By using Koha, DSpace, vufind and Drupal
Providing First World Library services By using  Koha, DSpace, vufind and DrupalProviding First World Library services By using  Koha, DSpace, vufind and Drupal
Providing First World Library services By using Koha, DSpace, vufind and Drupal
 
DSpace Installation
DSpace InstallationDSpace Installation
DSpace Installation
 

Dernier

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Dernier (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

My s qlbalidfnl

  • 1. Training on Koha ILS organized by BALID Institute of Information Management 3-7 September Basic of MySQL Prepared by Nur Ahammad Junior Assistant Librarian Independent University, Bangladesh
  • 2. MySQL The world's most widely used open source database application. MySQL is a relational database management system. World Class SQL Server. MySQL was originally founded and developed in Sweden by two Swedes and a Finn: David Axmark, Allan Larsson and Michael "Monty" Widenius, who had worked together since the 1980's.
  • 3. There are four type of commands in MySQL: 1. Data Definition Language 2. Data Manipulation Language 3. Transactional Control Language 4. Data Control Language
  • 4. FACTS Of MySQL • MySQL is the largest growing relational database out on the market. • MySQL acts as a DBMS • MySQL is one of the most used open source databases in the world. • Capacity to handle 50,000,000+ records. • Very fast command execution, perhaps the fastest to be found on the market. • Easy and efficient user privilege system.
  • 5. SQL Tools in MySQL • DBTools Manager • DBUI • exportSQL • ForwardSQL • Intelligent Converters Software • KMySQLAdmin • Mac SQL • MyAccess • MySQL Data Manager • MySQL WebClient • MySQL Admin • Phpmyadmin
  • 6. 1. Data Definition Language is used to create and modify the structure of database objects in database. Examples: CREATE, ALTER, DROP statements
  • 7. CREATE Creates objects in the database the queery used to create the object is create database [databasename]; Example : create database koha;
  • 8. ALTER Alters objects of the database ALTER TABLE <table_name> ADD <column_name1> <datatype1> <constraint1> ALTER TABLE <table_name> ALTER COLUMN <column_name1> <datatype1> <constraint1> ALTER TABLE <table_name> DROP COLUMN <column_name1> <datatype1>
  • 9. Add a new column to Table. mysql> alter table borrowers add column cardnumber varchar (20); Change column name. mysql> alter table [table name] change [old column name] [new column name] varchar (50);
  • 10. DROP Deletes objects of the database the syntax for dorp DROP TABLE [ IF EXISTS ] table_name1, table_name2, .... drop database koha; Removes the table(s) from the database. The IF EXISTS clause will drop the table only if it exists. If this clause is not present an error is generated if the table does not exist. Any data that was in a dropped table is lost so use with care.
  • 11. Data Manipulation Language is used to retrieve, store, modify, delete, insert and update data in database. Examples: SELECT, UPDATE, INSERT statements
  • 12. SELECT SELECT * FROM table_name WHERE column_name='some value'; SELECT borrowers.cardnumber, borrowers.surname, borrowers.firstname, borrowers.dateenrolled FROM borrowers; The SELECT statement is used to form queries for extracting information out of the database. The above example query will return the card number, name and enrolment date of all borrowers.
  • 13. UPDATE There may be a requirement where existing data in a MySQL table needs to be modified. You can do so by using SQL UPDATE command. This will modify any field value of any MySQL table. UPDATE table_name SET col_name1 = expression1, col_name2 = expres sion2, .... [ WHERE expression ] [ LIMIT limit_amount ]
  • 14. UPDATE table_name SET ([column_name],[...column_name],...) VALUES ( [column_va lue],[..column_value]); UPDATE borrowers SET sur_name=‘Sumona' WHERE id=‘102981'";
  • 15. INSERT To insert data into MySQL table, you would need to use SQL INSERT INTO command. INSERT INTO table_name ( field1, field2, ...fieldN ) VALUES ( value1, value2,...valueN ); INSERT INTO borrowers (borrowers_title, sur_name, first_name) VALUES (“Ms", “Islam", ‘Sumona');
  • 16. Transactional Control Language is used to manage different transactions occurring within a database. Examples: COMMIT, ROLLBACK statements These two keywords Commit and Rollback are mainly used for MySQL Transactions. • When a successful transaction is completed, the COMMIT command should be issued so that the changes to all involved tables will take effect. • If a failure occurs, a ROLLBACK command should be issued to return every table referenced in the transaction to its previous state.
  • 17. START TRANSACTION; SELECT @A:=SUM(salary) FROM table1 WHERE type=1; UPDATE table2 SET summary=@A WHERE type=1; COMMIT; START TRANSACTION [WITH CONSISTENT SNAPSHOT] | BEGIN [WORK] COMMIT ROLLBACK SET autocommit = {0 | 1}
  • 18. Data Control Language is used to create roles, permissions, and referential integrity as well it is used to control access to database by securing it. Examples: GRANT, REVOKE statements grant all privileges on koha.* to ‘kohaadmin'@'localhost' identified by 'your_kohaadmin_password'; revoke all privileges on koha.* to ‘kohaadmin'@'localhost' identified by 'your_kohaadmin_password';
  • 20. Database Backup & restore The following use to take backup MySQL database: mysqldump –u root –p koha>/home/koha/Desktop/koha.sql To restore the database use the following command: mysql –u root –p koha</home/koha/Desktop/koha.sql
  • 21. Useful sites • http://www.mysql.org/ • http://www.mysql.org/documentation • http://www.devshed.com/Server_Side/MySQL