From the course: PostgreSQL Essential Training

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Challenge: Add data constraints

Challenge: Add data constraints - PostgreSQL Tutorial

From the course: PostgreSQL Essential Training

Challenge: Add data constraints

(funky music) - [Narrator] We've seen a couple of ways that you can improve the design of your PostgreS data tables to help manage the data. Let's apply those lessons to the last challenge for the course. I'd like you to finish up the tables that you've previously added to the human resources schema in the Kinetico database. First, add an index to the employee's table on the last name column. That'll help speed up queries when searching employee records by their name. Next, create a default value that'll place all new employees in the training department. And finally, add a check constraint to ensure that all new employees are hired after January 1st, 2023. I estimate that those three tasks should take less than 10 minutes to complete, good luck.

Contents