Question
Given the following table: library(book_id,book_title,person_id,due_date,first_name,last_name,returned_date,late_fee) With the following assumptions: - One copy of each book is held by the library - Person_id is unique for
Given the following table:
library(book_id,book_title,person_id,due_date,first_name,last_name,returned_date,late_fee)
With the following assumptions: -
One copy of each book is held by the library -
Person_id is unique for each person, book_id is unique for each book -
The library table is meant to store information about loans of books made by the library.
Here are the functional dependencies for the above table:
Book_id book_title
Person_id first_name,last_name
Book_id,person_id,due_date returned_date,late_fee
Create the table from question above in postgres sql.
Follow these guidelines:
1. Choose a suitable primary key for the table (You are given the FDs, so this should be easy).
2. Add some constraints to the table:
a. Book_title, first, and last should not be null (you may have to look this up online).
b. If returned_date is after due_date then late_fee must be greater than 0.
c. Late_fee cannot be less than 0.
I am getting strange errors when i am putting my statements in postgres .......any detailed explanation would be helpful....
PLEASE NOTE THIS QUESTION NEEDS TO BE DONE IN POSTGRES......SQL COMMAND
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