Advertisement
anchormodeling

The Intelligent Lake

Apr 15th, 2023 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | Software | 0 0
  1. I will describe a business using its data model. After that I will paste some data found in a system that I would like you to explain how it fits into the model.
  2.  
  3. DATA MODEL:
  4. Customer - The business has many customers, all of them individuals. Customers have most of the common attributes that you would expect.
  5. Product - The business has many products they sell over the counter to different customers. One important attribute of a product is its price, which also may change over time.
  6. Purchase - This represents the event when a customer buys a product from the business. It has an attribute indicating the time of purchase.
  7. Purchase_Customer_Product - This relationship binds together three entities, so that it is possible to tell which customer bought what and when.
  8.  
  9. Do you understand so far?
  10. -------------------------------
  11. -- https://media.githubusercontent.com/media/datablist/sample-csv-files/main/files/customers/customers-100.csv
  12. -------------------------------
  13. Index,Customer Id,First Name,Last Name,Company,City,Country,Phone 1,Phone 2,Email,Subscription Date,Website
  14. 1,DD37Cf93aecA6Dc,Sheryl,Baxter,Rasmussen Group,East Leonard,Chile,229.077.5154,397.884.0519x718,zunigavanessa@smith.info,2020-08-24,http://www.stephenson.com/
  15. 2,1Ef7b82A4CAAD10,Preston,Lozano,Vega-Gentry,East Jimmychester,Djibouti,5153435776,686-620-1820x944,vmata@colon.com,2021-04-23,http://www.hobbs.com/
  16. 3,6F94879bDAfE5a6,Roy,Berry,Murillo-Perry,Isabelborough,Antigua and Barbuda,+1-539-402-0259,(496)978-3969x58947,beckycarr@hogan.com,2020-03-25,http://www.lawrence.com/
  17. 4,5Cef8BFA16c5e3c,Linda,Olsen,"Dominguez, Mcmillan and Donovan",Bensonview,Dominican Republic,001-808-617-6467x12895,+1-813-324-8756,stanleyblackwell@benson.org,2020-06-02,http://www.good-lyons.com/
  18. 5,053d585Ab6b3159,Joanna,Bender,"Martin, Lang and Andrade",West Priscilla,Slovakia (Slovak Republic),001-234-203-0635x76146,001-199-446-3860x3486,colinalvarado@miles.net,2021-04-17,https://goodwin-ingram.com/
  19. 6,2d08FB17EE273F4,Aimee,Downs,Steele Group,Chavezborough,Bosnia and Herzegovina,(283)437-3886x88321,999-728-1637,louis27@gilbert.com,2020-02-25,http://www.berger.net/
  20. 7,EA4d384DfDbBf77,Darren,Peck,"Lester, Woodard and Mitchell",Lake Ana,Pitcairn Islands,(496)452-6181x3291,+1-247-266-0963x4995,tgates@cantrell.com,2021-08-24,https://www.le.com/
  21. 8,0e04AFde9f225dE,Brett,Mullen,"Sanford, Davenport and Giles",Kimport,Bulgaria,001-583-352-7197x297,001-333-145-0369,asnow@colon.com,2021-04-12,https://hammond-ramsey.com/
  22. 9,C2dE4dEEc489ae0,Sheryl,Meyers,Browning-Simon,Robersonstad,Cyprus,854-138-4911x5772,+1-448-910-2276x729,mariokhan@ryan-pope.org,2020-01-13,https://www.bullock.net/
  23. 10,8C2811a503C7c5a,Michelle,Gallagher,Beck-Hendrix,Elaineberg,Timor-Leste,739.218.2516x459,001-054-401-0347x617,mdyer@escobar.net,2021-11-08,https://arias.com/
  24. -------------------------------
  25. Can you produce the DDL code for SQL Server that creates a Customer table based on that sample?
  26. -------------------------------
  27. Thanks, now assume that I will get data like the sample in a CSV file. Can you write code that loads that data into that table?
  28. -------------------------------
  29. Thanks, but I do not want anything that invoves mouse clicking. Can you do it using code only, perhaps with BULK INSERT?
  30. -------------------------------
  31. Why do you think I do not want anything that involves mouse clicks?
  32. -------------------------------
  33. Assume that we have loaded that data into the table. Can you tell me how many of my customers I can contact through email?
  34. -------------------------------
  35.  
Tags: ai
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement