Books APIs and Schemas
Database Schemas
Diagram examples
Books Table
Column | Type | Description |
---|---|---|
book_id | integer | Primary key for the book |
title | string | Title of the book |
author | string | Name of the author of the book |
description | string | Brief description of the book |
price | float | Price of the book |
published_at | datetime | Date the book was published |
created_at | datetime | Timestamp of when the book was added |
updated_at | datetime | Timestamp of when the book was last updated |
Categories Table
Column | Type | Description |
---|---|---|
category_id | integer | Primary key for the category |
name | string | Name of the category |
created_at | datetime | Timestamp of when the category was added |
updated_at | datetime | Timestamp of when the category was last updated |
Book Categories Table
Column | Type | Description |
---|---|---|
book_category_id | integer | Primary key for the book-category relationship |
book_id | integer | Foreign key to the books table for the categorized book |
category_id | integer | Foreign key to the categories table for the category |
created_at | datetime | Timestamp of when the relationship was created |
updated_at | datetime | Timestamp of when the relationship was last updated |
Customers Table
Column | Type | Description |
---|---|---|
customer_id | integer | Primary key for the customer |
first_name | string | First name of the customer |
last_name | string | Last name of the customer |
string | Email address of the customer | |
password | string | Hashed password for the customer's account |
created_at | datetime | Timestamp of when the customer's account was created |
updated_at | datetime | Timestamp of when the customer's account was last updated |
Orders Table
Column | Type | Description |
---|---|---|
order_id | integer | Primary key for the order |
customer_id | integer | Foreign key to the customers table for the customer who placed the order |
order_date | datetime | Timestamp of when the order was placed |
total_amount | float | Total amount of the order |
created_at | datetime | Timestamp of when the order was created |
updated_at | datetime | Timestamp of when the order was last updated |
Order Items Table
Column | Type | Description |
---|---|---|
order_item_id | integer | Primary key for the order item |
order_id | integer | Foreign key to the orders table for the order that the item is a part of |
book_id | integer | Foreign key to the books table for the book that was ordered |
quantity | integer | Quantity of the book that was ordered |
unit_price | float | Unit price of the book that was ordered |
created_at | datetime | Timestamp of when the order item was created |
updated_at | datetime | Timestamp of when the order item was last updated |
Authors Table
Column | Type | Description |
---|---|---|
author_id | integer | Primary key for the author |
first_name | string | First name of the author |
last_name | string | Last name of the author |
bio | string | Biographical information about the author |
created_at | datetime | Timestamp of when the author was added to the database |
updated_at | datetime | Timestamp of when the author was last updated |
Reviews Table
Column | Type | Description |
---|---|---|
review_id | integer | Primary key for the review |
book_id | integer | Foreign key to the books table for the book that the review is for |
customer_id | integer | Foreign key to the customers table for the customer who wrote the review |
rating | integer | Rating given in the review, on a scale of 1 to 5 |
review_text | string | Text of the review |
created_at | datetime | Timestamp of when the review was added to the database |
updated_at | datetime | Timestamp of when the review was last updated |
Books APIs
APIs and Microservices
- OpenLibrary
- OpenLibrary Books
- OpenLibrary Authors
- OpenLibrary Search
- OpenLibrary Subjects
- OpenLibrary Works
- OpenLibrary Covers