
How our custom interactive, hands-on exercises work
Describe the difference between the DML and the DDL statements
Introduction to the SELECT, INSERT, DELETE, and UPDATE statements
Simple use of the DDL statement :
CREATE DATABASE
CREATE TABLE
CREATE INDEX
ALTER TABLE
ALTER INDEX
DROP DATABASE,
DROP TABLE
DROP INDEX
The resources for this section are included in the last lecture of this section (Lecture 16)
Become familiar with how database tables are organized
Relationships, rows, columns, entity, cells
Primary Keys: single and composite, unique keys
Indexes
Learn the concepts of how to create relationships between tables
Primary Keys and Foreign Keys
Types of relationships:
One-to-Many
One-to-One
Many-to-Many
Learn how to define columns for a table:
Data types
Nullability
Default values
identity columns etc
Learn about the four main Action Queries: SELECT, INSERT, UPDATE, DELETE
Introduction to the most common DDL Statement CREATE DATABASE, CREATE TABLE DROM TABLE etc.
Examples of some DDL statements
The syntax of the DROP INDEX statement
The syntax of the DROP TABLE statement
The syntax of the CREATE TABLE statement
The syntax of the CREATE DATABASE statement
Write a SELECT table against a single table:
Select data set from a single table
Create a calculated column
Learn the order of FROM, WHERE and the ORDER BY clauses
A SELECT statement that joins data from two tables with an INNER JOIN
INNER JOIN vs. OUTER JOIN discussed
A practical example of how to use the INNER JOIN
A demonstration of the ACTION queries (INSERT, DELETE, and UPDATE) statements to modify the records in a table
Demonstration of the WHERE clause to provide filter for the ACTION queries
Learn the standard guidelines and techniques to make your SQL codes readable and easily maintainable
Introduction to other database objects
Views (With examples)
Stored Procedures
Triggers
How to work with stored procedures, triggers, and user-defined functions (UDF)
Introduction to the SQL Server Management Studio (SSMS) graphical tool
You learn how to create, modify, or delete a table using the Management Studio interface
Use management studio to set basic properties of a table, such as identity columns, key columns
How to connect to a database server using either Windows or SQL Server authentication
Exploring the database objects
You learn to:
Explore the Management Studio and its windows
Explore the Object Browser and its onjects
Use the database diagram to illustrate the relationships between the tables in a database
The anatomy of the database diagram
Learn:
How to view the column definition of a table
How to modifying the column definition
Using the Management Studio to view and modify records in a table
Introduction to the Query Editor. Entering and executing queries. Using the IntelliSense feature
Open saved queries
Save your queries
The Available Database combo box
Learn how syntax errors appear in T-SQL queries, why switching databases resolves column resolution issues, and the common fixes like correcting column names, closing quotes, and selecting the proper database.
After you get your query working you may want to save it:
Saving and opening saved queries
Cut, copy, paste from one query to another
The anatomy of the Query Designer
Using the query designer to build simple queries
Modify queries build by the Query Designer
A look at the syntax of a simple SELECT statement specifying the WHERE filter clause and the ORDER BY clause
Become familiar with some of the benefits provided by views
A look at the five commonly used arithmetic operators in SELECT statements
The precedence of the arithmetic operators
The use of parentheses to simplify complex expressions
Using functions in column specifications in SELECT statements
LEFT()
CONVERT()
GETDATE() etc.
Use of the DISTINCT keyword in a SELECT statement to eliminate duplicate rows in result set
Using the TOP clause within a SELECT clause to limit the number of rows included in a result set
Including the PERCENT and the WITH TIES with the TOP clause
The row played by the ORDER BY clause when the TOP clause is used in a SELECT statement
The use of the WHERE clause as a filter condition
Using the AND, OR and NOT logical operators to create compound filter conditions
Use of the IN operator to test whether an expression is equal to a value in a list of expressions
Using the NOT operator with the IN operator
Compare the test expression to items in a list returned by a subquery
Using the BETWEEN operator to test whether an expression falls within a range of values
Using the NOT operator with the BETWEEN operator
The use of the LIKE operator to retrieve rows that match a string pattern (mask)
Wildcards
Performance issues associated with the LIKE operator
Using the IS NULL clause to test for null values
Using the ORDER BY clause to sort result set
Using expressions and column alias to sort result set
The syntax of the ORDER BY clause to retrieve a range of rows
Introduction to this section
Become familiar with the syntax of the INNER JOIN and how to use it in a SELECT statement
The syntax for an inner join that uses correlation names
Use of correlation names to simplify or clarify query
Coding compound join conditions
Coding join condition in the FROM clause versus coding in the WHERE clause
A self-join is a join where a table is joined to itself
Examples of self-join
Multi-table join explained; how they work
Examples
Working with outer joins (LEFT OUTER and RIGHT OUTER, FULL OUTER joins)
Use the OBJECT_ID function to test the the existence of a database object and take appropriate action
Looking at examples of outer join
Outer joins than join more than two tables
How to use cross joins
How to work with unions:
The syntax of a union
Unions that combine data from different tables
Create dynamic SQL scripts that accept parameters
Use the EXEC statement to execute dynamic queries
Demonstrate unions with examples
Looking at more examples of the UNION operator
Be able to use the EXCEPT and INTERSECT operators to work with two or more tables
Compare the EXCEPT and INTERSECT operators with the UNION operator
Become familiar with the syntax of the aggregate functions
Use aggregate functions in SELECT statement and the rules governing the use of aggregate functions
Use of aggregate functions in summary queries
Examples of aggregate functions
Using COUNT(*) and DISTINCT in aggregate functions
Become familiar with the syntax of the SELECT statement with the GROUP BY and HAVING clauses
Coding summary queries that use the GROUP BY and HAVING clauses
Queries that use the GROUP BY and HAVING clauses - Examples
Understanding the differences between search condition specified in the WHERE clause and search condition in the HAVING clause
Using the AND and OR logical operators to code complex search clauses
How to use the OVER clause
Applied
Code SELECT statements that require subqueries.
Code SELECT statements that use common table expressions (CTEs) to define the subqueries.
Knowledge
Describe the way subqueries can be used in the WHERE, HAVING, FROM and SELECT clauses of a SELECT statement.
Describe the difference between a correlated subquery and a noncorrelated subquery.
Describe the use of common table expressions (CTEs).
Become familiar with the four ways to introduce a subquery in a SELECT statement:
In a WHERE clause as a search condition
In a HAVING clause as a search condition
In a FROM clause as a table specification
In the SELECT clause as a column specification
Become familiar with when to use a subquery instead of a join.
Advantages of using a join
Advantages of using a subquery
How to use subqueries with the IN operator
A correlated subquery is a subquery that is executed once for each row processed by the outer query
Learn how to write correlated subqueries
Learn the syntax of the EXISTS operator demonstrated with examples
Although you will typically use subqueries in the WHERE or HAVING clause of a SELECT statement, you can also use them in the FROM and SELECT clauses
How to code subqueries in the FROM clause
Coding subqueries in the SELECT clause
Become familiar with the procedure to plan and test queries
Writing pseudocode for complex queries
A Common Table Expression (CTE) is a feature that allows you to code an expression that defines a derived table
Lean how to code a CTE
Using the SELECT INTO statement to create tables
Use the INSERT statement to insert rows into a table
Using INSERT with or without naming columns and handling identity columns properly
Examples of the INSERT INTO statement:
Insert statement that adds the new row without using a column list
Insert statement that adds the new row using a column list
Insert statement that adds multiple new rows
How to insert default values and null values
How to insert rows into a table where the rows are selected from a second table
Perform a basic update operation
How to use subqueries in an update operation
How to use joins to update records in a table
How to perform a basic delete operation
How to use subqueries and joins in a delete operation
How to merge rows:
Perform basic merge operation
Perform more complex merge operation
A column's data type specifies the kind of information the column is intended to store. In addition, a column's data type determines the operations that can be performed on the column
A thorough understanding of SQL data types
An understanding of the numeric data types:
bigint
int
smallint
tinyint
bit etc.
The string data types used to store standard characters
Converting from one data type to another
Implicit and explicit conversion
The CAST and CONVERT functions
How to convert data using the CAST function
How to convert data types using the CONVERT function
Using the TRY_CONVERT function to prevent conversion errors
An introduction to the most common functions used in SQL Server
Examples of string functions
Solve common problems that occur with string data
Use of the CAST function to sort by a string column that contains numbers
Use string functions to parse string
Use LEFT, RIGHT, SUBSTRING, and LEN to extract individual components from a string
In addition to the string functions, SQL Server provides several numeric functions
How to use numeric functions to solve common problem that occur when you work with numeric data
How to solve common problems that occur with numeric data
Search for approximate real values
Format real numbers
A summary of the date/time functions
Using the CASE function:
The syntax of the simple CASE function
The syntax of the searched CASE function
Examples of SELECT statement that uses a searched CASE function
The IIF and CHOOSE functions are known as logical functions
The syntaxes of the COALESCE and ISNULL functions
The use of the COALESCE and ISNULL functions to substitute null values
The basic steps for designing a database:
Identify the data elements
Subdivide each element and assign columns
Identify the tables and assign columns
Identify the primary and foreign keys
Review whether the data structure is normalized
Identify the indexes
A look at the database structure for this section
The basic steps for a database design
Identify the data elements on a table
Guidelines for subdividing data elements into components
The necessity to recombine subdivisions for reporting purposes
Grouping identified data elements by entities that will later become the tables of the database
Identify primary keys and foreign keys to establish relationships
Enforcing relationships between tables to enforce referential integrity
Normalizing the database tables
Identify columns to be indexed:
When the column is a foreign key
When the column is used frequently in search conditions or joins
When the column contains a large number of distinct values
When the column is updated frequently
How to apply the first three normal forms
Applying the first normal form to a table
Applying the second and the third normal forms
NOTE: SQL Server is a hands-on product. No matter how much videos you watch, to master SQL Server, you need to get your hands dirty. Our course is not for the casual SQL Server database user who just wants to know how to write simple SELECT queries to extract data for ad-hoc reports. This course is for someone who is keen to master SQL Server databases for a career, or for whom SQL Server is an integral part of day to day activities. This course will take you longer to complete than most SQL courses. The course is based on three separate databases:
(1) the Accounts Payable (AP) database that is the main database we use for the coding examples in the lectures,
(2) the AcotexCollege database that is used for the over 90 exercises (spread over the lectures) that you perform after each lecture in SQL Server Management Studio (SSMS), and
(3) The Hands-On database that is used for the interactive exercises that you can work through in either your SSMS or right within a custom program that we have provide for you to write and execute all your SQL scripts outside of SQL Server
In addition to the many hands on scripting exercises, we provide over 390 quizzes that cover all the topics we discuss in the course
YOU WILL NOT BENEFIT MUCH FROM THIS COURSE IF YOU DO NOT DO THE QUIZZES AND THE EXTENSIVE EXERCISES WE HAVE PROVIDED FOR EACH SECTION OF THE COURSE
======================================================================================================================
This course will teach you everything you need to know to master advanced SQL Server database development and querying features of this popular DBMS:
Master the concepts and terms you need for working with relational databases and SQL
Learn how to create a database using SQL statements and its tables using SQL statements or the Management Studio...valuable skill whether you are on the DBA track or not
How to use the Management Studio to work with databases
How to work with views, scripts, stored procedures, functions, table-value parameters, triggers, transactions, locking, and security
How to write SQL statements that retrieve and update the data in a database
How to work with inner and outer joins, summary queries, and subqueries...it's all here
COURSE STRUCTURE:
The course is video-based. We utilize PowerPoint presentation to explain concepts and use SQL Server Management Studio (SSMS) to provide coding examples and exercises. We expect you to follow the codes we explain to you in your own SSMS. The course is based on the Accounts Payable (AP) database
1. VIDEO:
Concepts are explained in a videos utilizing PowerPoint and SQL Server Management Studio (SSMS)
2. QUIZZES:
Each lesson comes with about 25 multiple choice quizzes. We suggest that you immediately repeat the lesson if you do not score at least 22 points before you move to the next lesson. Total of 390 quizzes for the course
3. HANDS-ON EXERCISES:
We provide two separate modes of hands-on exercises:
(1) Exercise mode one: Each lesson comes with an average of 6 hands-on exercises (total of 90 for the course). Exercises are in a word document. We expect you to download and print and work through the exercises in your SQL Server Management Studio. Solutions for these exercises are provided in sql scripts that you can download. The solutions are there as a last resort to help you perform the exercise only when you have tried but could not write the code
(2) Exercise mode two: We also provide an interactive, hands-on exercises (75 altogether) including Drag & Drop and sql scripting that you can perform in either SSMS or within a custom user-interface we have provided. If you opt to use the second method, you can write and execute all your sql scripts within the custom interface we have provided without ever opening your SQL Server instance. This is an innovative and convenient way to show how learning SQL Server querying can be fun. We provide buttons and other means to help you move through the exercises very easily. You can have instant solution (e.g. sql script) to an exercise at the click of a button.
4. SOLUTIONS TO EXERCISES
We provide SQL scripts (*.sql) that contain solutions for the first set of exercises. You can open the files in SSMS and view the solutions. The second set of exercises can be performed within the user interface program we provide (Excel VBA program). The exercises are displayed within ActiveX controls (textboxes) and you can code and execute you scripts (solutions) within the program. Navigational buttons are provided to help you move back and forth within the exercises. Solutions to exercises can be view by clicking a button
GOOD LUCK