Ticker

6/recent/ticker-posts

Header Ads Widget

Responsive Advertisement

SQL SELECT

 


SQL SELECT

SQL SELECT Statement is used to fetch/retrieve the data from a database table which returns data in the form of resultant table. These result tables are called result-sets.

 

Syntax:

SELECT column1, column2, columnN FROM table_name;

 

Here, column1, column2...are the fields of a table whose values you want to fetch. If you want to fetch all the fields available in the field, then you can use the following

 

Syntax:

SELECT * FROM table_name;

 

Example:

Consider the CUSTOMERS table having the following records:

+----+-------------+-------+-----------------+--------------+

| ID  | NAME      | AGE   | ADDRESS       | SALARY      |

+----+-------------+-------+-----------------+--------------+

| 1   | Ramesh    | 32      | Ahmedabad  | 2000.00      |

| 2   | Khilan       | 25      | Delhi               | 1500.00      |

| 3   | kaushik    | 23      | Kota                 | 2000.00      |

| 4   | Chaitali     | 25     | Mumbai          | 6500.00      |

| 5   | Hardik      | 27     | Bhopal             | 8500.00      |

| 6   | Komal       | 22     | MP                    | 4500.00      |

| 7   | Muffy        | 24     | Indore              | 10000.00   |

+----+-------------+------+------------------+---------------+

 

Following is an example, which would fetch ID, Name and Salary fields of the customers available in CUSTOMERS table:

 

SQL> SELECT ID, NAME, SALARY FROM CUSTOMERS;

 

+----+-------------+----------------+

| ID  | NAME      | SALARY         |

+----+-------------+----------------+

| 1    | Ramesh  | 2000.00         |

| 2    | Khilan     | 1500.00         |

| 3    | kaushik  | 2000.00         |

| 4    | Chaitali  | 6500.00         |

| 5    | Hardik   | 8500.00         |

| 6    | Komal    | 4500.00         |

| 7    | Muffy     | 10000.00       |

+----+-----------+-----------------+

 




आशा करते है कि हमारे द्वारा लिखी हुई इस Post को आप Like, Share and Comment करेंगे | और हमें Comment करके बताये की आपको ये Post कैसी लगी | इसी तरह की Post और News पाने के लिए हमारे सभी Social Media Channels को रेगुलर Follow करे| 


Thanks
Amar Digital World
(Always Ready To Digital Serve)

Post a Comment

0 Comments