SlideShare a Scribd company logo
1 of 19
MYSQL – INTRO TO DATABASE
Prepared by Chester Chin
Structured Query Language
programming language for getting information from
and updating a database.
What does “SQL” Means?
Relate SQL like a smart Excel or Access
•Speed, speed and more speed.
•No programming language out there can outperform SQL when it comes
to bulk operations.
•Data integrity
•SQL has many tools to help make sure the data stored conforms to rules
designed by the system architects.
•Availability & scalability
•allows multiple users to work on the same dataset
Advantage of SQL
In SQL Language:
SELECT *
FROM Book
WHERE price > 100.00
ORDER BY title;
A quick look at it
In Human Language:
I want a list all of books in the order of alphabetical
order according to title where the price is more than
100.
CHECKLIST – Before We Start
• MYSQL 5.5 Command Line Client
• Type every command
• MYSQL Workbench CE
• Graphical User Interface(GUI)
• Make sure you have this two installed
KEYWORDS
Database Tables Rows & Columns
Excel File Excel Sheets Rows & Columns
LETSSTART
LOAD MYSQL Command Line Client
COMMONMISTAKES
;
Missing Semicolon
‘ `
Confusion over ‘ & `
` (Located at top left corner)
‘ (Located beside ENTER)
SHOWDATABASES – CommandLine
TYPE:
mysql> show databases;
RESULT:
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
+--------------------+
2 rows in set (0.00 sec)
USEDATABASES – CommandLine
TYPE:
mysql> use mysql;
RESULT:
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| func |
| help_category |
| help_keyword |
| help_relation |
| help_topic | ……….AND MORE
+---------------------------+
17 rows in set (0.00 sec)
CREATEDATABASE - testdb
Mysql> create DATABASE testdb Mysql > show DATABASES;
CREATINGTABLES
NOTE : When you create a ‘TABLE’, you need to create AT LEAST ONE
column.
Mysql>CREATE TABLE `newtable` ( `firstcolumn` VARCHAR(20) NOT
NULL, PRIMARY KEY (`firstcolumn`));
HUMAN LANGUAGE:
Hey, Create a table call ‘newtable’ and create a column named
‘firstcolumn’ that can fit 20 character and must not be empty which is
also a primary key.
INSERTINGVALUES
Try type the same thing again. What happened?
INSERT INTO `newtable` (`firstcolumn`) VALUES ('1111');
HUMAN LANGUAGE:
Hey, please insert the value ‘1111’ into the ‘firstcolumn’ or the table
‘newtable’
KEYTERMS
Primary Key : ONLY UNIQUE VALUE, NO REPEAT VALUE
VARCHAR : Variable-length character
VARCHAR(10) : Variable-length character, Max 10 character
INT : Integer only
….Many More, however for this level lets just fixed a few.
NOT NULL : Cannot store empty value
EXERCISE
CREATE a database ‘exercisedb’
CREATE a table ‘exercisetable’
CREATE a varchar(20) column ‘firstcolumn’ and make it a primary
key.
INSERT any value into column ‘firstcolumn’ [10 times]
INSERT INTO `newtable` (`firstcolumn`) VALUES ('1111');
Mysql>CREATE TABLE `newtable` ( `firstcolumn` VARCHAR(20) NOT
NULL, PRIMARY KEY (`firstcolumn`));
Cheat Sheet
SELECTSTATEMENT
SELECT * FROM newtable;
* ALL Column available in this table
COMMANDLINE - LIMITATION
If the exercise challenge change to this question.
What do you think?
INSERT any value into column ‘firstcolumn’ [300 times]
MYSQLWORKBENCH – GRAPHICAL WAY
That’s All, Thanks For Your Time. ^.^
Chinschian@Hotmail.com
Drop me an email if you have inputs
for me to improve.

More Related Content

What's hot

What's hot (20)

MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
Presentation db2 best practices for optimal performance
Presentation   db2 best practices for optimal performancePresentation   db2 best practices for optimal performance
Presentation db2 best practices for optimal performance
 
Sqlite
SqliteSqlite
Sqlite
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
 
Funciones en SQL SERVER
Funciones en SQL SERVERFunciones en SQL SERVER
Funciones en SQL SERVER
 
Aggregate functions in SQL.pptx
Aggregate functions in SQL.pptxAggregate functions in SQL.pptx
Aggregate functions in SQL.pptx
 
Introduction to Mysql
Introduction to MysqlIntroduction to Mysql
Introduction to Mysql
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
Sql commands
Sql commandsSql commands
Sql commands
 
Data Manipulation Language
Data Manipulation LanguageData Manipulation Language
Data Manipulation Language
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexing
 
Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
 
Database Administrator
Database AdministratorDatabase Administrator
Database Administrator
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database Fundamental
 
Oracle Database Trigger
Oracle Database TriggerOracle Database Trigger
Oracle Database Trigger
 
INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraints
 
Triggers
TriggersTriggers
Triggers
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 

Viewers also liked

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
 
Basis Data - Pengenalan DML dan DDL
Basis Data - Pengenalan DML dan DDLBasis Data - Pengenalan DML dan DDL
Basis Data - Pengenalan DML dan DDLWalid Umar
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinhwebhostingguy
 
6 3 tier architecture php
6 3 tier architecture php6 3 tier architecture php
6 3 tier architecture phpcefour
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsTuyen Vuong
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to databaseemailharmeet
 

Viewers also liked (14)

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
 
Basis Data - Pengenalan DML dan DDL
Basis Data - Pengenalan DML dan DDLBasis Data - Pengenalan DML dan DDL
Basis Data - Pengenalan DML dan DDL
 
My SQL 101
My SQL 101My SQL 101
My SQL 101
 
MySQL Transactions
MySQL TransactionsMySQL Transactions
MySQL Transactions
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinh
 
6 3 tier architecture php
6 3 tier architecture php6 3 tier architecture php
6 3 tier architecture php
 
MySQL Introduction
MySQL IntroductionMySQL Introduction
MySQL Introduction
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
MySQL
MySQLMySQL
MySQL
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and Concepts
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
Introduction Mysql
Introduction Mysql Introduction Mysql
Introduction Mysql
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to database
 

Similar to MySQL - Intro to Database

Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)Subhasis Nayak
 
working with database using mysql
working with database using mysql working with database using mysql
working with database using mysql Subhasis Nayak
 
05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptx05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptxMohamedNowfeek1
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytWrushabhShirsat3
 
Introduction databases and MYSQL
Introduction databases and MYSQLIntroduction databases and MYSQL
Introduction databases and MYSQLNaeem Junejo
 
PHP mysql Introduction database
 PHP mysql  Introduction database PHP mysql  Introduction database
PHP mysql Introduction databaseMudasir Syed
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfTamiratDejene1
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDSORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDSNewyorksys.com
 
dbs class 7.ppt
dbs class 7.pptdbs class 7.ppt
dbs class 7.pptMARasheed3
 
My sql with querys
My sql with querysMy sql with querys
My sql with querysNIRMAL FELIX
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL ISankhya_Analytics
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developerAhsan Kabir
 

Similar to MySQL - Intro to Database (20)

MySQL for beginners
MySQL for beginnersMySQL for beginners
MySQL for beginners
 
Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)Php, mysq lpart5(mysql)
Php, mysq lpart5(mysql)
 
working with database using mysql
working with database using mysql working with database using mysql
working with database using mysql
 
Sql12
Sql12Sql12
Sql12
 
sql.pdf
sql.pdfsql.pdf
sql.pdf
 
05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptx05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptx
 
sql.pptx
sql.pptxsql.pptx
sql.pptx
 
unit-ii.pptx
unit-ii.pptxunit-ii.pptx
unit-ii.pptx
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
 
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
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDSORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
 
ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL
 
dbs class 7.ppt
dbs class 7.pptdbs class 7.ppt
dbs class 7.ppt
 
My sql with querys
My sql with querysMy sql with querys
My sql with querys
 
Sql wksht-2
Sql wksht-2Sql wksht-2
Sql wksht-2
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL I
 
Introduction to SQL..pdf
Introduction to SQL..pdfIntroduction to SQL..pdf
Introduction to SQL..pdf
 
Steps towards of sql server developer
Steps towards of sql server developerSteps towards of sql server developer
Steps towards of sql server developer
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

MySQL - Intro to Database

  • 1. MYSQL – INTRO TO DATABASE Prepared by Chester Chin
  • 2. Structured Query Language programming language for getting information from and updating a database. What does “SQL” Means?
  • 3. Relate SQL like a smart Excel or Access •Speed, speed and more speed. •No programming language out there can outperform SQL when it comes to bulk operations. •Data integrity •SQL has many tools to help make sure the data stored conforms to rules designed by the system architects. •Availability & scalability •allows multiple users to work on the same dataset Advantage of SQL
  • 4. In SQL Language: SELECT * FROM Book WHERE price > 100.00 ORDER BY title; A quick look at it In Human Language: I want a list all of books in the order of alphabetical order according to title where the price is more than 100.
  • 5. CHECKLIST – Before We Start • MYSQL 5.5 Command Line Client • Type every command • MYSQL Workbench CE • Graphical User Interface(GUI) • Make sure you have this two installed
  • 6. KEYWORDS Database Tables Rows & Columns Excel File Excel Sheets Rows & Columns
  • 8. COMMONMISTAKES ; Missing Semicolon ‘ ` Confusion over ‘ & ` ` (Located at top left corner) ‘ (Located beside ENTER)
  • 9. SHOWDATABASES – CommandLine TYPE: mysql> show databases; RESULT: +--------------------+ | Database | +--------------------+ | information_schema | | mysql | +--------------------+ 2 rows in set (0.00 sec)
  • 10. USEDATABASES – CommandLine TYPE: mysql> use mysql; RESULT: +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | func | | help_category | | help_keyword | | help_relation | | help_topic | ……….AND MORE +---------------------------+ 17 rows in set (0.00 sec)
  • 11. CREATEDATABASE - testdb Mysql> create DATABASE testdb Mysql > show DATABASES;
  • 12. CREATINGTABLES NOTE : When you create a ‘TABLE’, you need to create AT LEAST ONE column. Mysql>CREATE TABLE `newtable` ( `firstcolumn` VARCHAR(20) NOT NULL, PRIMARY KEY (`firstcolumn`)); HUMAN LANGUAGE: Hey, Create a table call ‘newtable’ and create a column named ‘firstcolumn’ that can fit 20 character and must not be empty which is also a primary key.
  • 13. INSERTINGVALUES Try type the same thing again. What happened? INSERT INTO `newtable` (`firstcolumn`) VALUES ('1111'); HUMAN LANGUAGE: Hey, please insert the value ‘1111’ into the ‘firstcolumn’ or the table ‘newtable’
  • 14. KEYTERMS Primary Key : ONLY UNIQUE VALUE, NO REPEAT VALUE VARCHAR : Variable-length character VARCHAR(10) : Variable-length character, Max 10 character INT : Integer only ….Many More, however for this level lets just fixed a few. NOT NULL : Cannot store empty value
  • 15. EXERCISE CREATE a database ‘exercisedb’ CREATE a table ‘exercisetable’ CREATE a varchar(20) column ‘firstcolumn’ and make it a primary key. INSERT any value into column ‘firstcolumn’ [10 times] INSERT INTO `newtable` (`firstcolumn`) VALUES ('1111'); Mysql>CREATE TABLE `newtable` ( `firstcolumn` VARCHAR(20) NOT NULL, PRIMARY KEY (`firstcolumn`)); Cheat Sheet
  • 16. SELECTSTATEMENT SELECT * FROM newtable; * ALL Column available in this table
  • 17. COMMANDLINE - LIMITATION If the exercise challenge change to this question. What do you think? INSERT any value into column ‘firstcolumn’ [300 times]
  • 19. That’s All, Thanks For Your Time. ^.^ Chinschian@Hotmail.com Drop me an email if you have inputs for me to improve.