Professional Documents
Culture Documents
Homework Chapter 01
Homework Chapter 01
Part 1: Exercises
1 List four significant differences between a file-processing and a DBMS.
2 Explain View of Data--Levels of Abstraction, Explain the difference between
physical and logical data independence.
3. List all the Data Models you know?
4. List the statement of SQL? Give some example for SQL statements.
5. Explain JDBC ODBC? Give the Model for communicating with the database
use them?
6 List the ACID properties of transaction. Explain the usefulness of each.
7 During its execution, a transaction passes through several states, until it finally
commits or aborts. List all possible sequences of states through which a transaction
may pass. Explain why each state transition may occur.
8 List all of the protocols in concurrent control? And describe the detail of these
protocol.
9 Describe the two parts of recovery algorithm.
10 Explain the process of the log base recovery? Why records for transactions on
the undo-list must be processed in reverse order, whereas redo is performed in a
forward direction.
11 List the characters of three generetion database?
Part 1: Experiment
Design the Bank database according the following data requirements. Use postgrSQL
to implement the bank application.
The Data Requirements for the Bank Database is following:.
a) The bank is organized into branches. Each branch is located in a particular city and
is identified by a unique name. The bank monitors the assets of each branch.
b) Bank customers are identified by their customer_id values. The bank stores each
customer's name and the street and city where the customer lives. Customers may
have accounts and can take out loans. A customer may be associated with a particular
banker, who may act as a loan officer or personal banker for that customer.
c) Bank employees are identified by their employee_id values. The bank
administration stores the name and telephone number of each employee, the names of
the employee's dependents, and the employee_id number of the employee's manager.
The bank also keeps track of the employee's start date, thus, length of employment.
d) The bank offers two types of accounts --savings and checking accounts. Accounts
can be held by more than one customer, and a customer can have more than one
account. Each account is assigned a unique account number. The bank maintains a
record of each account's balance and the most recent date on which account was
accessed by each customer holding the account. In addition, each saving account has
an interest rate and overdrafts are recorded for each checking account.
e) A loan originates at a particular branch and can be held by one or more customers.
A loan is identified by a unique loan number. For each loan, the bank keeps track of
the loan amount and the loan payment, Although a loan payment number does not
uniquely identify a particular payment among those for all the bank's loans, a payment
number does identify a particular payment for a specific loan. The data and amount
are recorded for each payment.
D. User insert , update, delete statement to operate the data in the table of bank
database
a. Insert some data in Bank database (table; branch, customer, loan, borrower, etc.)
b. Give all employees of First Bank Corporation a 10 percent raise.
b. Give all managers of First Bank Corporation a 10 percent raise.
c. Delete all tuples in the works relation for employees of Small Bank Corporation.
E Write a function that, given the name of a department, return the count of the
number os instructors in that department.
F Consider the bank database above. Write an SQL trigger to carry out the following
action: On delete of an account, for each owner of the account, check if the owner
has any remaining accounts, and if she doesnot, delete her from the depositor relation.
G Create some user in Bank database, Use the DCL statement to grant some
prvilege to some student user or some teacher users