Create a database named LastNameBookstore. Add the four tables below and the data for five actual books. At least one book should have multiple authors (like a textbook). Add your name as an author along with a fictitious book (unless you wrote a real one).
Authors
AID int not null primary key auto_increment
FName varchar (20)
LName varchar (20)
Books
ISBN varchar (13) not null primary key
Title varchar(40)
Genre varchar(10)
PubDate date
PID int
AuthorBooks
AID
ISBN
Publisher
PID
Name
Location
If you have any doubts, please give me comment...
CREATE DATABASE LastNameBookstore;
CREATE TABLE Authors(
AID INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
FName VARCHAR(20),
LName VARCHAR(20)
);
CREATE TABLE Publisher(
PID INT NOT NULL PRIMARY KEY,
Name VARCHAR(50),
Location VARCHAR(50)
);
CREATE TABLE Books(
ISBN VARCHAR(13) NOT NULL PRIMARY KEY,
Title VARCHAR(40),
Genre VARCHAR(10),
PubDate DATE,
PID INT,
FOREIGN KEY(PID) REFERENCES Publisher(PID)
);
CREATE TABLE AuthorBooks(
AID INT,
ISBN VARCHAR(13),
PRIMARY KEY(AID, ISBN),
FOREIGN KEY(AID) REFERENCES Author(AID),
FOREIGN KEY(ISBN) REFERENCES Books(ISBN)
);
Get Answers For Free
Most questions answered within 1 hours.