Question: create table CUSTOMER ( CID text primary key, NAME text, DOB date ); create table BOOK ( ISBN text primary key, TITLE text, AUTHOR text

 create table CUSTOMER ( CID text primary key, NAME text, DOB

date ); create table BOOK ( ISBN text primary key, TITLE text,

create table CUSTOMER ( CID text primary key, NAME text, DOB date ); create table BOOK ( ISBN text primary key, TITLE text, AUTHOR text ); create table BUYS ( BID uuid primary key, CID text foreign key references CUSTOMER, ISBN text foreign key references BOOK, DATE timestamp, PRICE float ); 1. Assuming the schema in figure 1, write the following queries in Relational Algebra (RA). You may use any of the operators mentioned in class or the text, including X, A, U, n, /, n, o, p and y. N.B. When the question says "find X where X is a relationship or entity, that means to return the primary key for X, unless otherwise specified. (a) Find books written by 'Sam Spade'. (b) Find customers who are currently teens (i.e. ages 13 to 19, inclusive). (c) Find customers who are teens and bought at least one book by 'Sam Spade'. (d) Find customers who are teens and bought every book by 'Sam Spade'. (e) Find purchases that cost more than $100. (f) Find the names of customers that bought more than $100 worth of books in 01/2021. (g) Find pairs of customers that have purchased exactly the same set of books. (h) Find customers that have purchased exactly three books so far in 2021. (i) Find customers that have purchased more books than everyone else. (j) Find the names of customers that have never purchased a book

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!