Help creating a prompt to create a Data Model

Can someone help create a prompt that will help me create an Entity Relationship Diagram.

The following is the requirement and the prompt I would like to be created for:

Create an Entity Relationship Diagram for a credit card company. Base your design on the following business rules:

• The credit card company manages several different credit card brands, e.g. a credit card branded as “Lifestyle credit card” and another credit cards branded as “Black Business credit card”. “Cashback Rewards Card”, etc.
• Each credit card customer can have one or more credit cards from the same or different brands.
• Each credit card customer has a credit card account.
• Credit cards are issued to customers as physical plastic cards which have a card number and an expiry date.
• When credit cards reach their expiry date, replacement credit cards are issued.
• Secondary card holders (e.g. for a spouse of the main account holder) can also be issued a credit card on the same account. There can be several secondary card holders.
• Customers may use their credit cards to purchase goods and services (i.e. generate purchase transactions).
• The credit card company issues monthly statements to the credit card customers if at least one transaction has been made or there is an outstanding balance. The statement shows purchase transactions; payments the customer has made, and the outstanding balance.
• Purchase transactions made by the credit card holder are associated with retailers where the purchase took place.
• The credit card customers may telephone the credit card company customer services team for assistance. These interactions are logged.

Include the following on your diagram:

• The main entities and relationships
• Primary and foreign keys, relationship cardinality, and relationship optionality
• Aim for at least 2 attributes per entity. These can be extrapolated where none are specified above

2 Likes

Hi @carlton !

I don’t have much knowledge with ER models/diagrams as such, but I have done work in the past to use GPT-4 to extract knowledge graphs.

I would first recommend that you specify a more formal schema that the LLM should follow, in your prompt. The schema could be an SQL-like definition of columns and types, or whatever is ER equivalent or best practice. So in my graph extraction, I would opt for RDF triples and state explicitly that we require:

(<subject>, <predicate>, <object>) triple.

Then what I would do is give at least one example. So going back to RDF triples, I would specify an example such as

Input: "Bob is married to Alice"
Output: (<Bob>, <marriedTo>, <Alice>)

I would also define some predicate example, e.g. “marriedTo”, “bornIn”, “worksAt”, etc.

2 Likes

Hi platypus,

Thanks for reaching out.
I’m very new to chatGPT, I just thought I could get some help creating a prompt that would accomplish what I set out in my request?