These tables hold the data that describe the library's individual borrowers.
The primary table for holding borrower data is the borrowers table:
DESCRIBE borrowers; +------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------+----------------+ | borrowernumber | int(11) | | MUL | NULL | auto_increment | | cardnumber | varchar(16) | | PRI | | | | surname | text | | | | | | firstname | text | | | | | | title | text | YES | | NULL | | | othernames | text | YES | | NULL | | | initials | text | | | | | | streetaddress | text | | | | | | suburb | text | YES | | NULL | | | city | text | | | | | | phone | text | | | | | | emailaddress | text | YES | | NULL | | | faxnumber | text | YES | | NULL | | | textmessaging | text | YES | | NULL | | | altstreetaddress | text | YES | | NULL | | | altsuburb | text | YES | | NULL | | | altcity | text | YES | | NULL | | | altphone | text | YES | | NULL | | | dateofbirth | date | YES | | NULL | | | branchcode | varchar(4) | | | | | | categorycode | char(2) | YES | | NULL | | | dateenrolled | date | YES | | NULL | | | gonenoaddress | tinyint(1) | YES | | NULL | | | lost | tinyint(1) | YES | | NULL | | | debarred | tinyint(1) | YES | | NULL | | | studentnumber | text | YES | | NULL | | | school | text | YES | | NULL | | | contactname | text | YES | | NULL | | | borrowernotes | text | YES | | NULL | | | guarantor | int(11) | YES | | NULL | | | area | char(2) | YES | | NULL | | | ethnicity | varchar(50) | YES | | NULL | | | ethnotes | varchar(255) | YES | | NULL | | | sex | char(1) | YES | | NULL | | | expiry | date | YES | | NULL | | | altnotes | varchar(255) | YES | | NULL | | | altrelationship | varchar(100) | YES | | NULL | | | streetcity | text | YES | | NULL | | | phoneday | varchar(50) | YES | | NULL | | | preferredcont | char(1) | YES | | NULL | | | physstreet | varchar(100) | YES | | NULL | | | password | varchar(30) | YES | | NULL | | | flags | int(11) | YES | | NULL | | | userid | varchar(30) | YES | | NULL | | | homezipcode | varchar(25) | YES | | NULL | | | zipcode | varchar(25) | YES | | NULL | | | sort1 | varchar(80) | YES | | NULL | | | sort2 | varchar(80) | YES | | NULL | | +------------------+--------------+------+-----+---------+----------------+ 48 rows in set
While this table can hold a wealth of data about a borrower, the most important piece of data here is the borrowernumber, because it is used to relate other borrower and transaction data to this basic data.
The deletedborrowers table looks very similar:
DESCRIBE deletedborrowers; +------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------+-------+ | borrowernumber | int(11) | | MUL | 0 | | | cardnumber | varchar(9) | | MUL | | | | surname | text | | | | | | firstname | text | | | | | | title | text | YES | | NULL | | | othernames | text | YES | | NULL | | | initials | text | | | | | | streetaddress | text | | | | | | suburb | text | YES | | NULL | | | city | text | | | | | | phone | text | | | | | | emailaddress | text | YES | | NULL | | | faxnumber | text | YES | | NULL | | | altstreetaddress | text | YES | | NULL | | | altsuburb | text | YES | | NULL | | | altcity | text | YES | | NULL | | | altphone | text | YES | | NULL | | | dateofbirth | date | YES | | NULL | | | branchcode | varchar(4) | | | | | | categorycode | char(2) | YES | | NULL | | | dateenrolled | date | YES | | NULL | | | gonenoaddress | tinyint(1) | YES | | NULL | | | lost | tinyint(1) | YES | | NULL | | | debarred | tinyint(1) | YES | | NULL | | | studentnumber | text | YES | | NULL | | | school | text | YES | | NULL | | | contactname | text | YES | | NULL | | | borrowernotes | text | YES | | NULL | | | guarantor | int(11) | YES | | NULL | | | area | char(2) | YES | | NULL | | | ethnicity | varchar(50) | YES | | NULL | | | ethnotes | varchar(255) | YES | | NULL | | | sex | char(1) | YES | | NULL | | | expiry | date | YES | | NULL | | | altnotes | varchar(255) | YES | | NULL | | | altrelationship | varchar(100) | YES | | NULL | | | streetcity | text | YES | | NULL | | | phoneday | varchar(50) | YES | | NULL | | | preferredcont | varchar(100) | YES | | NULL | | | physstreet | varchar(100) | YES | | NULL | | +------------------+--------------+------+-----+---------+-------+ 40 rows in set
This table holds the data of deleted borrowers, so that their information does not simply vanish from the database.
The contents of two other tables are controlled by the borrower when logged in to the OPAC:
DESCRIBE bookshelf; +-------------+-----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+-----------+------+-----+---------+----------------+ | shelfnumber | int(11) | | PRI | NULL | auto_increment | | shelfname | char(255) | YES | | NULL | | | owner | char(80) | YES | | NULL | | | category | char(1) | YES | | NULL | | +-------------+-----------+------+-----+---------+----------------+ 4 rows in set
DESCRIBE shelfcontents; +-------------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------+------+-----+---------+-------+ | shelfnumber | int(11) | | | 0 | | | itemnumber | int(11) | | | 0 | | | flags | int(11) | YES | | NULL | | +-------------+---------+------+-----+---------+-------+ 3 rows in set
The bookshelf table holds general information and "virtual bookshelves" created by the borrower. The shelfcontents table holds detail information about each bookshelf.
One final table, borexp, was apparently once used for holding information about the expiration date of a borrower's registration, but this table is no longer used.