Skip to content

Instantly share code, notes, and snippets.

@lubaochuan
Created May 7, 2020 12:23
Show Gist options
  • Save lubaochuan/2aba7490b50a1f0873c68ae4ad7a4d33 to your computer and use it in GitHub Desktop.
Save lubaochuan/2aba7490b50a1f0873c68ae4ad7a4d33 to your computer and use it in GitHub Desktop.
<!DOCTYPE BankData [
<!ELEMENT BankData (Customer•, Account•)>
<!ELEMENT Customer (Name, SSN, Phone+)>
<!ATTLIST Customer
customerID ID #REQUIRED
owns IDREFS #IMPLIED
>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT SSN (#PCDATA)>
<!ELEMENT Phone (#PCDATA)>
<!ELEMENT Account (Type, Balance)>
<!ATTLIST Account
accountID ID #REQUIRED
ownedBy IDREFS #IMPLIED
>
<!ELEMENT Type (#PCDATA)>
<!ELEMENT Balance (#PCDATA)>
]>
alternatively we can model Type as an attribute of Account,
then we can make it an enumerated type.
<!ATTLIST Account type (checking|saving) #REQUIRED>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment