Question

DATABASE QUESTION Draw a schema diagram for the following database schema. Branch (branch_name, branch_city, assets) customer...

DATABASE QUESTION

Draw a schema diagram for the following database schema.

Branch (branch_name, branch_city, assets)
customer (customer_name, customer_street, customer_city)
loan (loan number, branch_name, amount)
borrower (customer_name, loan_number)
account (account_number, branch_name, balance)
depositor (customer_name, account_number)

Considering the schema above, write relational expressions for the following sentences
1.Find all loan numbers with a loan value greater than $15,000.
2.Find the names of all depositors who have an account with a value greater than $8,000.
3.Find the names of all depositors who have an account with a value greater than $9,000 at
the "ASU" branch.

What is Cartesian-product here?

Homework Answers

Answer #1

/* HERE IS SQL QUERY */

1. SELECT LOAN_NUMBER FROM LOAN WHERE AMOUNT > 15000

2. SELECT D.CUSTOMER_NAME FROM DEPOSITOR D

INNER JOIN

ACCOUNT A

ON

D.ACOUNT_NUMBER = A.ACCOUNT_NUMBER

WHERE A.BALANCE > 8000

3.

SELECT D.CUSTOMER_NAME FROM DEPOSITOR D
INNER JOIN      
ACCOUNT A    
INNER JOIN
BRANCH B
ON     
D.ACCOUNT_NUMBER = A.ACCOUNT_NUMBER    
WHERE A.BALANCE > 9000 AND B.BRANCH_NAME = A.BRANCH_NAME

CARTESIAN PRODUCT:

Cartesian Product is resultant of all column of all the table

For Example, cartesian product of table Account and Customer would be the resultant of the rows of following:

customer_name,customer_street,customer_city,account,branch,balance

The cartesian product is made for the resultant of the multiple column

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1. In SQL. Given the following relational database schema . The primary key is underlined. All...
1. In SQL. Given the following relational database schema . The primary key is underlined. All attributes are of type string if not indicated otherwise.  branch(branch_name,branch_city,assets: integer)  customer(customer_i,customer_name,customer_street,customer_city)  account(account_number,branch_name,balance)  depositor(customer_id,account_number) a. Find the names of customers that have accounts in every branch in Miami. b. Find the names of customers who do not have an account. (assume the bank keeps the customer information even if the account is closed.)
HOW to create these tables in SQL? im using postgresql Consider the following bank database schema:...
HOW to create these tables in SQL? im using postgresql Consider the following bank database schema: branch(branch name, branch city, assets) customer(ID, customer name, customer street, customer city) loan(loan number, branch name, amount) borrower(ID, loan number) account(account number, branch name, balance) depositor(ID, account number)
Relational Algebra (50 pts): Consider the following database schema that keeps track of Sailors, Boats and...
Relational Algebra (50 pts): Consider the following database schema that keeps track of Sailors, Boats and the boats reserved by sailors. Sailors(sid, sname, rating, age) Boatsbid, bname, color) Reserves(sid, bid, date) Keys are underlined in each relation. Specify the following queries in Relational Algebra using above database schema. (f) find the name of sailors with the highest rating (g) find the name and age of oldest sailors (h) find the age of youngest sailor for each rating level (i) find...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary to answer the queries that follow. Primary keys are underlined and foreign key fields have an asterisk at the end of the field. CUSTOMERS (CUST-NO, C-NAME, C-ADDRESS, BALANCE) SALESPERSONS (SP-NO, S-NAME, DATE-EMPLOYED, SALARY) SALES (INVOICE-NO, DATE, CUST-NO*, SP-NO*) a) List the salesperson name and salary for all sales to customers whose balance outstanding is greater than 20000. b) List the names and addresses of...