1. Database System Sunita M. Dol
Page 1
HANDOUT#09
Aim:
Write a program to create a Data Dictionary.
Theory:
Data Dictionary
Relational Schema and other metadata about relations are stored in two structures called the data
dictionary or system catalog.
Among the types of information that the system must store are these:
1. Names of relations
2. Names of attributes of each relation
3. Domains and length of attributes
4. Names of views defined on database and definition of these views
5. Integrity Constraints
E-R Diagram for Banking Enterprise
Here are the major characteristics of the banking enterprise.
• The bank is organized into branches. Each branch is located in particular city and is
identified by a unique name. The bank monitors the assets of each branch.
• Bank customers are identified by their customer_id values. The bank store each
customer’s name and street and city where the customer lives. Customers may have
account and can take out the loans. A customer may be associated with a particular
banker who may act as a loan officer or personal banker for that customer.
• Bank employees are identified by their employee_id values. The bank administration
stores the name and the telephone number of each employee, the name of employee’s
dependents and employee_id number of employee’s manager. The bank also keeps track
of the employees’ start date and thus the length of employment.
• Bank offers two types of account- saving and checking account. Accounts can be held
by more than one customer and a customer can have more than one account. Each
account is assigned unique account number. The bank maintains a record of each
account’ balance and most recent date on which the account was accessed each customer
holding the account. Each saving account has an interest rate and overdrafts are recorded
for each checking account.
• The bank provides its customer with loans. A loan is originates at particular branch and
can be held by one or more customers. A loan is identified by a unique loan number. For
each loan, 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
2. Database System Sunita M. Dol
Page 2
bank’s loan, a payment number does identify a particular payment for a specific loan.
The date and amount are recorded for each payment.
Data Dictionary for Banking Enterprise
The some set of relation schemas for above ER diagram is shown below:
• Schemas derived from a strong entity
branch = (branch-name, branch-city, assets)
branch
branch_name varchar(15) not null unique,
branch_city varchar(15) not null,
assets number not null,
primary key(branch_name)
3. Database System Sunita M. Dol
Page 3
customer = (customer-id, customer-name, customer-street, customer-city)
customer
customer_name varchar(15) not null unique,
customer_street varchar(12) not null,
customer_city varchar(15) not null,
primary key(customer_name)
loan = (loan-number, branch-name, amount)
loan
loan_number varchar(15) not null unique,
branch_name varchar(15) not null,
amount number not null,
primary key(loan_number)
account = (account-number, branch-name, balance)
account
account_number varchar(15) not null unique,
branch_name varchar(15) not null,
balance number not null,
primary key(account_number)
• Schemas derived from relationship sets involving strong entity sets
depositor = (customer-name, account-number)
depositor
customer_name varchar(15) not null,
account_number varchar(15) not null,
primary key(customer_name, account_number),
foreign key(account_number) references account(account_number),
foreign key(customer_name) references customer(customer_name)
borrower = (customer-name, loan-number)
borrower
customer_name varchar(15) not null,
loan_number varchar(15) not null,
primary key(customer_name, loan_number),
foreign key(customer_name) references customer(customer_name),
foreign key(loan_number) references loan(loan_number)
4. Database System Sunita M. Dol
Page 4
Program:
Input and Output:
Conclusion:
We implemented the program to create a Data Dictionary
References:
• Database system concepts by Abraham Silberschatz, Henry F. Korth, S. Sudarshan
(McGraw Hill International Edition) sixth edition.
• Database system concepts by Abraham Silberschatz, Henry F. Korth, S. Sudarshan
(McGraw Hill International Edition) fifth edition.
• http://codex.cs.yale.edu/avi/db-book/db4/slide-dir/
• http://codex.cs.yale.edu/avi/db-book/db5/slide-dir/
• http://codex.cs.yale.edu/avi/db-book/db6/slide-dir/