<?xml version="1.0" encoding="UTF-8"?>
<database name="library" type="MySQL - 5.0.18-nt">
   <tables>
      <table name="address" remarks="Address details; InnoDB free: 3072 kB" type="TABLE">
         <column autoUpdated="true" digits="0" id="0" name="addressId" nullable="false" remarks="" size="11" type="int">
            <child column="address" foreignKey="borrower_ibfk_1" implied="false" onDeleteCascade="false" table="borrower"/>
            <child column="address" foreignKey="library_branch_ibfk_1" implied="false" onDeleteCascade="false" table="library_branch"/>
            <child column="address" foreignKey="publisher_ibfk_1" implied="false" onDeleteCascade="false" table="publisher"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="1" name="address1" nullable="false" remarks="Address line 1" size="50" type="varchar"/>
         <column autoUpdated="false" digits="0" id="2" name="address2" nullable="true" remarks="Address line 2 (optional)" size="50" type="varchar"/>
         <column autoUpdated="false" defaultValue="" digits="0" id="3" name="city" nullable="false" remarks="" size="30" type="varchar"/>
         <column autoUpdated="false" defaultValue="" digits="0" id="4" name="state" nullable="false" remarks="" size="2" type="char"/>
         <column autoUpdated="false" defaultValue="" digits="0" id="5" name="zip" nullable="false" remarks="Dash req'd for zip+4" size="10" type="varchar"/>
         <primaryKey column="addressId" sequenceNumberInPK="1"/>
         <index name="PRIMARY" unique="true">
            <column ascending="true" name="addressId"/>
         </index>
      </table>
      <table name="author" remarks="Comments w/&lt;a href='schemaspy.sourceforge.net'&gt;links&lt;/a&gt;; InnoDB free: 3072 kB" type="TABLE">
         <column autoUpdated="true" digits="0" id="0" name="authorId" nullable="false" remarks="" size="11" type="int">
            <child column="authorId" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" table="book_author"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="1" name="firstName" nullable="false" remarks="" size="32" type="varchar"/>
         <column autoUpdated="false" digits="0" id="2" name="middleName" nullable="true" remarks="" size="32" type="varchar"/>
         <column autoUpdated="false" defaultValue="" digits="0" id="3" name="lastName" nullable="false" remarks="" size="32" type="varchar"/>
         <primaryKey column="authorId" sequenceNumberInPK="1"/>
         <index name="PRIMARY" unique="true">
            <column ascending="true" name="authorId"/>
         </index>
         <index name="lastName" unique="false">
            <column ascending="true" name="lastName"/>
         </index>
      </table>
      <table name="book" remarks="InnoDB free: 3072 kB; (`publisherId`) REFER `library/publisher`(`publisherId`)" type="TABLE">
         <column autoUpdated="false" defaultValue="0" digits="0" id="0" name="isbn" nullable="false" remarks="" size="20" type="bigint">
            <child column="isbn" foreignKey="book_author_ibfk_1" implied="false" onDeleteCascade="false" table="book_author"/>
            <child column="isbn" foreignKey="book_location_ibfk_1" implied="false" onDeleteCascade="false" table="book_location"/>
            <child column="isbn" foreignKey="borrowed_book_ibfk_1" implied="false" onDeleteCascade="false" table="borrowed_book"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="1" name="title" nullable="false" remarks="" size="64" type="varchar"/>
         <column autoUpdated="true" digits="0" id="2" name="publisherId" nullable="false" remarks="" size="11" type="int">
            <parent column="publisherId" foreignKey="book_ibfk_1" implied="false" onDeleteCascade="false" table="publisher"/>
         </column>
         <primaryKey column="isbn" sequenceNumberInPK="1"/>
         <index name="PRIMARY" unique="true">
            <column ascending="true" name="isbn"/>
         </index>
         <index name="publisherId" unique="false">
            <column ascending="true" name="publisherId"/>
         </index>
         <index name="title" unique="false">
            <column ascending="true" name="title"/>
         </index>
      </table>
      <table name="book_author" remarks="InnoDB free: 3072 kB; (`isbn`) REFER `library/book`(`isbn`)" type="TABLE">
         <column autoUpdated="false" defaultValue="0" digits="0" id="0" name="isbn" nullable="false" remarks="" size="20" type="bigint">
            <parent column="isbn" foreignKey="book_author_ibfk_1" implied="false" onDeleteCascade="false" table="book"/>
         </column>
         <column autoUpdated="false" defaultValue="0" digits="0" id="1" name="authorId" nullable="false" remarks="FK intentionally omitted to show an implied relationship" size="11" type="int">
            <parent column="authorId" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" table="author"/>
         </column>
         <primaryKey column="authorId" sequenceNumberInPK="1"/>
         <primaryKey column="isbn" sequenceNumberInPK="2"/>
         <index name="PRIMARY" unique="true">
            <column ascending="true" name="isbn"/>
            <column ascending="true" name="authorId"/>
         </index>
      </table>
      <table name="book_location" remarks="InnoDB free: 3072 kB; (`isbn`) REFER `library/book`(`isbn`); (`branchId`) REFER" type="TABLE">
         <column autoUpdated="false" defaultValue="0" digits="0" id="0" name="isbn" nullable="false" remarks="" size="20" type="bigint">
            <parent column="isbn" foreignKey="book_location_ibfk_1" implied="false" onDeleteCascade="false" table="book"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="1" name="branchId" nullable="false" remarks="" size="11" type="int">
            <parent column="branchId" foreignKey="book_location_ibfk_2" implied="false" onDeleteCascade="false" table="library_branch"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="2" name="numCopies" nullable="false" remarks="" size="11" type="int"/>
         <primaryKey column="branchId" sequenceNumberInPK="1"/>
         <primaryKey column="isbn" sequenceNumberInPK="2"/>
         <index name="PRIMARY" unique="true">
            <column ascending="true" name="isbn"/>
            <column ascending="true" name="branchId"/>
         </index>
         <index name="branchId" unique="false">
            <column ascending="true" name="branchId"/>
         </index>
      </table>
      <table name="borrowed_book" remarks="InnoDB free: 3072 kB; (`isbn`) REFER `library/book`(`isbn`); (`branchId`) REFER" type="TABLE">
         <column autoUpdated="false" defaultValue="0" digits="0" id="0" name="isbn" nullable="false" remarks="" size="20" type="bigint">
            <parent column="isbn" foreignKey="borrowed_book_ibfk_1" implied="false" onDeleteCascade="false" table="book"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="1" name="branchId" nullable="false" remarks="" size="11" type="int">
            <parent column="branchId" foreignKey="borrowed_book_ibfk_2" implied="false" onDeleteCascade="false" table="library_branch"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="2" name="cardNo" nullable="false" remarks="" size="11" type="int">
            <parent column="cardNo" foreignKey="borrowed_book_ibfk_3" implied="false" onDeleteCascade="false" table="borrower"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="3" name="borrowDate" nullable="false" remarks="" size="10" type="date"/>
         <column autoUpdated="false" defaultValue="" digits="0" id="4" name="dueDate" nullable="false" remarks="" size="10" type="date"/>
         <primaryKey column="branchId" sequenceNumberInPK="1"/>
         <primaryKey column="cardNo" sequenceNumberInPK="2"/>
         <primaryKey column="isbn" sequenceNumberInPK="3"/>
         <index name="PRIMARY" unique="true">
            <column ascending="true" name="isbn"/>
            <column ascending="true" name="branchId"/>
            <column ascending="true" name="cardNo"/>
         </index>
         <index name="branchId" unique="false">
            <column ascending="true" name="branchId"/>
         </index>
         <index name="cardNo" unique="false">
            <column ascending="true" name="cardNo"/>
         </index>
         <index name="dueDate" unique="false">
            <column ascending="true" name="dueDate"/>
         </index>
      </table>
      <table name="borrower" remarks="InnoDB free: 3072 kB; (`address`) REFER `library/address`(`addressId`)" type="TABLE">
         <column autoUpdated="true" digits="0" id="0" name="cardNo" nullable="false" remarks="" size="11" type="int">
            <child column="cardNo" foreignKey="borrowed_book_ibfk_3" implied="false" onDeleteCascade="false" table="borrowed_book"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="1" name="firstName" nullable="false" remarks="" size="32" type="varchar"/>
         <column autoUpdated="false" digits="0" id="2" name="middleName" nullable="true" remarks="" size="32" type="varchar"/>
         <column autoUpdated="false" defaultValue="" digits="0" id="3" name="lastName" nullable="false" remarks="" size="32" type="varchar"/>
         <column autoUpdated="false" digits="0" id="4" name="address" nullable="true" remarks="" size="11" type="int">
            <parent column="addressId" foreignKey="borrower_ibfk_1" implied="false" onDeleteCascade="false" table="address"/>
         </column>
         <column autoUpdated="false" digits="0" id="5" name="phone" nullable="true" remarks="" size="16" type="varchar"/>
         <primaryKey column="cardNo" sequenceNumberInPK="1"/>
         <index name="PRIMARY" unique="true">
            <column ascending="true" name="cardNo"/>
         </index>
         <index name="address" unique="false">
            <column ascending="true" name="address"/>
         </index>
         <index name="lastName" unique="false">
            <column ascending="true" name="lastName"/>
            <column ascending="true" name="firstName"/>
         </index>
      </table>
      <table name="library_branch" remarks="InnoDB free: 3072 kB; (`address`) REFER `library/address`(`addressId`)" type="TABLE">
         <column autoUpdated="true" digits="0" id="0" name="branchId" nullable="false" remarks="" size="11" type="int">
            <child column="branchId" foreignKey="book_location_ibfk_2" implied="false" onDeleteCascade="false" table="book_location"/>
            <child column="branchId" foreignKey="borrowed_book_ibfk_2" implied="false" onDeleteCascade="false" table="borrowed_book"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="1" name="name" nullable="false" remarks="" size="64" type="varchar"/>
         <column autoUpdated="false" defaultValue="" digits="0" id="2" name="address" nullable="false" remarks="" size="11" type="int">
            <parent column="addressId" foreignKey="library_branch_ibfk_1" implied="false" onDeleteCascade="false" table="address"/>
         </column>
         <primaryKey column="branchId" sequenceNumberInPK="1"/>
         <index name="PRIMARY" unique="true">
            <column ascending="true" name="branchId"/>
         </index>
         <index name="address" unique="false">
            <column ascending="true" name="address"/>
         </index>
      </table>
      <table name="publisher" remarks="&lt;a href=&quot;foo.html&quot;&gt;foo&lt;/a&gt;; InnoDB free: 3072 kB; (`address`) REFER `library/add" type="TABLE">
         <column autoUpdated="true" digits="0" id="0" name="publisherId" nullable="false" remarks="" size="11" type="int">
            <child column="publisherId" foreignKey="book_ibfk_1" implied="false" onDeleteCascade="false" table="book"/>
         </column>
         <column autoUpdated="false" defaultValue="" digits="0" id="1" name="name" nullable="false" remarks="" size="64" type="varchar"/>
         <column autoUpdated="false" digits="0" id="2" name="address" nullable="true" remarks="" size="11" type="int">
            <parent column="addressId" foreignKey="publisher_ibfk_1" implied="false" onDeleteCascade="false" table="address"/>
         </column>
         <column autoUpdated="false" digits="0" id="3" name="phone" nullable="true" remarks="" size="16" type="varchar"/>
         <primaryKey column="publisherId" sequenceNumberInPK="1"/>
         <index name="PRIMARY" unique="true">
            <column ascending="true" name="publisherId"/>
         </index>
         <index name="address" unique="false">
            <column ascending="true" name="address"/>
         </index>
         <index name="name" unique="false">
            <column ascending="true" name="name"/>
         </index>
      </table>
   </tables>
</database>
