دسترسی نامحدود
برای کاربرانی که ثبت نام کرده اند
برای ارتباط با ما می توانید از طریق شماره موبایل زیر از طریق تماس و پیامک با ما در ارتباط باشید
در صورت عدم پاسخ گویی از طریق پیامک با پشتیبان در ارتباط باشید
برای کاربرانی که ثبت نام کرده اند
درصورت عدم همخوانی توضیحات با کتاب
از ساعت 7 صبح تا 10 شب
ویرایش: نویسندگان: Stephens. Ryan K, Plew. Ron, Jones. Arie D سری: Sams Teach Yourself ISBN (شابک) : 9780672330254, 0672330253 ناشر: Sams Publishing سال نشر: 2009 تعداد صفحات: 851 زبان: English فرمت فایل : PDF (درصورت درخواست کاربر به PDF، EPUB یا AZW3 تبدیل می شود) حجم فایل: 4 مگابایت
در صورت تبدیل فایل کتاب Sams Teach Yourself SQL in One Hour a Day به فرمت های PDF، EPUB، AZW3، MOBI و یا DJVU می توانید به پشتیبان اطلاع دهید تا فایل مورد نظر را تبدیل نمایند.
توجه داشته باشید کتاب Sams به خودتان SQL را در یک ساعت در روز آموزش دهید نسخه زبان اصلی می باشد و کتاب ترجمه شده به فارسی نمی باشد. وبسایت اینترنشنال لایبرری ارائه دهنده کتاب های زبان اصلی می باشد و هیچ گونه کتاب ترجمه شده یا نوشته شده به فارسی را ارائه نمی دهد.
The Fifth Edition ofSams Teach Yourself SQL in 21 DaysMore than 48,000 sold! In just one hour a day, you'll have all the skills you need to begin creating effective SQL queries, reports, and database applications. With this complete tutorial, you'll quickly master the basics and then move on to more advanced features and concepts: Quickly apply essential SQL techniques in useful, real-world queries Design trustworthy, high-performance databases Manipulate your data with views and transactions Leverage powerful features including stored procedures, triggers, and cursors Work with new objects introduced with the latest SQL standards Get practical, expert tips on implementing SQL in your business environment Learn on your own time, at your own pace No previous SQL or database experience required Learn techniques that work with any current version of SQL Discover how to write faster, more efficient queries Secure your data using best practices from experienced database administrators Build more powerful databases with features exclusive to Oracle SQL*Plus, Oracle PL/SQL, and Microsoft Transact-SQL Write queries for the free, open source MySQL database Embed your SQL code in other applications Ryan Stephens and Ron Plew are President and VP of Perpetual Technologies, Inc. (PTI) in Indianapolis, IN, providing managed services and consulting for top database implementations running Oracle, SQL Server, and other leading technologies. They taught for 5+ years as adjunct professors at Indiana University-Purdue University. Their books includeSams Teach Yourself SQL in 24 Hours, First through Fourth Editions,Sams Teach Yourself SQL in 21 Days, Second through Fourth Editions, andDatabase Design.Table of ContentsIntroduction 1PART I: Introducing SQLLESSON 1: Getting Started with SQL 5A Brief History of SQL 5 A Brief History of Databases 6 Today's Database Landscape 11 A Cross-Product Language 12 Early Implementations 12 SQL and Client/Server Application Development 13 An Overview of SQL 13 Popular SQL Implementations 14 MySQL 14 Oracle 14 Microsoft SQL Server and Sybase 15 IBM DB2 16 Open Database Connectivity 16 Embedding SQL in Application Programming 17LESSON 2: Introducing the Query 21Exploring SQL's Background 21 Learning Basic Query Syntax 22 The Building Blocks of Data Retrieval: SELECT and FROM 23 Applying Query Concepts 25 Writing Your First Query 26 Terminating a SQL Statement 28 Selecting Individual Columns 28 Changing the Order of the Columns 29 Selecting Different Tables 31 Selecting Distinct Values 31 Exercises 37LESSON 3: Expressions, Conditions, and Operators 39Working with Query Expressions 40 Placing Conditions on Queries 40 Learning How to Use Operators 42 Arithmetic Operators 42 Comparison Operators 55 Character Operators 63 Logical Operators 70 Set Operators 75 Miscellaneous Operators: IN and BETWEEN 78LESSON 4: Clauses in SQL Queries 85Specifying Criteria with the WHERE Clause 87 Order from Chaos: The ORDER BY Clause 89 The GROUP BY Clause 98 The HAVING Clause 105 Combining Clauses 112 Example 4.1 112 Example 4.2 113 Example 4.3 113 Example 4.4 115LESSON 5: Joining Tables 121Joining Multiple Tables in a Single SELECT Statement 121 Cross Joining Tables 123 Finding the Correct Column 128 Joining Tables Based on Equality 129 Joining Tables Based on Nonequality 137 OUTER JOINs Versus INNER JOINs 139 Joining a Table to Itself: The Self Join 143LESSON 6: Embedding Subqueries into Queries 151Building a Subquery 153 Using Aggregate Functions with Subqueries 160 Nesting Subqueries 162 Referencing Outside with Correlated Subqueries 166 Using EXISTS, ANY, and ALL 169LESSON 7: Molding Data with Built-in Functions 179Using Aggregate Functions to Summarize Data 180 COUNT 180 SUM 181 AVG 182 MAX 184 MIN 185 VARIANCE 186 STDDEV 186 Using Functions to Format Date and Time Values 187 ADD_MONTHS/ADD_DATE 188 LAST_DAY 190 MONTHS_BETWEEN 191 NEXT_DAY 193 SYSDATE 193 Using Functions for Arithmetic Operations 195 ABS 195 CEIL and FLOOR 196 EXP 196 LN and LOG 197 MOD 198 POWER 199 SIGN 199 SQRT 200 Using Functions to Modify the Appearance of Character Values 201 CHR 201 CONCAT 202 INITCAP 203 LOWER and UPPER 203 LPAD and RPAD 205 LTRIM and RTRIM 206 REPLACE 207 SUBSTR 209 TRANSLATE 213 INSTR 214 LENGTH 214 Conversion Functions 215 TO_CHAR 215 TO_NUMBER 217 Miscellaneous Functions 217 GREATEST and LEAST 217 USER 218 Supplemental Examples of MySQL Character Functions 219 LENGTH 219 LOCATE 219 INSTR 220 LPAD 220 RPAD 220 LEFT 220 RIGHT 221 SUBSTRING 221 LTRIM 221 RTRIM 222 TRIM 222 Supplemental Examples of MySQL Date Functions 222 DATE_FORMAT 223 TIME_FORMAT 224 CURDATE 224 CURTIME 225PART II: Database DesignLESSON 8: Database Normalization 229Normalizing a Database 229 The Raw Database 229 Logical Database Design 230 The Needs of the End User 230 Data Redundancy 231 Understanding the Normal Forms 231 The First Normal Form 232 The Second Normal Form 233 The Third Normal Form 234 Making Normalization Work 235 Referential Integrity 235 Benefits of Normalization 236 Drawbacks of Normalization 237 Denormalizing a Database 237LESSON 9: Creating and Maintaining Tables 241Beginning with the CREATE DATABASE Statement 242 CREATE DATABASE Options 243 Database Design 244 Creating a Data Dictionary (System Catalog) 244 Creating Key Fields 246 Defining Tables with the CREATE TABLE Statement 247 The Table Name 248 The Field Name 249 The Field's Data Type 249 Table Storage and Sizing 254 Creating a Table from an Existing Table 255 Modifying Table Structures with the ALTER TABLE Statement 257 The DROP TABLE Statement 261 The DROP DATABASE Statement 262 Working with DROP TABLE and DROP DATABASE 262LESSON 10: Controlling Data Integrity 267Introducing Constraints 267 Data Integrity 267 Why Use Constraints? 268 Exploring Types of Constraints 269 NOT NULL Constraints 269 Primary Key Constraints 271 Unique Constraints 273 Foreign Key Constraints 274 Check Constraints 276 Managing Constraints 277 Using the Right Order 278 Different Approaches to Creating Constraints 279 Example Oracle Referential Integrity Reports 279PART III: Data ManipulationLESSON 11: Manipulating Data 285Introducing Data-Manipulation Statements 285 Entering Data with the INSERT Statement 286 Entering One Record with the INSERT...VALUES Statement 286 Inserting NULL Values 289 Inserting Unique Values 291 Entering Multiple Records with the INSERT...SELECT Statement 292 Modifying Existing Data with the UPDATE Statement &nb
Cover......Page 1
Table of Contents......Page 6
Introduction......Page 24
A Brief History of SQL......Page 28
A Brief History of Databases......Page 29
Today's Database Landscape......Page 34
A Cross-Product Language......Page 35
An Overview of SQL......Page 36
Popular SQL Implementations......Page 37
Open Database Connectivity......Page 39
Embedding SQL in Application Programming......Page 40
Exploring SQL's Background......Page 44
Learning Basic Query Syntax......Page 45
The Building Blocks of Data Retrieval: SELECT and FROM......Page 46
Applying Query Concepts......Page 48
Writing Your First Query......Page 49
Selecting Distinct Values......Page 55
LESSON 3: Expressions, Conditions, and Operators......Page 62
Placing Conditions on Queries......Page 63
Learning How to Use Operators......Page 65
LESSON 4: Clauses in SQL Queries......Page 108
Specifying Criteria with the WHERE Clause......Page 110
Order from Chaos: The ORDER BY Clause......Page 112
The GROUP BY Clause......Page 121
The HAVING Clause......Page 128
Combining Clauses......Page 135
Joining Multiple Tables in a Single SELECT Statement......Page 144
Joining Tables Based on Equality......Page 152
Joining Tables Based on Nonequality......Page 160
OUTER JOINs Versus INNER JOINs......Page 162
Joining a Table to Itself: The Self Join......Page 166
LESSON 6: Embedding Subqueries into Queries......Page 174
Building a Subquery......Page 176
Using Aggregate Functions with Subqueries......Page 183
Nesting Subqueries......Page 185
Referencing Outside with Correlated Subqueries......Page 189
Using EXISTS, ANY, and ALL......Page 192
LESSON 7: Molding Data with Built-in Functions......Page 202
Using Aggregate Functions to Summarize Data......Page 203
Using Functions to Format Date and Time Values......Page 210
Using Functions for Arithmetic Operations......Page 218
Using Functions to Modify the Appearance of Character Values......Page 224
Conversion Functions......Page 238
Miscellaneous Functions......Page 240
Supplemental Examples of MySQL Character Functions......Page 242
Supplemental Examples of MySQL Date Functions......Page 245
Normalizing a Database......Page 252
Understanding the Normal Forms......Page 254
Making Normalization Work......Page 258
Benefits of Normalization......Page 259
Denormalizing a Database......Page 260
LESSON 9: Creating and Maintaining Tables......Page 264
Beginning with the CREATE DATABASE Statement......Page 265
Defining Tables with the CREATE TABLE Statement......Page 270
Modifying Table Structures with the ALTER TABLE Statement......Page 280
The DROP TABLE Statement......Page 284
The DROP DATABASE Statement......Page 285
Introducing Constraints......Page 290
Exploring Types of Constraints......Page 292
Managing Constraints......Page 300
Introducing Data-Manipulation Statements......Page 308
Entering Data with the INSERT Statement......Page 309
Modifying Existing Data with the UPDATE Statement......Page 318
Removing Information with the DELETE Statement......Page 321
Importing and Exporting Data from Foreign Sources......Page 326
LESSON 12: Dates and Time in SQL......Page 332
How Are Date and Time Values Stored?......Page 333
Applying Date Functions to the Query......Page 335
Converting Date Formats......Page 344
Introducing Views......Page 354
Using Views......Page 355
LESSON 14: Controlling Transactions......Page 376
The Banking Application......Page 377
Beginning a Transaction......Page 379
Finishing a Transaction......Page 382
Canceling the Transaction......Page 384
Using Transaction Savepoints......Page 386
LESSON 15: Creating Indexes on Tables to Improve Performance......Page 392
What Are Indexes?......Page 393
Using the UNIQUE Keyword with CREATE INDEX......Page 404
Indexes and Joins......Page 405
Using Clustered Indexes......Page 407
LESSON 16: Streamlining SQL Statements for Improved Performance......Page 412
Making Your SQL Statements Readable......Page 413
Avoiding the Full-Table Scan......Page 414
Arranging Elements in a Query......Page 416
OLAP Versus OLTP......Page 420
Batch Loads Versus Transactional Processing......Page 421
Optimizing Data Loads by Dropping Indexes......Page 423
COMMIT Statement......Page 424
Rebuilding Tables and Indexes in a Dynamic Environment......Page 425
Tuning the Database......Page 428
Identifying Performance Obstacles......Page 430
Using Built-in Tuning Tools......Page 432
Security's Role in Database Administration......Page 436
Popular Database Products and Security......Page 437
Oracle Express and MySQL Security......Page 439
An Introduction to the Data Dictionary......Page 460
Identifying Data Dictionary Users......Page 461
Exploring the Contents of the Data Dictionary......Page 462
A Look Inside Oracle's Data Dictionary......Page 463
A Look Inside MySQL's Data Dictionary......Page 482
LESSON 19: Temporary Tables, Stored Procedures, Triggers, and Cursors......Page 490
Creating Temporary Tables......Page 491
Using Cursors......Page 495
Creating and Using Stored Procedures......Page 499
Designing and Using Triggers......Page 502
Using Embedded SQL......Page 504
LESSON 20: New Objects in the Latest Standard......Page 510
Exploring the CREATE ROLE Statement......Page 511
Creating Triggers......Page 513
Using the CREATE TYPE Statement......Page 515
Regular Expressions......Page 520
Working with BLOB Data Types......Page 521
A Short XML Example......Page 522
Understanding the Power of SQL Statement Generation......Page 526
Miscellaneous SQL*Plus Commands......Page 528
Counting the Rows in All Tables......Page 530
Granting System Privileges to Multiple Users......Page 535
Granting Privileges on Your Tables to Another User......Page 537
Disabling Table Constraints to Load Data......Page 539
Creating Numerous Synonyms in a Single Bound......Page 540
Creating Views on Your Tables......Page 543
Truncating All Tables in a Schema......Page 545
Using SQL to Generate Shell Scripts......Page 546
Applying SQL Generation and Other Concepts to the Real World......Page 547
CREATE TABLE statements......Page 552
Examples of Complex Queries......Page 555
Tips for Building Complex Queries......Page 569
Exploring Common SQL Errors......Page 574
Exploring Common Logical Mistakes......Page 587
Preventing Problems with Your Data......Page 594
A Quick Trip Through Some Application Development Tools......Page 598
Creating the Database......Page 600
Using Java and SQL......Page 604
Using .NET and SQL......Page 606
An Introduction to SQL*Plus......Page 610
The SQL*Plus Buffer......Page 611
Viewing Table Structure with the DESCRIBE Command......Page 616
Displaying Settings with the SHOW Command......Page 617
Manipulating Files with File Commands......Page 618
Customizing the Work Environment with SET Commands......Page 622
Formatting Your Output......Page 626
Creating Report and Group Summaries......Page 629
Using Variables in SQL*Plus......Page 633
Using the DUAL Table......Page 638
Exploring the DECODE Function......Page 639
DATE Conversions......Page 642
Running a Series of SQL Files......Page 645
Adding Comments to Your SQL Script......Page 646
Creating Advanced Reports......Page 647
Introducing PL/SQL......Page 652
The Structure of a PL/SQL Block......Page 653
Putting Everything Together......Page 667
Using Stored Procedures, Packages, and Triggers......Page 675
An Overview of Transact-SQL......Page 684
Extensions to ANSI QL......Page 685
Data Types......Page 686
Accessing the Database with Transact-SQL......Page 688
Establishing Flow Control......Page 695
Using Transact-SQL Wildcard Operators......Page 702
Date Conversions......Page 703
SQL Server Diagnostic Tools—SET Commands......Page 704
LESSON 28: Using MySQL on a UNIX-based System......Page 708
MySQL Administration......Page 709
The MySQL Terminal Monitor......Page 711
MySQL Utilities......Page 717
APPENDIX A: Answers......Page 720
APPENDIX B: Code Examples to Create Tables......Page 754
APPENDIX C: Code Examples to Populate Tables......Page 766
APPENDIX D: Using MySQL for Exercises......Page 786
A......Page 790
B......Page 792
C......Page 793
D......Page 798
E......Page 803
F......Page 805
G......Page 807
I......Page 808
J......Page 809
L......Page 810
M......Page 811
N......Page 813
O......Page 814
P......Page 816
Q......Page 818
R......Page 819
S......Page 820
T......Page 829
U......Page 834
V......Page 835
X-Y-Z......Page 837
APPENDIX E: Glossary of Common SQL Commands......Page 838
APPENDIX F: Glossary of Common SQL Functions......Page 844