Beginning SQL Server for developers /
Beginning SQL Server for Developers is the perfect book for developers new to SQL Server and planning to create and deploy applications against Microsoft?s market-leading database system for the Windows platform. Now in its fourth edition, the book is enhanced to cover the very latest developments i...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Berkeley, CA :
Apress,
2015.
|
Edición: | Fourth edition. |
Colección: | Expert's voice in SQL server.
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- At a Glance
- Contents
- About the Author
- About the Technical Reviewer
- Acknowledgments
- Introduction
- Chapter 1: Overview and Installation
- Why Should I Use SQL Server?
- SQL Server Editions
- The Example
- Installation
- Install
- Setup Role
- Choosing the Features to Install
- Naming the Instance
- Service Accounts
- Authentication Mode
- Defining the Data Directories
- FILESTREAM Options
- Creating the Reporting Services Database
- Distributed Replay Options
- Security
- Services Accounts
- Looking at the Authentication Mode
- Windows Authentication Mode
- Administrators on a Machine
- Mixed Mode
- The sa Login
- Summary
- Chapter 2: SQL Server Management Studio
- A Quick Overview of SSMS
- Query Editor
- sqlcmd
- Summary
- Chapter 3: Database Design and Creation
- Defining a Database
- Prebuilt Databases Within SQL Server
- master
- tempdb
- model
- msdb
- AdventureWorks/AdventureWorksDW
- Choosing the Database System Type
- OLTP
- Backups
- Indexes
- In-memory data
- BI/OLAP
- Example System Choice
- Gathering the Data
- Determining the Information to Store in the Database
- Financial Products
- Customers
- Customer Addresses
- Shares
- Transactions
- External and Ignored Information
- Building Relationships
- Using Keys
- Primary Key
- Foreign/Referencing Key
- Candidate/Alternate Key
- A Unique Constraint Instead of a Primary Key
- Creating Relationships
- Relationships and Referential Integrity
- Types of Relationships
- One-to-One
- One-to-Many
- Many-to-Many
- More on Foreign Keys
- Normalization
- Assign Each Entity a Unique Identifier
- Store Only Information That Directly Relates to That Entity
- Avoid Repeating Values or Columns
- Normal Forms
- First Normal Form
- Customers
- Shares
- Second Normal Form
- Third Normal Form.
- Denormalization
- Creating the Sample Database
- Creating a Database in SQL Server Management Studio
- Dropping the Database in SQL Server Management Studio
- Creating a Database in a Query Pane
- Summary
- Chapter 4: Security and Compliance
- Logins
- Server Logins and Database Users
- Roles
- Fixed Server Roles
- Database Roles
- Application Roles
- Schemas
- Before You Can Proceed with Your Solution
- Declarative Management Framework
- Encryption
- Summary
- Chapter 5: Defining Tables
- What Is a Table?
- SQL Server Data Types
- Table Data Types
- Char/nchar
- Varchar/nvarchar
- Text/ntext
- image
- int
- bigint
- smallint
- tinyint
- decimal/numeric
- float
- real
- money
- smallmoney
- date
- datetime
- datetime2
- smalldatetime
- datetimeoffset
- time
- hierarchyid
- geometry
- geography
- rowversion
- uniqueidentifier
- binary
- varbinary
- bit
- xml
- Program Data Types
- cursor
- table
- sql_variant
- Columns As More Than Simple Data Repositories
- Default Values
- Generating IDENTITY Values
- Uniqueidentifiers for an Identity
- Sequences Instead of IDENTITY
- The Use of NULL Values
- Creating a Table in SQL Server Management Studio
- Creating a Table Through Query Editor
- Creating a Table: Using SQLCMD
- The ALTER TABLE Statement
- Defining the Remaining Tables
- Setting a Primary Key
- Creating a Relationship
- Check Existing Data on Creation
- Enforce Foreign Key Constraints
- Choosing Delete and Update Rules
- Building a Relationship via T-SQL
- Relationships: Database or Application
- Partitioning
- Summary
- Chapter 6: Creating Indexes and Database Diagramming
- What Is an Index?
- Types of Indexes
- Clustered
- Nonclustered
- Uniqueness
- Determining What Makes a Good Index
- Using Low-Maintenance Columns
- Using Primary and Foreign Keys.
- Finding Specific Records
- Using Covering Indexes
- Looking for a Range of Information
- Keeping the Data in Order
- Determining What Makes a Bad Index
- Using Unsuitable Columns
- Choosing Unsuitable Data
- Including Too Many Columns
- When There Are Too Few Records in the Table
- Reviewing Your Indexes for Performance
- Creating an Index
- Creating an Index with the Table Designer
- Indexes and Statistics
- The CREATE INDEX Syntax
- IGNORE_DUP_ KEY
- DROP_ EXISTING
- Creating an Index in Query Editor
- Dropping an Index
- Altering an Index
- Included Columns
- When an Index Does Not Exist
- Diagramming the Database
- Database Diagramming Basics
- The SQL Server Database Diagram Designer
- The Default Database Diagram
- The Database Diagram Toolbar
- Modifying Your Database Using Database Diagram Designer
- Summary
- Chapter 7: In-Memory Tables
- Cost-Based Processing
- What Is an In-Memory Table?
- Differences to Disk-Based Tables
- In-Memory Indexes and the Hash Index
- Hash Buckets
- General Index Points
- Operating System and Hardware Requirements
- Database Requirements Prior to Table Creation
- Creating an In-memory Table Using SQL
- Migrating to an In-Memory Table
- Summary
- Chapter 8: Database Backups and Recovery
- Backup Strategies
- Recovery Models
- Types of Backups
- Backup Strategy Decisions
- Transaction Log Backups
- Frequency of a Backup
- Transaction Logs
- When Problems May Occur
- In-Memory Table Backup and R estore
- Backups: Taking a Database Offline
- Backing Up the Data
- Backup Considerations
- Performing a Manual SQL Server Backup
- Backing Up the Database Using T-SQL
- Transaction Log Backup Using T-SQL
- Restoring a Database
- Restoring Using SQL Server Management Studio
- Restoring Using T-SQL
- Restoring a Database
- Restoring a Transaction Log.
- Restoring to a Point in Time
- Detaching and Attaching a Database
- Detaching and Attaching Using SQL Server Management Studio
- Detaching and Attaching Using T-SQL
- Producing SQL Script for the Database
- Summary
- Chapter 9: Database Maintenance
- Creating a Database Maintenance Plan
- Executing the Plan
- Setting Up Database Mail
- Modifying a Maintenance Plan
- Summary
- Chapter 10: Data Insertion, Deletion, and Transactions-Disk-Based
- Inserting Data
- The T-SQL INSERT Statement Syntax
- INSERT SQL Statement
- Default Values
- Using NULL Values
- DBCC CHECKIDENT
- Column Constraints
- Inserting Several Records at Once
- Transactions
- Transaction Basics
- Transaction Commands
- BEGIN TRAN
- COMMIT TRAN
- ROLLBACK TRAN
- Locking Data
- Deleting Data
- DELETE Syntax
- Before Demonstrating the DELETE Statement
- Using the DELETE Statement
- Truncating a Table
- Dropping a Table
- Summary
- Chapter 11: Selecting and Updating Data from Disk-Based Tables
- Retrieving Data
- Using SQL Server Management Studio to Retrieve Data
- Using the SELECT Statement to Retrieve Data
- The SELECT Statement
- Naming the Columns
- The First Searches
- Varying the Output from a SELECT Query
- Limiting a Search: The Use of WHERE
- TOP (n)
- TOP (n) PERCENT
- SET ROWCOUNT n
- String Functions
- Order! Order!
- The LIKE Operator
- Creating Data: SELECT INTO
- Updating Data
- The UPDATE Statement
- Updating Data within Query Editor
- Updating Data: Using Transactions
- Nested Transactions
- Using More Than One Table
- Summary
- Chapter 12: Working with In-Memory Tables
- INSERT, UPDATE, DELETE, and SELECT Statements
- Locking and Isolation Levels
- MERGE Statement
- In-Memory Table Unsupported Functionality
- Summary
- Chapter 13: Building a View
- Why a View?
- Using Views for Security.
- Encrypting View Definitions
- Views and In-memory Tables
- Creating a View: SQL Server Management Studio
- Creating a View by Using a View
- Creating a View Using T-SQL Syntax
- The CREATE VIEW Syntax
- Creating a View with CREATE VIEW and SELECT
- Binding Columns in a View with SCHEMABINDING
- Indexing a View
- Summary
- Chapter 14: Stored Procedures, Functions, and Security
- What Is a Stored Procedure?
- Creating a Stored Procedure
- CREATE PROCEDURE Syntax
- Returning a Set of Rows
- Creating a Stored Procedure: Management Studio
- Different Methods of Execution
- Returning Results
- Using RETURN
- Returning Multiple Result Sets
- Controlling the Flow
- IF ... ELSE
- BEGIN ... END
- WHILE ... BREAK Statement
- CASE Statement
- Bringing It All Together
- Security
- Security Gains
- Granting and Revoking Permissions
- GRANT
- REVOKE
- User-Defined Functions
- Scalar Functions
- Table-Valued Functions
- Considerations When Building Functions
- Summary
- Chapter 15: Natively Compiled Stored Procedures
- What Is a Natively Compiled Stored Procedure?
- CREATE PROCEDURE and Syntax
- Summary
- Chapter 16: Essentials for Effective Coding
- Variables
- Temporary Tables
- Aggregations
- COUNT/COUNT_BIG
- SUM
- MAX/MIN
- AVG
- Grouping Data
- HAVING
- Distinct Values
- Functions
- Date and Time
- DATEADD()
- DATEDIFF()
- DATENAME()
- DATEPART()
- FORMAT()
- DATEFROMPARTS() / SMALLDATETIMEFROMPARTS()
- TIMEFROMPARTS()
- DATETIME2FROMPARTS()
- DATETIMEOFFSETFROMPARTS()
- EOMONTH()
- GETDATE()/SYSDATETIME()
- String
- ASCII()
- CHAR()
- LEFT()
- LOWER()
- LTRIM()
- RIGHT()
- RTRIM()
- STR()/CONCAT()
- SUBSTRING()
- UPPER()
- System Functions
- CASE WHEN ... THEN ... ELSE ... END
- IIF()
- CHOOSE()
- CAST()/CONVERT()
- ISDATE()
- ISNULL().