MENU

Fun & Interesting

SQL Interview Question 2025 | Split Fullname into FirstName and LastName excluding MiddleName

Skill Techath0n 1,263 lượt xem 2 months ago
Video Not Working? Fix It Now

In this video, I have discussed how to solve the SQL Interview Questions:
Write a SQL query to split a full name column into first name and last name. Assume the names are separated by a single space.

-- Query to create Table Persons
CREATE TABLE persons (
id SERIAL PRIMARY KEY,
full_name VARCHAR(100)
);

-- Insert data
INSERT INTO persons (full_name) VALUES
('John Doe'),
('Emma Watson'),
('Emily Rose Pattrick'),
('Robert Downey'),
('Chris Evans'),
('Scarlett Johansson');

SQL Interview QnAs: https://www.youtube.com/playlist?list=PLL871c9yfLoimvglCSz6UQoqLJcFBJGKo

#sql #postgresql #deloitte #deloittejobs #mysql #interview #dataengineering #dataanalytics #dataanalysis #capgemini #deloitte #deloittejobs #capgeminihiring #kpmg

Comment