Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIM_Customers #6

Open
Marina-ai-hub opened this issue Sep 9, 2024 · 0 comments
Open

DIM_Customers #6

Marina-ai-hub opened this issue Sep 9, 2024 · 0 comments

Comments

@Marina-ai-hub
Copy link
Owner

DIM_Caustomers.csv

SQL Code:
-- Cleaned DIM_Customers Table --
SELECT
c.customerkey AS [CustomerKey]
-- ,[GeographyKey]
-- ,[CustomerAlternateKey]
-- ,[Title]
, c.firstname AS [FirstName]
-- ,[MiddleName]
, c.lastname AS [LastName]
, CONCAT( c.firstname, ' ', c.lastname) AS [Full Name],
-- ,[NameStyle]
-- ,[BirthDate]
-- ,[MaritalStatus]
-- ,[Suffix]
CASE c.gender WHEN 'M' THEN 'Male'
WHEN 'F' THEN 'Female' END AS Gender
-- ,[EmailAddress]
-- ,[YearlyIncome]
-- ,[TotalChildren]
-- ,[NumberChildrenAtHome]
-- ,[EnglishEducation]
-- ,[SpanishEducation]
-- ,[FrenchEducation]
-- ,[EnglishOccupation]
-- ,[SpanishOccupation]
-- ,[FrenchOccupation]
-- ,[HouseOwnerFlag]
-- ,[NumberCarsOwned]
-- ,[AddressLine1]
-- ,[AddressLine2]
-- ,[Phone]
, c.datefirstpurchase AS DateFirstPurchase
-- ,[CommuteDistance]
-- g.city AS [Customer City]
FROM dbo.dimcustomer AS c
-- LEFT JOIN dbo.dimgeography AS g
-- ON g.geographykey = c.geographykey
ORDER BY CustomerKey ASC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant