Skip to main content

Books APIs and Schemas

Database Schemas

Diagram examples

Books Table

ColumnTypeDescription
book_idintegerPrimary key for the book
titlestringTitle of the book
authorstringName of the author of the book
descriptionstringBrief description of the book
pricefloatPrice of the book
published_atdatetimeDate the book was published
created_atdatetimeTimestamp of when the book was added
updated_atdatetimeTimestamp of when the book was last updated

Categories Table

ColumnTypeDescription
category_idintegerPrimary key for the category
namestringName of the category
created_atdatetimeTimestamp of when the category was added
updated_atdatetimeTimestamp of when the category was last updated

Book Categories Table

ColumnTypeDescription
book_category_idintegerPrimary key for the book-category relationship
book_idintegerForeign key to the books table for the categorized book
category_idintegerForeign key to the categories table for the category
created_atdatetimeTimestamp of when the relationship was created
updated_atdatetimeTimestamp of when the relationship was last updated

Customers Table

ColumnTypeDescription
customer_idintegerPrimary key for the customer
first_namestringFirst name of the customer
last_namestringLast name of the customer
emailstringEmail address of the customer
passwordstringHashed password for the customer's account
created_atdatetimeTimestamp of when the customer's account was created
updated_atdatetimeTimestamp of when the customer's account was last updated

Orders Table

ColumnTypeDescription
order_idintegerPrimary key for the order
customer_idintegerForeign key to the customers table for the customer who placed the order
order_datedatetimeTimestamp of when the order was placed
total_amountfloatTotal amount of the order
created_atdatetimeTimestamp of when the order was created
updated_atdatetimeTimestamp of when the order was last updated

Order Items Table

ColumnTypeDescription
order_item_idintegerPrimary key for the order item
order_idintegerForeign key to the orders table for the order that the item is a part of
book_idintegerForeign key to the books table for the book that was ordered
quantityintegerQuantity of the book that was ordered
unit_pricefloatUnit price of the book that was ordered
created_atdatetimeTimestamp of when the order item was created
updated_atdatetimeTimestamp of when the order item was last updated

Authors Table

ColumnTypeDescription
author_idintegerPrimary key for the author
first_namestringFirst name of the author
last_namestringLast name of the author
biostringBiographical information about the author
created_atdatetimeTimestamp of when the author was added to the database
updated_atdatetimeTimestamp of when the author was last updated

Reviews Table

ColumnTypeDescription
review_idintegerPrimary key for the review
book_idintegerForeign key to the books table for the book that the review is for
customer_idintegerForeign key to the customers table for the customer who wrote the review
ratingintegerRating given in the review, on a scale of 1 to 5
review_textstringText of the review
created_atdatetimeTimestamp of when the review was added to the database
updated_atdatetimeTimestamp of when the review was last updated

Books APIs

APIs and Microservices