YSQL Exercises:
Dates and timestamps
YSQLE05
An introduction to writing queries with dates and times.
Level: Beginner
Dates and Times in YSQL can be a complex topic. They're also fantastically powerful, making it easier to work with variable-length periods such as "months". This mini-course introduces some of the ways that you can operate on and manipulate time and date data in your YSQL queries using various operators and built-in functions.
The course format is a series of exercises. Β Each exercise is about 5 minutes. To help you along, each exercise includes a hint and a detailed solution.
Wanted: Architects, Developers, Administrators, and Business Leaders
What you'll need
Operating System:
macOS 10+, Ubuntu 16+, or Windows 10+
Chromium web browser:
Chrome, Opera, or Microsoft Edge
YugabyteDB Managed free cluster
YugabyteDB Community Slack account
Duration 55 minutes
π Welcome!
πͺ Get Started with YugabyteDB Managed
π§ͺ [LAB]: Create a Yugabyte Cloud Free cluster
π [LAB]: Create the ysql_exercises database
π€ΈπΏββοΈ Produce a timestamp for 1 a.m. on the 31st of March 2022
π€Έ Subtract timestamps from each other
π€Έπ»ββοΈ Generate a list of all the dates in March 2022
π€Έπ»ββοΈ Get the day of the month from a timestamp
π€Έπ½ββοΈ Determine number of seconds between timestamps
π€Έπ½ββοΈ Determine the number of days in each month of 2012
π€Έπ»ββοΈ Determine the number of days remaining in the month
π€Έπ½ Determine the end time of bookings
π€ΈπΌββοΈ Return a count of bookings for each month
π€Έπ»ββοΈ Determine the utilization percentage for each facility by month
π Additional reading
π§° Your YugabyteDB skill on LinkedIn
π Learning Path Tracker
Practitioner:
YSQL Exercises - Dates and timestamps
Yugabyte University courses are FREE, so enroll today!
Yes, you do!
This is a self-paced course! You can start, stop, pause, resume, and replay whenever you feel like it.
Using the Course Player, for example, you can watch learning videos whenever you want.
This course doesn't have any on-demand labs for hands-on exercises, but for our courses that do have labs, they are available when you want as well!
For this course, do I need to purchases a YugabyteDB software license?
You do not need to purchase a YugabyteDB software license for this course. YugabyteDB is open source software.
You can sign up for YugabyteDB Managed free cluster without a credit card or payment method.
Do I need to sign up for a YugabyteDB Managed free cluster?
What an interesting idea!
Most of our courses require a YugabyteDB cluster, so an on-demand YugabyteDB Managed free cluster is a great option.
If a course requires a YugabyteDB cluster, the course will provide two options:
(1) a lab provides instructions for how to sign up for a YugabyteDB Managed free cluster, or...
(2) an on-demand, lab environment that includes a YugabyteDB cluster.
A big THANK YOU from the team at Yugabyte University!
If you complete all of the courses in the learning path, you will automatically receive proof of completion and join a special group of students.
If you get stuck, help is a literally a click away. In the Course Player header bar, select Discussions and post a question, concern, or even suggestion.
We also have a #training channel on YugabyteDB Community Slack.
In the Course Player, you always find instructions on how to get help in the Help lesson.
After completing this course, you will have the opportunity to review it!
We highly value your feedback and suggestions. Your review and rating helps pay it forward for our future students.
Yes, you can. Simply enroll and start right away. It's free and fun! For this learning path, there are seven courses with a suggested order. You can enroll in any course you want.
YSQL Exercises: Learn by doing!