SQL Simplified:: Learn to Read and Write Structured Query Language - Softcover

Cecelia L. Allison

  • 3.54 out of 5 stars
    13 ratings by Goodreads
 
9781410729743: SQL Simplified:: Learn to Read and Write Structured Query Language

Synopsis

SQL Simplified:Learn To Read and Write Structured Query Language focuses extensively on the implementationof Structured Query Language (SQL) rather than on database design or on theDatabase Management System's (DBMS's) that implement SQL, like many SQL books.Theeasy to follow step-by-step chapters of this book will provide beginners withthe practice necessary to develop the skills and knowledge required to programin SQL with ease. The concepts of SQL are simplified enabling anyone to quicklygrasp the fundamentals of SQL. Each chapter introduces a new concept andincludes examples, key notes and important key terms. This book also highlightsmany key differences in SQL script used in a number of different databasemanagement system platforms. Your comprehension of each chapter is testedthrough the use of quizzes and assignments. After completion of this book, youshould feel confident using SQL in any relational database environment.

- SQL Script to Create the Tables in the Book:

jaffainc.com/SQLBook.htm

"synopsis" may belong to another edition of this title.

About the Author

Dr. Cecelia L. Allison is a published author, technical writer, and an online professor. She writes and facilitates on-line SQL courses (Intro. - Advanced SQL) that are offered on-line through hundreds of accredited colleges, universities, and other accredited educational facilities.

She wrote SQL Simplified: Learn to Read and Write Structured Query Language and SQL for Microsoft Access 1st and 2nd edition. She also teaches computer science and information system courses through on-line colleges.

Dr. Allison has been using SQL for over 20 years and has taught over 80,000 students SQL worldwide. Through her past employment as a technical specialist and software tester she has gained extensive experience in writing and implementing SQL. She holds a Bachelor of Science in Finance, a Master of Science in Information Systems, and a Doctor of Business Administration in Management Information Systems.

JAFFA Inc. Computer Learning Center

jaffainc.com

SQL COURSES

Introduction to SQL: yougotclass.org

Intermediate SQL: yougotclass.org

Advanced SQL: yougotclass.org


ADDITIONAL COURSES

Park University: park.edu


YOUTUBE VIDEOS

How to find "SQL VIEW" in Microsoft Access:
youtube.com/watch?v=DM-3DD7nyNY

Create Parameter Queries in Microsoft Access (SQL View):
youtube.com/watch?v=jxhiLZGt4FA

How to Execute SQL Script in SQL Server 2012:
youtube.com/watch?v=iLa_hKS6wK4

Synopsis of SQL for Microsoft Access 2nd edition:
youtube.com/watch?v=jzCpyyHFzCA

Excerpt. © Reprinted by permission. All rights reserved.

CREATE TABLE Employees

Example 1

The following SQL script creates a table named Employees with seven columns (SocialSecNum, Firstname, Lastname, Address, Zipcode, Areacode, PhoneNumber).

CREATE TABLE Employees

(

SocialSecNum CHAR (11) NOT NULL PRIMARY KEY,

Firstname CHAR (50) NOT NULL,

Lastname CHAR (50) NOT NULL,

Address CHAR (50) NOT NULL, Zipcode CHAR (10) NOT NULL,

Areacode CHAR (3) NULL,

PhoneNumber CHAR (8) NULL

);

The preceding script includes several keywords. The keywords are typed in all caps so that they can be easily identified. Although it is not necessary to capitalize keywords, it is good practice since it causes the keywords to stand out. This makes SQL script easier to read. Remember, keywords are reserved words used to interact with the database.

Notice the spacing in the CREATE TABLE script. You must separate all keywords and column names with a space. Additionally, some DBMSs require a closing semicolon at the end of SQL script to indicate where the script ends.

The CREATE TABLE keywords tell the database management system that you want to create a new table. The name (Employees) of the table must be typed directly after the CREATE TABLE keywords.

Each column (SocialSecNum, Firstname, Lastname, Address, Zipcode, Areacode and PhoneNumber) must contain a datatype and a field size. Some datatypes do not require a field size.

A datatype specifies the type of data a column can store. The field size specifies the maximum number of characters that can be entered into a cell within a column. For example, the datatype and field size for the first column (SocialSecNum) is CHAR (11). This means that the SocialSecNum column can only store alphanumeric data no more than eleven characters long.

Following the datatype and field size, specify either NULL or NOT NULL. The NULL keyword indicates that a column can be left blank when entering data in the table. The NOT NULL keywords indicate that a column cannot be left blank. The DBMS will generate an error message whenever a NOT NULL field is left blank.

Note: In Microsoft Access, when you do not state NULL or NOT NULL the column is automatically set to NULL.

The primary key is usually specified after NULL | NOT NULL. In figure 2.1, the SocialSecNum column is the primary key column. In some versions of Microsoft Access, the primary key is set as follows:

SocialSecNum CHAR (11) NOT NULL CONSTRAINT PriKey Primary Key

This method uses the CONSTRAINT keyword. You will learn more about constraints in chapter 10.

"About this title" may belong to another edition of this title.