fbpx

33. Splitting Text into Multiple Columns

This advanced SQL exercise is part of the book: Advanced SQL – Practical Techniques and Use-Cases, which includes 100 day-to-day SQL challenges (and solutions), need-to-know advanced features, and key concepts.
 

Given a table that contains the full names of various users (first name, middle name, and last name).
There are cases where users don’t have a middle name – in these cases, the table contains only the first and last name of such users. There are also cases where users don’t have a middle name and/or last name – in these cases, the table contains only the first name of such users.


CREATE TABLE users
(userID int identity(1,1),
username varchar(25))
GO

To read more

UpScale Analytics is one of the largest platforms in the world for learning SQL by doing, consisting over 300 SQL exercises at different levels (including solutions), by topics, across over 100 different datasets. More…