Sql server® 2012 t-sql fundamentals



Download 10,93 Mb.
Pdf ko'rish
bet72/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   68   69   70   71   72   73   74   75   ...   443
Bog'liq
BookSQL

 

CHAPTER 2

 

Single-Table Queries



 

 29

which you provide your request in an English-like manner. Consider an instruction made by one hu-

man to another in English, such as, “Bring me the car keys from the top-left drawer in the kitchen.” 

Notice that you start the instruction with the object and then indicate the location where the object 

resides. But if you were to express the same instruction to a robot, or a computer program, you would 

have had to start with the location, before indicating what can be obtained from that location. Your 

instruction would have probably been something like, “Go to the kitchen; open the top-left drawer; 

grab the car keys; bring them to me.” The keyed-in order of the query clauses is similar to English— 

it starts with the SELECT clause. Logical query processing order is similar to how you would provide 

instructions to a robot—with the FROM clause processed first.

Now that you understand the order in which the query clauses are logically processed, the next 

sections explain the details of each phase.

When discussing logical query processing, I refer to query clauses and query phases, (the WHERE 

clause and the WHERE phase, for example). A query clause is a syntactical component of a query, so 

when discussing the syntax of a query element I usually use the term clause—for example, “In the 

WHERE clause, you specify a predicate.” When discussing the logical manipulation taking place as part 

of logical query processing, I usually use the term phase—for example, “The WHERE phase returns 

rows for which the predicate evaluates to TRUE.” 

Recall my recommendation from the previous chapter regarding the use of a semicolon to ter-

minate statements. At the moment, SQL Server doesn’t require you to terminate all statements with 

a semicolon. This is a requirement only in particular cases where the meaning of the code might 

otherwise be ambiguous. However, I recommend that you terminate all statements with a semicolon 

because it is standard, it improves the code readability, and it is likely that SQL Server will require 

this in more—if not all—cases in the future. Currently, when a semicolon is not required, adding one 

doesn’t interfere. Therefore, I recommend that you make it a practice to terminate all statements with 

a semicolon.


Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   68   69   70   71   72   73   74   75   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish