6 Nisan 2017 Perşembe

Basic Concepts of SQL


SELECT * FROM [Customers]

SELECT statement above, can be used to show data/datas from the database.
We can write a query to retrieve all informations from all columns of the database using an asterisk (*).
-

SELECT CustomerName FROM customers

Here, we'll get datas from CustomerName column from customers database. We can call more columns in one line of code. See below:

SELECT CustomerName, Address FROM customers;

 -

it is recommended to use upper-case on writing the SQL commands, but its not obligatory:

select CustomerName from customers;
SELECT CustomerName FROM customers;
sElEct CustomerName From customers;

you can use one of them readily.

-

Note: Multiple lines and non-useful white spaces are ignored in SQL. But its recommended to write your code without non-needed white lines or white spaces.
-

Try the code snaps above via this:

http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all

Hiç yorum yok:

Yorum Gönder