What is That SELECT in SQL SERVER

What is that “Select”?

What is That “Select”?

SYNTAXDESCRIPTION
SELECTWhich you want to query the data in the table (Initial clause)
*Column Name or all Column (*)
FROM…from table

Cars – Example

--First, execute
CREATE TABLE CARS (
CarNo INT, 
CarName VARCHAR(20),
CarColor VARCHAR(20)
)
--Second, execute
INSERT INTO CARS VALUES(1,'Range Rover','Black')

--Third, execute
SELECT * FROM CARS
SELECT CarName FROM CARS

Let’s add 5 more.

INSERT INTO CARS VALUES
(2,'Ferrari','Red'),
(3,'Fiat','Gray'),
(4,'Volkswagen','Blue'),
(5,'Lada','Yellow'),
(6,'Tiggo','White')
SELECT * FROM CARS

Now, There are 6 cars.

Example Queries

SELECT * FROM CARS WHERE CarName='Range Rover'
SELECT CarName FROM CARS WHERE CarNo=3 
SELECT CarNo,CarName FROM CARS WHERE CarColor='White' 

Thank You!

Leave a Reply