1 of 5

e-Library

Database Schema

  • Anmol Gupta

2 of 5

TABLE: Books

Column_name

Type

Constraints

bid

unsigned Biginteger

Primary Key,Auto incremented

book_name

varchar

Not null

book_author

varchar

Not null

book_cover

varchar

Nullable

book_description

text

Nullable

total_book_count

int

Not null,Default 1

avail_book_count

int

Not null

last_modify

datetime

Default Current Timestamp

3 of 5

TABLE: Users

Column_name

Type

Constraints

userId

unsigned Biginteger

Primary Key,Auto incremented

userName

varchar

Not null

email

varchar

Not null

password

varchar

Not null,encrypted

isVerified

boolean

Not null, default False

isAdmin

boolean

Not null, default False

(F-for reader & T-for admin)

4 of 5

TABLE: has_book

Column_name

Type

Constraints

id

unsigned Biginteger

Primary Key,Auto incremented

user_id

unsigned Biginteger

Foreign key users

bid

unsigned Biginteger

Foreign key books

action

varchar

Not null

issue_timestamp

datetime

Current Timestamp

return_timestamp

datetime

Current Timestamp

5 of 5

Thank You