Teach Yourself Microsoft SQL Server T-SQL in 10 Minutes.pdf
(
1651 KB
)
Pobierz
Ben Forta
Sams
Teach Yourself
Microsoft
®
SQL Server
T-SQL
10
in
Minutes
800 East 96th Street, Indianapolis, Indiana, 46240 USA
Sams Teach Yourself Microsoft® SQL Server T-SQL in 10
Minutes
Copyright © 2008 by Sams Publishing
All rights reserved. No part of this book shall be reproduced,
stored in a retrieval system, or transmitted by any means, elec-
tronic, mechanical, photocopying, recording, or otherwise, without
written permission from the publisher. No patent liability is
assumed with respect to the use of the information contained
herein. Although every precaution has been taken in the prepara-
tion of this book, the publisher and author assume no responsibil-
ity for errors or omissions. Nor is any liability assumed for dam-
ages resulting from the use of the information contained herein.
ISBN-10: 0-672-32867-4
ISBN-13: 978-0-672-32867-1
Library of Congress Catalog Card Number: 2006922043
Printed in the United States of America
First Printing: August 2007
Trademarks
All terms mentioned in this book that are known to be trademarks
or service marks have been appropriately capitalized. Sams
Publishing cannot attest to the accuracy of this information. Use
of a term in this book should not be regarded as affecting the
validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and
as accurate as possible, but no warranty or fitness is implied. The
information provided is on an “as is” basis. The author and the
publisher shall have neither liability nor responsibility to any per-
son or entity with respect to any loss or damages arising from the
information contained in this book.
Bulk Sales
Sams Publishing offers excellent discounts on this book when
ordered in quantity for bulk purchases or special sales. For more
information, please contact
U.S. Corporate and Government Sales
1-800-382-3419
corpsales@pearsontechgroup.com
For sales outside of the U.S., please contact
International Sales
international@pearsoned.com
Acquisitions
Editors
Loretta Yates
Damon Jordon
Development
Editor
Mark Renfrow
Managing
Editor
Patrick Kanouse
Project Editor
Mandie Frank
Copy Editor
Bart Reed
Indexer
WordWise
Publishing
Services, LLC.
Proofreader
Elizabeth Scott
Technical Editor
Jon Price
Publishing
Coordinator
Vanessa Evans
Designer
Gary Adair
Table of Contents
Introduction 1
Who Is This Book For?
..........................................................
2
Companion Website
..............................................................
2
Conventions Used in This Book
............................................
3
1 Understanding SQL 5
Database Basics
......................................................................
5
What Is SQL?
......................................................................
11
Try It Yourself
......................................................................
12
Summary
............................................................................
12
2 Introducing SQL Server 13
What Is SQL Server?
............................................................
13
SQL Server Tools
..................................................................
16
Summary
............................................................................
18
3 Working with SQL Server 19
Making the Connection
......................................................
19
Selecting a Database
............................................................
20
Learning About Databases and Tables
..................................
21
Summary
............................................................................
25
4 Retrieving Data 27
The SELECT Statement
........................................................
27
Retrieving Individual Columns
............................................
27
Retrieving Multiple Columns
..............................................
29
Retrieving All Columns
........................................................
31
Retrieving Distinct Rows
......................................................
32
iv
Sams Teach Yourself Microsoft SQL Server T-SQL in 10 Minutes
Limiting Results
..................................................................
33
Using Fully Qualified Table Names
......................................
36
Summary
............................................................................
36
5 Sorting Retrieved Data 37
Sorting Data
........................................................................
37
Sorting by Multiple Columns
..............................................
39
Specifying Sort Direction
....................................................
40
Summary
............................................................................
43
6 Filtering Data 45
Using the WHERE Clause
....................................................
45
The WHERE Clause Operators
..............................................
46
Summary
............................................................................
52
7 Advanced Data Filtering 53
Combining WHERE Clauses
................................................
53
Using the IN Operator
........................................................
57
Using the NOT Operator
......................................................
59
Summary
............................................................................
60
8 Using Wildcard Filtering 61
Using the LIKE Operator
......................................................
61
Tips for Using Wildcards
......................................................
67
Summary
............................................................................
67
9 Creating Calculated Fields 69
Understanding Calculated Fields
..........................................
69
Concatenating Fields
............................................................
70
Performing Mathematical Calculations
................................
75
Summary
............................................................................
77
Plik z chomika:
k3r10n
Inne pliki z tego folderu:
Teach Yourself Microsoft SQL Server T-SQL in 10 Minutes.pdf
(1651 KB)
foo.jpg
(66 KB)
Inne foldery tego chomika:
Adam Błaszczyk - Wirusy
Adobe Photoshop CS3 Podręcznik użytkownika PL
Android
Andrzej Dudek - Jak pisać wirusy
Asembler - Kurs programowania dla średnio zaawansowanych
Zgłoś jeśli
naruszono regulamin