Chapter 2. SQL Fundamentals

In This Chapter

  • Understanding SQL

  • Clearing up SQL misconceptions

  • Taking a look at the different SQL standards

  • Getting familiar with standard SQL commands and reserved words

  • Representing numbers, characters, dates, times, and other data types

  • Exploring null values and constraints

  • Putting SQL to work in a client/server system

  • Considering SQL on a network

SQL is a flexible language that you can use in a variety of ways. It's the most widely used tool for communicating with a relational database. In this chapter, I explain what SQL is and isn't — specifically, what distinguishes SQL from other types of computer languages. Then I introduce the commands and data types that standard SQL supports and explain key concepts: null values and constraints. Finally, I give an overview of how SQL fits into the client/server environment, as well as the Internet and organizational intranets.

What SQL Is and Isn't

The first thing to understand about SQL is that SQL isn't a procedural language, as are BASIC, C, C++, C#, and Java. To solve a problem in one of those procedural languages, you write a procedure that performs one specific operation after another until the task is complete. The procedure may be a linear sequence or may loop back on itself, but in either case, the programmer specifies the order of execution.

SQL, on the other hand, is nonprocedural. To solve a problem using SQL, simply tell SQL what you want (as if you were talking to Aladdin's genie) instead of telling the ...

Get SQL For Dummies® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.