Answered step by step
Verified Expert Solution
Question
1 Approved Answer
DROP TABLE AUTHORS cascade constraints; DROP TABLE BOOK _ ITEMS cascade constraints; DROP TABLE BOOKS cascade constraints; DROP TABLE BORROWING cascade constraints; DROP TABLE CUSTOMERS
DROP TABLE AUTHORS cascade constraints;
DROP TABLE BOOKITEMS cascade constraints;
DROP TABLE BOOKS cascade constraints;
DROP TABLE BORROWING cascade constraints;
DROP TABLE CUSTOMERS cascade constraints;
DROP TABLE WRITING cascade constraints;
CREATE TABLE AUTHORS
AUTHORID NUMBER
LASTNAME VARCHAR CHAR
FIRSTNAME VARCHAR CHAR
BIRTHDATE DATE
;
CREATE TABLE BOOKITEMS
BOOKITEMID VARCHAR CHAR
BOOKID NUMBER
THEORETICALVALUE NUMBER
;
CREATE TABLE BOOKS
BOOKID NUMBER
TITLE VARCHAR CHAR
ISBN VARCHAR CHAR
PUBLISHER VARCHAR CHAR
PUBLISHINGDATE DATE,
PRICE NUMBER
TOPIC VARCHAR CHAR
NUMBEROFPAGES NUMBER
;
CREATE TABLE BORROWING
CUSTOMERID VARCHAR CHAR
BOOKITEMID VARCHAR CHAR
BORROWINGDATE DATE,
BORROWINGPERIODINDAYS NUMBER DEFAULT
BRINGBACKDATE DATE,
LATEFEE NUMBER
;
CREATE TABLE CUSTOMERS
LIBRARYCARDNUMBER VARCHAR CHAR
LASTNAME VARCHAR CHAR
FIRSTNAME VARCHAR CHAR
BIRTHDATE DATE,
GENDER CHAR CHAR
ADDRESS VARCHAR CHAR
ENROLLMENTDATE DATE,
MEMBERSHIPFEE NUMBER
CATEGORY VARCHAR CHAR
;
CREATE TABLE WRITING
AUTHORID NUMBER
BOOKID NUMBER
ROYALTY NUMBER
;
Insert into AUTHORS AUTHORIDLASTNAME,FIRSTNAME,BIRTHDATE values 'Christie','Agatha',todateYYYYMmDD;
Insert into AUTHORS AUTHORIDLASTNAME,FIRSTNAME,BIRTHDATE values 'Banner',A JtodateYYYYMmDD;
Insert into AU
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started