TSQL Challenge 17 - Basic Testing



Here is the data used for the basic testing of TSQL Challenge 17

Source Data

/*
id   keyword              data
---- -------------------- -----------------------------------
1    Pet Store            Microsoft SQL Server
2    SQL Server Database  Dinner at a New York Restaurant
3    Restaurant           Welcome to TSQL Challenges 17
4    New York             Bob is a Database Expert
5    TSQL Challenges      Is Microsoft Listening?
6    Microsoft            New Challenges are coming up
*/

Expected Output

/*
id   keyword              data
---- -------------------- -----------------------------------------
1    Pet Store            Microsoft SQL 
						  Server
2    SQL Server Database  Dinner at a New 
						  York Restaurant
						  
3    Restaurant           Welcome to TSQL 
						  Challenges 17
4    New York             Bob is a Database Expert
5    TSQL Challenges      Is Microsoft 
						  Listening?
6    Microsoft            New Challenges are coming up
*/


Note: Line wraps used in the column "data" is only for the purpose of formatting.

Here is the script to generate the source table.

DECLARE @t TABLE(
	id TINYINT, 
	keyword VARCHAR(20), 
	data VARCHAR(35)
)

INSERT INTO @t(id, keyword, data)
SELECT 1, 'Pet Store', 'Microsoft SQL Server' 
UNION ALL
SELECT 2, 'SQL Server Database', 'Dinner at a New York Restaurant'
UNION ALL
SELECT 3, 'Restaurant', 'Welcome to TSQL Challenges 17'
UNION ALL
SELECT 4, 'New York', 'Bob is a Database Expert'
UNION ALL
SELECT 5, 'TSQL Challenges', 'Is Microsoft Listening?'
UNION ALL
SELECT 6, 'Microsoft', 'New Challenges are coming up'

SELECT * FROM @t