You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
International Standard Book Number (ISBN) for the book.
genre
VARCHAR2(100)
NOT NULL
Genre of the book.
description
VARCHAR2(500)
Description or summary of the book.
available
VARCHAR2(5)
CHECK (available IN ('true', 'false'))
Availability of the book (true/false).
Generate library_api_books table in SQL:
CREATETABLElibrary_api_books (
book_id VARCHAR2(50) PRIMARY KEY,
title VARCHAR2(255) NOT NULL,
author VARCHAR2(255) NOT NULL,
publication_year VARCHAR2(4) NOT NULL,
isbn VARCHAR2(50),
genre VARCHAR2(100) NOT NULL,
description VARCHAR2(500),
available VARCHAR2(5) CHECK (available IN ('true', 'false'))
);
Sample Data for library_api_books table:
INSERT INTO library_api_books (book_id, title, author, publication_year, isbn, genre, description, available)
VALUES
('B001', 'The Great Gatsby', 'F. Scott Fitzgerald', '1925', '9780743273565', 'Classic', 'A tale of the Jazz Age', 'true'),
('B002', 'To Kill a Mockingbird', 'Harper Lee', '1960', '9780061120084', 'Fiction', 'A story about racial injustice', 'true'),
('B003', '1984', 'George Orwell', '1949', '9780451524935', 'Dystopian', 'A classic portrayal of totalitarianism', 'true'),
('B004', "Harry Potter and the Sorcerer's Stone", 'J.K. Rowling', '1997', '9780590353427', 'Fantasy', 'The start of an epic wizarding adventure', 'true'),
('B005', 'Pride and Prejudice', 'Jane Austen', '1813', '9780141439518', 'Romance', 'A tale of love and societal norms', 'true'),
('B006', 'The Lord of the Rings', 'J.R.R. Tolkien', '1954', '9780618640157', 'Fantasy', 'A quest to destroy the One Ring', 'true'),
('B007', 'Brave New World', 'Aldous Huxley', '1932', '9780060850524', 'Dystopian', 'A vision of a future society', 'true'),
('B008', 'The Catcher in the Rye', 'J.D. Salinger', '1951', '9780316769174', 'Coming-of-Age', 'A journey of teenage angst', 'true'),
('B009', 'Moby-Dick', 'Herman Melville', '1851', '9780142437247', 'Adventure', 'The hunt for the white whale', 'true'),
('B010', 'The Hobbit', 'J.R.R. Tolkien', '1937', '9780547928227', 'Fantasy', 'The adventure of Bilbo Baggins', 'true');
Empty library_api_books table:
TRUNCATE TABLE library_api_books;
Drop library_api_books table with schema:
DROPTABLE library_api_books;
Table: library_api_members
Column Name
Data Type
Constraints
Description
member_id
VARCHAR2(50)
PRIMARY KEY
Unique identifier for the member.
first_name
VARCHAR2(100)
NOT NULL
First name of the member.
last_name
VARCHAR2(100)
NOT NULL
Last name of the member.
email
VARCHAR2(255)
NOT NULL
Email of the member.
address
VARCHAR2(255)
NOT NULL
Street address of the member.
city
VARCHAR2(100)
NOT NULL
City of the member.
state
VARCHAR2(2)
NOT NULL CHECK (REGEXP_LIKE(state, '^[A-Z]{2}$'))
State of the member (two-letter code).
country
VARCHAR2(50)
NOT NULL
Country of the member.
phone_number
VARCHAR2(15)
NOT NULL CHECK (REGEXP_LIKE(phone_number, '^\d{3}-\d{3}-\d{4}$'))
Phone number of the member.
status
VARCHAR2(10)
CHECK (status IN ('active', 'suspended', 'expired'))
Membership status of the member.
Generate library_api_members table in SQL:
CREATETABLElibrary_api_members (
member_id VARCHAR2(50) PRIMARY KEY,
first_name VARCHAR2(100) NOT NULL,
last_name VARCHAR2(100) NOT NULL,
email VARCHAR2(255) NOT NULL,
address VARCHAR2(255) NOT NULL,
city VARCHAR2(100) NOT NULL,
state VARCHAR2(2) NOT NULLCHECK (REGEXP_LIKE(state, '^[A-Z]{2}$')),
country VARCHAR2(50) NOT NULL,
phone_number VARCHAR2(15) NOT NULLCHECK (REGEXP_LIKE(phone_number, '^\d{3}-\d{3}-\d{4}$')),
status VARCHAR2(10) CHECK (status IN ('active', 'suspended', 'expired'))
);