Skip to main content
HomeSQL

Course

Writing Functions and Stored Procedures in SQL Server

IntermediateSkill Level
4.8+
329 reviews
Updated 11/2024
Master SQL Server programming by learning to create, update, and execute functions and stored procedures.
Start Course for Free
SQLProgramming4 hr16 videos57 Exercises4,700 XP27,156Statement of Accomplishment

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Loved by learners at thousands of companies

Group

Training 2 or more people?

Try DataCamp for Business

Course Description

Take your SQL Server programming to the next level. First, we demystify how to manipulate datetime data by performing temporal exploratory data analysis with the Washington DC BikeShare transactional dataset. Then, you’ll master how to create, update, and execute user-defined functions and stored procedures. You will learn the proper context for each modular programming tool and best practices. In the final chapter, you will apply all of your new skills to solve a real-world business case identifying the New York City yellow taxi utilization for each borough, and which pickup locations should be scheduled for each driver shift.

Prerequisites

Functions for Manipulating Data in SQL Server
1

Temporal EDA, Variables & Date Manipulation

Learn how to do effective exploratory data analysis on temporal data, create scalar and table variables to store data, and learn how to execute date manipulation. This chapter will also cover the following SQL functions: DATEDIFF( ), DATENAME( ), DATEPART( ), CAST( ), CONVERT( ), GETDATE( ), and DATEADD( ).
Start Chapter
2

User Defined Functions

3

Stored Procedures

4

NYC Taxi Ride Case Study

Apply your new skills in temporal EDA, user-defined functions, and stored procedures to solve a business case problem. Analyze the New York City taxi ride dataset to identify average fare per distance, ride count, and total ride time for each borough on each day of the week. And which pickup locations within the borough should be scheduled for each driver shift?
Start Chapter
Writing Functions and Stored Procedures in SQL Server
Course
Complete

Earn Statement of Accomplishment

Add this credential to your LinkedIn profile, resume, or CV
Share it on social media and in your performance review
Enroll Now

Don’t just take our word for it

*4.8
from 329 reviews
88%
10%
2%
0%
0%
  • Lauri
    2 days ago

  • Curtis
    4 days ago

    .

  • Szilárd
    last week

  • Kalvin Pierce
    last week

  • Felix
    last week

  • Alexander
    2 weeks ago

    Really good course, would like to see this plus others in a track.

Lauri

Szilárd

Kalvin Pierce

FAQs

What is the difference between user-defined functions and stored procedures in SQL Server?

The course explains both tools in depth. UDFs return values and are used in queries, while stored procedures perform actions and can include complex logic. Chapter 3 compares appropriate scenarios for each.

What real-world datasets are used in this course?

You work with the Washington DC BikeShare transactional dataset for temporal analysis and the New York City yellow taxi dataset for a final case study on taxi utilization by borough.

Which types of user-defined functions will I learn to create?

Chapter 2 covers scalar functions, inline table-valued functions, and multi-statement table-valued functions. You learn when to use each type and associated best practices.

What SQL date and time functions does the course cover?

Chapter 1 covers DATEDIFF, DATENAME, DATEPART, CAST, CONVERT, GETDATE, and DATEADD. You apply these to perform temporal exploratory data analysis on bike-sharing data.

What business problem does the NYC taxi case study solve?

You identify average fare per distance, ride count, and total ride time for each borough by day of the week, then determine which pickup locations should be assigned to each driver shift.

Join over 19 million learners and start Writing Functions and Stored Procedures in SQL Server today!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Grow your data skills with DataCamp for Mobile

Make progress on the go with our mobile courses and daily 5-minute coding challenges.