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.)
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...
Consider the following relational schema about a University (the primary keys are underlined and foreign keys...
Consider the following relational schema about a University (the primary keys are underlined and foreign keys are italic) STUDENT(StudentID, name, major, year, age) CLASS(ClassName, meetsAt, room, LecturerID) ENROLLED(StudentID, ClassName, mark) LECTURER(LecturerID, name, DepartmentID) DEPARTMENT(DepartmentID, name) Write the SQL statements for the following query: B1. Find the age of the oldest student. B2. Find the ID’s of lecturers whose name begins with “K” B3. Find the age of the youngest student who is enrolled in Mechatronics. B4. Find the age of...
For this assignment, you will create a BPMN diagram to depict the business process to get...
For this assignment, you will create a BPMN diagram to depict the business process to get a home mortgage based on the following narrative. You can use either DrawIO or BizAgi to create the process drawing. For this process, you can assume that the loan is a refinance not a home purchase. There are some small differences in the process to refinance an existing mortgage than to get a new mortgage. In the following narrative, I'm explaining all of the...
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...
The Greater Providence Deposit & Trust Embezzlement Nino Moscardi, president of Greater Providence Deposit & Trust...
The Greater Providence Deposit & Trust Embezzlement Nino Moscardi, president of Greater Providence Deposit & Trust (GPD&T), received an anonymous note in his mail stating that a bank employee was making bogus loans. Moscardi asked the bank’s internal auditors to investigate the transactions detailed in the note. The investigation led to James Guisti, manager of a North Providence branch office and a trusted 14-year employee who had once worked as one of the bank’s internal auditors. Guisti was charged with...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT