SlideShare ist ein Scribd-Unternehmen logo
1 von 29
MYSQL: Introduction
OVERVIEW OF MYSQLwhat is mysql?Where to download mysql?What is database?What is sql?Basic queries in mysql?
MYSQLMysql is the most popular open source database system Mysql is a relational databasemanagement system It is a free SQL server database server licensed with GNU www.gnu.org
STEPS TO DOWNLOAD MYSQL1.goto www.mysql.com2.click on downloads3.choose the host operating system4.download and run mysql5.go back and click on gui tools6.download and run mysql gui tools
DatabaseData: known facts that can be recorded and that have implicit meaningDatabase: collection of related data.It is a logical collection of coherent data with some inherent meaning.DBMS: A computerised record-keeping system.
Goals of a DBMS:To provide an efficient and convenient environment for accessing data in dbIt is a general purpose facility for:Defining dbConstructing dbManipulating db
SQL-structured query languagesql is now the standard language for commercial relational DBMS.It has statements for data definitions, queries and updates.
START MYSQL SERVER:log in as root under linux with the command safe_mysqld &1) without any password:mysql -u <user> -h <host>2)with password:mysql -u <user> -h <host> -p ex: mysql –u root –h localhostdesc: -u option is used to log in as a root and –p option tells mysql to query for the password.
BASIC QUERIES IN MYSQL1.CREATE TABLE    create table table_name(column1 data type(NULL||NOT NULL);desc: creates a table.2.SHOW table    show CREATE TABLE table_name;desc: shows the table in your database.
 3.INSERT insert into table_namevalues[‘value1’,’value2’,……..);desc: inserts new rows of data into the database.4.SELECTselect * from table table_name.desc: returns data from the table.
5.SELECTselect column1,column2,…from table1,table2,….[where conditions][group by column1,column2,..][having conditions][order by column1,column2,…]desc: returns data from one or more database tables.
6.UPDATEupdate table_name set column1=‘value1’,column2=‘values’,…[where conditions]desc: updates existing data in the table.7.DELETEdelete from table_name[where conditions]desc: deletes rows of data from a table.
Mysql classes1.SELECTselect *select col1,col2,…select distinct(column)select count(*)desc: defines columns to display as part of query output.
2.FROMfrom table1,table2,table3,..Desc: defines tables from which to retrieve data.3. GROUP BYgroup by grp_col1,grp_col2,…desc: a form of a sorting.         Used to divide output into logical groups.
4.HAVINGhaving grp_col1=‘value1’AND grp_col2=‘value2’desc: similar to the where clause, used to place conditions on the group clause.5.ORDER BYorder by col1,col2,…desc: used to sort a query’s result.
mysql functions:1.rand()desc: returns random values2.sum()desc: returns the sum of the values.3.now()desc: returns the time and date of the system.4.count()desc: returns the count of the values which satisfy the given condition.
sample code to create a table employee and run  basic queries using mysql on windows operating system: Mysql>create  table employee( Ssn INT NOT NULL, Salary INT, Name VARCHAR(20), Primary key(ssn)); Query ok, 0 rows affected (0.04 sec)
Mysql>insert into employee Values(100,10000,’sneha’,’finance’); Query ok, 1 row affected(0.04 sec) Mysql>insert into employee Values(200,20000,’shalini’,’hr’); Query ok, 1 row affected(0.04 sec)
Mysql>insert into employee Values(300,30000,’john’,’finance’); Query ok, 1 row affected(0.04 sec) Mysql>insert into employee Values(400,40000,’jack’,’hr’); Query ok, 1 row affected(0.04 sec)
Mysql>select * from employee;
Mysql>select department, count(*) as number from employee group by department order by number desc;
Mysql>DESC EMPLOYEE;
Mysql>show create table employee;
Mysql> select name, ssn from employee order by ssn desc limit 2;
Mysql>update employee set salary=9000 where ssn=400;Mysql>select * from employee;
Mysql>delete from employeewhere name=‘jack’;mysql>select * from employee;
Mysql>drop table employee;query ok, 0 rows affected (0.04 sec)Mysql>select * from employee;ERROR 1146 (42S02): Table ‘mysql.employee’ doesn’t existuse quit or exit to come out of mysql.Mysql>quit
Advantages of mysql: 1.Its most reliable. 2.Easy to use. 3.Very fast. 4.Multithreaded multi-user and 5.Robust sql database server.
Visit more self help tutorials Pick a tutorial of your choice and browse through it at your own pace. The tutorials section is free, self-guiding and will not involve any additional support. Visit us at www.dataminingtools.net

Weitere ähnliche Inhalte

Was ist angesagt?

Sql comandos
Sql comandosSql comandos
Sql comandosJose
 
20.3 Java encapsulation
20.3 Java encapsulation20.3 Java encapsulation
20.3 Java encapsulationIntro C# Book
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentationNITISH KUMAR
 
Oracle basic queries
Oracle basic queriesOracle basic queries
Oracle basic queriesPRAKHAR JHA
 
Sql clauses by Manan Pasricha
Sql clauses by Manan PasrichaSql clauses by Manan Pasricha
Sql clauses by Manan PasrichaMananPasricha
 
Including Constraints -Oracle Data base
Including Constraints -Oracle Data base Including Constraints -Oracle Data base
Including Constraints -Oracle Data base Salman Memon
 
SQL - שפת הגדרת הנתונים
SQL - שפת הגדרת הנתוניםSQL - שפת הגדרת הנתונים
SQL - שפת הגדרת הנתוניםמורן אלקובי
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functionsAmrit Kaur
 
joins and subqueries in big data analysis
joins and subqueries in big data analysisjoins and subqueries in big data analysis
joins and subqueries in big data analysisSanSan149
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In JavaManish Sahu
 
Sql(structured query language)
Sql(structured query language)Sql(structured query language)
Sql(structured query language)Ishucs
 
Packages in PL/SQL
Packages in PL/SQLPackages in PL/SQL
Packages in PL/SQLPooja Dixit
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts Bharat Kalia
 

Was ist angesagt? (20)

Mysql
MysqlMysql
Mysql
 
Sql comandos
Sql comandosSql comandos
Sql comandos
 
SQL
SQLSQL
SQL
 
SQL Join Basic
SQL Join BasicSQL Join Basic
SQL Join Basic
 
20.3 Java encapsulation
20.3 Java encapsulation20.3 Java encapsulation
20.3 Java encapsulation
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
Oracle basic queries
Oracle basic queriesOracle basic queries
Oracle basic queries
 
MySql:Basics
MySql:BasicsMySql:Basics
MySql:Basics
 
ASP.NET- database connectivity
ASP.NET- database connectivityASP.NET- database connectivity
ASP.NET- database connectivity
 
Sql clauses by Manan Pasricha
Sql clauses by Manan PasrichaSql clauses by Manan Pasricha
Sql clauses by Manan Pasricha
 
Including Constraints -Oracle Data base
Including Constraints -Oracle Data base Including Constraints -Oracle Data base
Including Constraints -Oracle Data base
 
SQL - שפת הגדרת הנתונים
SQL - שפת הגדרת הנתוניםSQL - שפת הגדרת הנתונים
SQL - שפת הגדרת הנתונים
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
 
Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
 
joins and subqueries in big data analysis
joins and subqueries in big data analysisjoins and subqueries in big data analysis
joins and subqueries in big data analysis
 
ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In Java
 
Sql(structured query language)
Sql(structured query language)Sql(structured query language)
Sql(structured query language)
 
Packages in PL/SQL
Packages in PL/SQLPackages in PL/SQL
Packages in PL/SQL
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 

Andere mochten auch

MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsTuyen Vuong
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationGuru Ji
 
BITS: Introduction to relational databases and MySQL - SQL
BITS: Introduction to relational databases and MySQL - SQLBITS: Introduction to relational databases and MySQL - SQL
BITS: Introduction to relational databases and MySQL - SQLBITS
 
SQL Server Replication Transactional Replication from MSSQL 200x to MYSQL 5.x
SQL Server Replication Transactional Replication  from MSSQL 200x to MYSQL 5.xSQL Server Replication Transactional Replication  from MSSQL 200x to MYSQL 5.x
SQL Server Replication Transactional Replication from MSSQL 200x to MYSQL 5.xThet Aung Min Latt
 
Ubilabs: Google Maps API - Best Practices
Ubilabs: Google Maps API - Best PracticesUbilabs: Google Maps API - Best Practices
Ubilabs: Google Maps API - Best PracticesMartin Kleppe
 

Andere mochten auch (20)

Introduction to Mysql
Introduction to MysqlIntroduction to Mysql
Introduction to Mysql
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and Concepts
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
MySQL
MySQLMySQL
MySQL
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
BITS: Introduction to relational databases and MySQL - SQL
BITS: Introduction to relational databases and MySQL - SQLBITS: Introduction to relational databases and MySQL - SQL
BITS: Introduction to relational databases and MySQL - SQL
 
Mysql introduction
Mysql introduction Mysql introduction
Mysql introduction
 
Linq
LinqLinq
Linq
 
San online training
San online trainingSan online training
San online training
 
Base de datos en mysql
Base de datos en mysqlBase de datos en mysql
Base de datos en mysql
 
Why use MySQL
Why use MySQLWhy use MySQL
Why use MySQL
 
SQL Server Replication Transactional Replication from MSSQL 200x to MYSQL 5.x
SQL Server Replication Transactional Replication  from MSSQL 200x to MYSQL 5.xSQL Server Replication Transactional Replication  from MSSQL 200x to MYSQL 5.x
SQL Server Replication Transactional Replication from MSSQL 200x to MYSQL 5.x
 
Google maps api 3
Google maps api 3Google maps api 3
Google maps api 3
 
Google Maps JS API
Google Maps JS APIGoogle Maps JS API
Google Maps JS API
 
Ubilabs: Google Maps API - Best Practices
Ubilabs: Google Maps API - Best PracticesUbilabs: Google Maps API - Best Practices
Ubilabs: Google Maps API - Best Practices
 
Gbd7
Gbd7Gbd7
Gbd7
 

Ähnlich wie MySQL Introduction

Ähnlich wie MySQL Introduction (20)

Introduction databases and MYSQL
Introduction databases and MYSQLIntroduction databases and MYSQL
Introduction databases and MYSQL
 
PHP mysql Introduction database
 PHP mysql  Introduction database PHP mysql  Introduction database
PHP mysql Introduction database
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinh
 
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
 
My sql1
My sql1My sql1
My sql1
 
MySQL Presentation
MySQL PresentationMySQL Presentation
MySQL Presentation
 
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitMySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
 
Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre FeaturesLinuxfest Northwest 2022 - MySQL 8.0 Nre Features
Linuxfest Northwest 2022 - MySQL 8.0 Nre Features
 
Using Mysql.pptx
Using Mysql.pptxUsing Mysql.pptx
Using Mysql.pptx
 
Learn PHP Lacture2
Learn PHP Lacture2Learn PHP Lacture2
Learn PHP Lacture2
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL I
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
 
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfmysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
 
Python database access
Python database accessPython database access
Python database access
 
MySQL with PHP
MySQL with PHPMySQL with PHP
MySQL with PHP
 
Mysql
MysqlMysql
Mysql
 
Mysql python
Mysql pythonMysql python
Mysql python
 
Mysql python
Mysql pythonMysql python
Mysql python
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
 

Kürzlich hochgeladen

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
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
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 

Kürzlich hochgeladen (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
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
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 

MySQL Introduction

  • 2. OVERVIEW OF MYSQLwhat is mysql?Where to download mysql?What is database?What is sql?Basic queries in mysql?
  • 3. MYSQLMysql is the most popular open source database system Mysql is a relational databasemanagement system It is a free SQL server database server licensed with GNU www.gnu.org
  • 4. STEPS TO DOWNLOAD MYSQL1.goto www.mysql.com2.click on downloads3.choose the host operating system4.download and run mysql5.go back and click on gui tools6.download and run mysql gui tools
  • 5. DatabaseData: known facts that can be recorded and that have implicit meaningDatabase: collection of related data.It is a logical collection of coherent data with some inherent meaning.DBMS: A computerised record-keeping system.
  • 6. Goals of a DBMS:To provide an efficient and convenient environment for accessing data in dbIt is a general purpose facility for:Defining dbConstructing dbManipulating db
  • 7. SQL-structured query languagesql is now the standard language for commercial relational DBMS.It has statements for data definitions, queries and updates.
  • 8. START MYSQL SERVER:log in as root under linux with the command safe_mysqld &1) without any password:mysql -u <user> -h <host>2)with password:mysql -u <user> -h <host> -p ex: mysql –u root –h localhostdesc: -u option is used to log in as a root and –p option tells mysql to query for the password.
  • 9. BASIC QUERIES IN MYSQL1.CREATE TABLE create table table_name(column1 data type(NULL||NOT NULL);desc: creates a table.2.SHOW table show CREATE TABLE table_name;desc: shows the table in your database.
  • 10. 3.INSERT insert into table_namevalues[‘value1’,’value2’,……..);desc: inserts new rows of data into the database.4.SELECTselect * from table table_name.desc: returns data from the table.
  • 11. 5.SELECTselect column1,column2,…from table1,table2,….[where conditions][group by column1,column2,..][having conditions][order by column1,column2,…]desc: returns data from one or more database tables.
  • 12. 6.UPDATEupdate table_name set column1=‘value1’,column2=‘values’,…[where conditions]desc: updates existing data in the table.7.DELETEdelete from table_name[where conditions]desc: deletes rows of data from a table.
  • 13. Mysql classes1.SELECTselect *select col1,col2,…select distinct(column)select count(*)desc: defines columns to display as part of query output.
  • 14. 2.FROMfrom table1,table2,table3,..Desc: defines tables from which to retrieve data.3. GROUP BYgroup by grp_col1,grp_col2,…desc: a form of a sorting. Used to divide output into logical groups.
  • 15. 4.HAVINGhaving grp_col1=‘value1’AND grp_col2=‘value2’desc: similar to the where clause, used to place conditions on the group clause.5.ORDER BYorder by col1,col2,…desc: used to sort a query’s result.
  • 16. mysql functions:1.rand()desc: returns random values2.sum()desc: returns the sum of the values.3.now()desc: returns the time and date of the system.4.count()desc: returns the count of the values which satisfy the given condition.
  • 17. sample code to create a table employee and run basic queries using mysql on windows operating system: Mysql>create table employee( Ssn INT NOT NULL, Salary INT, Name VARCHAR(20), Primary key(ssn)); Query ok, 0 rows affected (0.04 sec)
  • 18. Mysql>insert into employee Values(100,10000,’sneha’,’finance’); Query ok, 1 row affected(0.04 sec) Mysql>insert into employee Values(200,20000,’shalini’,’hr’); Query ok, 1 row affected(0.04 sec)
  • 19. Mysql>insert into employee Values(300,30000,’john’,’finance’); Query ok, 1 row affected(0.04 sec) Mysql>insert into employee Values(400,40000,’jack’,’hr’); Query ok, 1 row affected(0.04 sec)
  • 21. Mysql>select department, count(*) as number from employee group by department order by number desc;
  • 24. Mysql> select name, ssn from employee order by ssn desc limit 2;
  • 25. Mysql>update employee set salary=9000 where ssn=400;Mysql>select * from employee;
  • 26. Mysql>delete from employeewhere name=‘jack’;mysql>select * from employee;
  • 27. Mysql>drop table employee;query ok, 0 rows affected (0.04 sec)Mysql>select * from employee;ERROR 1146 (42S02): Table ‘mysql.employee’ doesn’t existuse quit or exit to come out of mysql.Mysql>quit
  • 28. Advantages of mysql: 1.Its most reliable. 2.Easy to use. 3.Very fast. 4.Multithreaded multi-user and 5.Robust sql database server.
  • 29. Visit more self help tutorials Pick a tutorial of your choice and browse through it at your own pace. The tutorials section is free, self-guiding and will not involve any additional support. Visit us at www.dataminingtools.net