Concatenating First and Last Names
Welcome to this SQL lab where you'll be working with the popular chinook
database. The chinook database contains several tables that simulate a digital media store, including tables for artists, albums, media tracks, invoices, and customers.
Your task is to solve a series of challenges that test your SQL skills, specifically using the SQLite syntax.
Database Schema:
Here's a quick reminder of some of the tables and their columns:
-
Artist
"ArtistId"
"Name"
-
Album
"AlbumId"
"Title"
"ArtistId"
-
Track
"TrackId"
"Name"
"AlbumId"
Remember, always use double quotes for table names and column names to avoid potential conflicts with SQLite reserved keywords.
Challenges:
You'll find challenges that will ask you to extract, manipulate, and aggregate data from these tables. Here's a hint on what you might expect:
Table Used: Customer
Objective: Your task is to generate a list where you combine the first name and last name of customers to create a full name.
Details:
-
Columns to Return:
CustomerId
FullName
(a concatenated version ofFirstName
andLastName
)
-
Ordering: The results should be ordered by
CustomerId
in ascending order.
Hint: You might need to use a string concatenation function to achieve the desired output. Ensure you use double quotes for column and table names. Your final columns in the query should be CustomerId
and FullName
.