Maniruzzaman Akash's Blog

Maniruzzaman Akash, A programmer, A web programmer, a helpful person to share knowledge and everything..

  • Home
  • Programming
    • C Programming
    • Java Programming
    • C++ Programming
    • C# Programming
    • Python Programming
    • Data Structure
  • Web
    • HTML
    • CSS
    • Javascript
    • PHP
    • AJAX
    • XML
  • FrameWork
    • Bootstrap(CSS)
    • Laravel 5(PHP)
  • Database
    • MySQL
    • Oracle
    • SQL Server
  • Android
    • Android Development
  • Mathematics
    • Numerical Methods
  • Others
    • My Articles
    • Download Ebooks
    • Mathematics
    • Difference Between
  • Contact
MySQL Database

MySQL - WHERE statement

Tuesday, December 27, 2016 By Maniruzzaman Akash 0 Comments
Welcome to our MySQL lecture..
Today we will learn about MySQL WHERE clause.

Why Used WHERE in MySQL:

When we want to search some data from a condition or any other criteria then we use MySQL WHERE clause. That means to search data from a condition, we use WHERE statement in MySQL.

Rules of Writing WHERE clause in MySQL:


   SELECT column_name,column_name
   FROM table_name
   WHERE column_name operator value;

So, look at the operator . We can use the following operator here:
 =                   --->  Equal operator
>                    --->  Greater than operator
<                    --->  Less than operator
>=                  --->  Greater than or equal operator
<=                  --->  Less than or equal operator
<>                  --->  Not Equal operator
BETWEEN   --->  To check two number using between condition
LIKE            --->  To search anything like that word
IN                 --->  To check anything in the new relation or in new condition.

Example of MySQL WHERE clause:

In our second lecture of MySQL we have created a table and which is like this :
Let Insert some data first to search as our specific condition:

  INSERT INTO Student (ID, Name, Email, Address) VALUES ('1402011', 'Jhon', 'jhon@gmail.com', 'Delhi, India');
  INSERT INTO Student (ID, Name, Email, Address) VALUES ('1402039', 'Nur', 'Nur@yahoo.com', 'Bagerhat, Bangladesh');
  INSERT INTO Student (ID, Name, Email, Address) VALUES ('1402043', 'Musa', 'Musa@yahoo.com', 'Nepal');
  INSERT INTO Student (ID, Name, Email, Address) VALUES ('1402044', 'XXX', 'xxx@yahoo.com', 'Nepal');
  INSERT INTO Student (ID, Name, Email, Address) VALUES ('1402014', 'Roshan', 'roshan@gmail.com', 'Brazil');
  INSERT INTO Student (ID, Name, Email, Address) VALUES ('1402020', 'Roshan', 'roshan_india@gmail.com', 'India');
  INSERT INTO Student (ID, Name, Email, Address) VALUES ('1402030', 'Ronin', 'ronin@gmail.com', 'Brazil');


Ok, that's enough our Student table is like now:




Query 1: Select all from Student table of student name Roshan.



SELECT *
FROM Student
WHERE name = 'Roshan';


Query 2: Select all the names from Student table of student whose address is Brazil.



SELECT Name
FROM Student
WHERE Address = 'Brazil';


Query 3: Select all from Student table whose ID is less than or equal 1402030.



SELECT *
FROM Student
WHERE ID <= '1402030';


Query 4: Select all from Student table whose ID is between 1402030 and 1402014.



SELECT *
FROM Student
WHERE ID BETWEEN '1402030' AND '1402014';



Ok, thanks for staying with us. Run the code and see the output and get the exactly what you want. Please comment if you face any problem.


MySQL Database
Share:

Maniruzzaman Akash
Maniruzzaman Akash, an enthusiastic programmer, a web developer

Related Articles


0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments ( Atom )

Popular Posts

  • Numerical Methods 20 Multiple Choice Questions and Answers
  • Consider a hypothetical 32-bit microprocessor having 32-bit instructions: Solutions
  • List and briefly define two approaches to dealing with multiple interrupts
  • The hypothetical machine has two I/O instructions: 0011= Load AC fro I/O 0111= Store AC to I/O Solutions
  • What are the characteristics of Digital IC's?-Solution
  • Mid Square Method Code implementation in C and MatLab
  • List and briefly define the possible states that define an instruction execution
  • BFS, DFS, DLS in Tree implementation in C
  • Download Laravel Offline Documentation as HTML
  • Simpson's 1/3 Code in Matlab

Category

Advanced PHP Android Developement Articles Artificial Intelligenece Blogger Tips Blogging Career Bootstrap Offline Documentation Bootstrap Templates C Programming Computer Architecture Data Structure Difference Between Download Documentation Download Ebook Download Free Blog Template Earning Money Electrical Electronics Guest Posts HTML Java Programming Laravel Laravel Bangla Tutorial MatLab Code My Videos MySQL Database Numerical Methods Offline Documentation Recent Topics Simulation and Modeling Unity Game Development Web Design Web Development

LIKE ME ON FACEBOOK

TAGS

  • Advanced PHP (3)
  • Android Developement (5)
  • Articles (6)
  • Artificial Intelligenece (3)
  • Blogger Tips (5)
  • Blogging Career (1)
  • Bootstrap Offline Documentation (1)
  • Bootstrap Templates (1)
  • C Programming (14)
  • Computer Architecture (5)
  • Data Structure (11)
  • Difference Between (1)
  • Download Documentation (2)
  • Download Ebook (3)
  • Download Free Blog Template (2)
  • Earning Money (1)
  • Electrical Electronics (1)
  • Guest Posts (1)
  • HTML (4)
  • Java Programming (2)
  • Laravel (3)
  • Laravel Bangla Tutorial (1)
  • MatLab Code (2)
  • My Videos (3)
  • MySQL Database (7)
  • Numerical Methods (9)
  • Offline Documentation (1)
  • Recent Topics (1)
  • Simulation and Modeling (2)
  • Unity Game Development (3)
  • Web Design (3)
  • Web Development (1)

Join Google+

Maniruzzaman Akash
View my complete profile

Join With Me

Site Visitors

Best Sites For a programmer

  • URI Online Judge Solution By Me
  • StackOverFlow
  • W3 School
  • Git Hub - Store your Every Document

Popular Posts

  • What are the characteristics of Digital IC's?-Solution
  • Numerical Methods 20 Multiple Choice Questions and Answers
  • How to import Excel,CSV file in Laravel And insert data in database
  • What is Blue Whale Game ? Why people suicide?
  • Simpson's 1/3 Code in Matlab
  • Mid Square Method Code implementation in C and MatLab
  • Depth First Search DFS code using Binary Tree in C language
  • How to browse files on Android outside of Unity app folder
  • Consider a hypothetical 32-bit microprocessor having 32-bit instructions: Solutions
  • The hypothetical machine has two I/O instructions: 0011= Load AC fro I/O 0111= Store AC to I/O Solutions

Earn Money From Your site

Translate To your language

Categories

Advanced PHP (3) Android Developement (5) Articles (6) Artificial Intelligenece (3) Blogger Tips (5) Blogging Career (1) Bootstrap Offline Documentation (1) Bootstrap Templates (1) C Programming (14) Computer Architecture (5) Data Structure (11) Difference Between (1) Download Documentation (2) Download Ebook (3) Download Free Blog Template (2) Earning Money (1) Electrical Electronics (1) Guest Posts (1) HTML (4) Java Programming (2) Laravel (3) Laravel Bangla Tutorial (1) MatLab Code (2) My Videos (3) MySQL Database (7) Numerical Methods (9) Offline Documentation (1) Recent Topics (1) Simulation and Modeling (2) Unity Game Development (3) Web Design (3) Web Development (1)

Subscribe To This Site To Get Latest Article On Programming or web

Posts
Atom
Posts
Comments
Atom
Comments
© 2016 Maniruzzaman Akash's Blog | All rights reserved
Developed By Maniruzzaman Akash Created By Responsive Blogger Templates | Distributed By Gooyaabi Templates