Tuesday, December 27, 2016

MySQL - SELECT statement in MySQL

Welcome to our MySQL 5th Lecture:

Today we'll learn how to retrieve the data from any table using SQL query. The syntax is basically SELECT statement.

SELECT statement:

Select statement of SQL is looks like this:

1) Select all from a table -
   SELECT * 
   FROM table_name;

2) Select column values from a table -
   SELECT column_name 
   FROM table_name;

3) Select More column values from a table -
   SELECT column_name, column_name, column_name 
   FROM table_name;


Now go to example:
1) We want to know the all student information from Student table. Query will be -

   
   SELECT * 
   FROM Student;



2) We want to know the names of student from Student table. Query will be -

   
   SELECT Name 
   FROM Student;




3) We want to know the names, email and address of student from Student table. Query will be -

   
   SELECT Name, Email, Address
   FROM Student;





Thank you for staying with us..Wait for our next tutorial...

No comments:

Post a Comment