From the course: SQL Practice: Intermediate Queries

Unlock this course with a free trial

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

Solution: Vendor integration

Solution: Vendor integration - SQL Tutorial

From the course: SQL Practice: Intermediate Queries

Solution: Vendor integration

- [Instructor] To solve this challenge, we'll focus on string manipulation. My solution returns some values from the employee's table, ordered by name. Without a where condition we'll get all the records and that's what we want. The first item in the challenge asked for a strictly five digit employee ID, with leading zeros to fill empty spaces at the beginning of the string. To create this, I used the LPAD or left pad function, which takes three arguments, the field to include, the number of digits to pad to, and the digit or character to use for that padding. I'll call this ID. The next item in the challenge is to provide the employee names in the format last comma first with a space in the middle. So I use the concat or concatenation function to return one string made out of the last name value, a string value comma space, and the first name value, and I'll call this name. Third, I need to generate usernames that…

Contents