Select Query in MySQL is used to select data from a database tables. Select Query can be performed with single column, multiple column and all column
Example Table : For your reference
table_name
Default Syntax for SELECT Query in Mysql
Query : "Select column_name1 from table_name"
If you execute the above query then the above table data will be displayed only column_name1
table_name
Query : "Select column_name1, column_name3 from table_name"
If you execute the above query then the above table data will display column_name1 and column_name3
table_name
Query : "Select * from table_name"
If you execute the above query then the above table data will display all columns because * indicates all column.
table_name
Example Table : For your reference
table_name
Column_name1 | Column_name2 | Column_name3 | Column_name4 |
1 | Tech | articles | Sam |
2 | Mysql | database | Sam |
3 | Java | coding | Jam |
4 | J2ee | coding | Kam |
5 | Hibernate | coding | Jam |
Table Name is : table_name
Default Syntax for SELECT Query in Mysql
Query : "Select column_name1 from table_name"
If you execute the above query then the above table data will be displayed only column_name1
table_name
Column_name1 |
1 |
2 |
3 |
4 |
5 |
Query : "Select column_name1, column_name3 from table_name"
If you execute the above query then the above table data will display column_name1 and column_name3
table_name
Column_name1 | Column_name3 |
1 | articles |
2 | database |
3 | coding |
4 | coding |
5 | coding |
If you execute the above query then the above table data will display all columns because * indicates all column.
table_name
Column_name1 | Column_name2 | Column_name3 | Column_name4 |
1 | Tech | articles | Sam |
2 | Mysql | database | Sam |
3 | Java | coding | Jam |
4 | J2ee | coding | Kam |
5 | Hibernate | coding | Jam |
Comments
Post a Comment