Categories
SQL Server Step By Step

SQL Select Statement

SQL Select Statement

Hi friends, in this post we will learn about SQL Select Statement or you can say Select Query to get data from SQL server tables. SQL Select Statement are used to fetch data rows from table. In SQL Select Query we can also add conditions to get conditional data only.

Earlier we had discussed about SQL Insert StatementDrop Table SQL ServerRename Table in SQL ServerCreate Table SQL ServerSchema In SQL ServerSQL Server OperatorsData Type in SQL Server and Drop-Delete SQL Server Database Using Management Studio or Query.

SQL Select Query:

----USE DATABASE----
USE Hightechnology
GO

----SELECT ALL DATA FROM TABLE----
SELECT * FROM [dbo].[STUDENT_INFORMATION]

----SELECT TOP 1 RECORD FROM TABLE----
SELECT TOP 1 * FROM [dbo].[STUDENT_INFORMATION]

----SELECT RECORD BASED ON CONDITIONS FROM TABLE----
SELECT * FROM [dbo].[STUDENT_INFORMATION] WHERE ID=1

----SELECT PARTICULAR COLUMNS FROM TABLE----
SELECT ID,NAME,PERMADDRESS FROM [dbo].[STUDENT_INFORMATION]

SQL Select through Management Studio:

1. Open SQL Server Management Studio, and connect to SQL Server.

2. Expand Database name > Right click on table, from which you want to Select data and click on Select Top 1000 Rows.

SQL Select Statement