Skip to content

Instantly share code, notes, and snippets.

@shaneis
Created April 11, 2023 21:26
Show Gist options
  • Save shaneis/4fe1308b40bcc5babdba091b4a5295de to your computer and use it in GitHub Desktop.
Save shaneis/4fe1308b40bcc5babdba091b4a5295de to your computer and use it in GitHub Desktop.
Create table and query the results for wordle answers
/* Create table */
IF NOT EXISTS
(
SELECT *
FROM [sys].[tables] AS [t]
JOIN [sys].[schemas] AS [s]
ON [t].[schema_id] = [s].[schema_id]
WHERE
[t].[name] = N'WordleAnswers'
AND [s].[name] = N'dbo'
)
BEGIN
CREATE TABLE [dbo].[WordleAnswers]
(
[wordle_answers] char(5) NOT NULL
CONSTRAINT PK_WordleAnswers PRIMARY KEY
);
PRINT N'Table created';
END;
ELSE
BEGIN
PRINT N'Table already exists';
END;
SELECT
*
FROM [dbo].[WordleAnswers] AS [w];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment