SQL Select Command

Advertisements

Create Table in SQL Select Distinct in SQL

SQL Select Command

Select command is used to retrieved the data from the existing table in the database.

  • Using Select command you can retrieve all the records from the table in the database.
  • Using Select command you can retrieve specific records from the table "using where clause"

Syntax

	
select * from table_name;

Note: In the above syntax * represent all columns.

Example

	
select * from Employee;

Employee table

Using this table i will show you how to select employee record whose salary is greater than 30000.

emp_idnamesalary
101Amit24000
102Gaurav26000
103Hitesh35000
104Rahul34000
103Sultan54000

Example

SELECT emp_id, name FROM Employee

Result after using Select Command

emp_idname
101Amit
102Gaurav
103Hitesh
104Rahul
103Sultan

Select command with where clause

When you need to select some specific record from table you can use where clause with select command, in below example i will select those employee records who have more than 30000 salary.

Example

SELECT * from Employee
WHERE salary>30000;

Result after using Execute above query.

emp_idnamesalary
105Hitesh35000
102Rahul34000
103Sultan54000

Create Table in SQL Select Distinct in SQL

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements