Data dictionary (5)
Data dictionary (5)
ENTITY DIAGRAM:
Data dictionary:
Customer
Attribute name Data type Length Required Format PK FK
Costomer_id Number 10 Y Y
Name VARCHAR 100 Y
Address VARCHAR 100 Y
Phone_number VARCHAR 100 Y
Date_of_birth DATE YYYY-MM-DD
Bank_detail_id NUMBER 10 Y Bank. Bank_detail_id
Bank
Attribute name Data type Length Required Format PK FK
Bank_detail_id Number 10 Y Y
Bank_Name VARCHAR 100 Y
Address VARCHAR 100 Y
SortCode VARCHAR 100 Y
AccountNumbe VARCHAR 100 Y
Product
Attribute name Data type Length Required Format PK FK
Product_ID Number 10 Y Y
Product_Type VARCHAR 100 Y
Product_Name VARCHAR 100
Product_Description VARCHAR 100
P_UnitPrice VARCHAR 100 99999.99
Purchase
Attribute name Data type Length Required Format PK FK
Purchase_ID Number 10 Y Y
Customer_id VARCHAR 10 Y Customer.customer_id
Store_id VARCHAR 10 Y Store.store_id
Date_of_purchase DATE YYYY-MM-DD
Stock
Attribute name Data type Length Required Format PK FK
Store_id Number 10 Y Store.store_id
Product_id Number 10 Y Product.product_id
Quantity Number
Store
Attribute name Data type Length Required Format PK FK
Store_id Number 10 Y Y
Store_name Varchar 10 Y
Store_address Varchar 100
Order
Attribute name Data type Length Required Format PK FK
Order_id Number 10 Y Y
Product_id Number 10 Y Product.product_id
Purchase_id Number 10 Y Purchase.purchase_id
Quantity Number
The order table is added for optimization: For example, if a customer just orders 30 products, we do
not need to rewrite the date and the store
SPECIFICATION OF FDs :
CUSTOMER:
customer_id → name, address, telephone_number, date_of_birth, bank_detail_id
( bank_detail_id is a foreign key linking to the BankDetail entity) .
BANK DETAIL:
bank_detail_id → bank_name, address, sort_code, account_number.
PRODUCT:
product_id → type, name, description, cost.
Each product has a unique product id.
PURCHASE:
purchase_id → date_of_purchase, customer_id, store_id.
ORDER:
order_id → purchase_id, product_id, quantity, unit_price.
STOCK:
(product_id, store_id) → quantity.
The combination of product ID and store ID uniquely determines the stock quantity.
Store:
store_id → name, address.
Each store is unique and has a unique ID.
If table exists already you will get an error. That is why we drop all tables first.
Making purchase
process :
NEW PURCHASE :
Product iD NOT FOUND
Insufficient stock for
the selected product :
Report management
By default, Oracle relational database management system does not give any privileges to new
users.
New roles are created using The CREATE ROLE statement:
Manager's Administration : The manager will be able to view and edit all the database,
privileges are added to roles using the GRANT statement.
Finance Staff's Administration: The finance staff will be able to access all customers' data and
edit it.
This account is the system that the user will be interacting with.
Transparent Data Encryption for sensitive data such as customer bank details.
We have to use the encryption key (password that serves to encrypt and decrypt your data). The
process of encryption is transparent to customers.
Wrapping is the process of hiding PL/SQL source code. Wrapping helps developers to protect their
source code from any user who can benefit or might misuse it.
To protect PL/SQL objects is necessary to disable DDL statements like create, replace and some
DML statements oriented to the static data dictionary views *_SOURCE.
To implement this method in our database, we can:
Encrypt our database PL/SQL source code using Oracle's wrap utility before deploying it to the
database.
REFERENCES:
BOOKS: PROTECTING ORACLE PL/SQL SOURCE CODE FROM A DBA USER , Hakik Paci, Elinda Kajo
Mece, Aleksander Xhuvani1 - Polytechnic University of Tirana
The database book, principles and practice using the ORACLE database system , DR NARAIN
GENANI.