use sql oracle live when needed
1. Consider the Employee Database. Give an expression in the relational algebra to express each of the following queries: Employee(person id, person name, street, city) Works(person id, company name, salary) Company(Company name, city) a. Identify the Primary Keys, Foreign Keys b. I Show the details of all employees who lives in "Bahrain" c. Find the name of each employee who lives in city "Miami" d. Find the name of each employee whose salary is greater than $10000. e. Find the name of each employee who lives in "Miami" and whose salary is greater than $10000 f. Find the ID and name of each employee who does not work for "BigBank". g. Find the ID, name and city of residence of each employee who works for "BigBank" h. Find the ID and name of each employee in this database who lives in the same city as the company for which she or he works. Find the ID, name, street address and city of residence of each employee who works for "BigBank" and earns more than $10000. i. 2. Consider the Bank database. Give an expression in the relational algebra for each of the following queries. 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) a. What are the primary keys and foreign keys? b. Find the name of each branch located in "Chicago" c. Find the ID of each borrower who has a loan in branch "Downtown" d. Find each loan number with a loan amount greater than $10000. e. Find the ID of each depositor who has an account with a balance greater than $6000. f. Find the ID of each depositor who has an account with a balance greater than $6000 at the "Uptown" branch. 3. Write two reasons why NULL values might be introduced into a database. 4. Describe the difference in meaning between the terms relation and relation schema.
use sql oracle live when needed
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am