Anda di halaman 1dari 7

Introduction

According to the problem in UK, the people are not spending money on music so the
music companies had been many layoffs, so two major music seller companies have decided
to do their business together, but they have said that company business should run in the old
system mechanism but the management want run as a single business. For that we have
collected the databases of two companies and using integration we are making together but
unfortunately the MSQ- music quality runs in SQL database and ODB-O’REALLY dubbed
runs in oracle db. Now my aim is to design and implement the global conceptual schema for
the companies.

Integration analysis and global conceptual of schema:


Schema 1: MSQ
User (user id, user name, real name, password, house no, address, postcode)
Order (order id, date, user id, total cost)
Product (product id, title, artist, publisher, isbn)
Order detail (product id, order id, price)

Schema 2: ODB
Stock (store id, product id, quantity, discount)
Product (product id, Title, artist, publisher, isbn, reg price)
Transaction Detail (order id, product id, sale price)
Transaction (order id, customer id, total, transaction date)
Customer (customer id, first name, last name, address, region, city, postal Code, Email)

These are the two schemas which are derived from the two company msq and odb.

In msq schema there are four entities where each entity has an different attribute when we
take an entity of an user the attributes are user id, user name, real name, password, house no,
address, postcode where these are the attributes which specifies the field user but in common
which these are the details which gives the customer details. Where as in the order it consists
of following entities order id, date, user id, total cost. Where this detail specifies the customer
who places an order for the music and sometimes this field can be null because some
customer can place a order or some may not place the order. For the entity product it consists
of product id, title, artist, publisher and ISBN, This field gives the detail what kind of music
product does the customer has been purchased. The entity order detail has an attribute produc
t id, order id, price, this gives the company order details of individuals and how much are to
be placed for the company.

In odb schema there are five entities where the entities are stock, product, transaction,
transaction detail, and customer. Which each and every entity has a different attributes for the
entity stock the attributes are store id, product id, quantity, discount. For an entity product the
attributes are id, Title, artist, publisher, isbn, reg price. For the entity transaction detail the
attributes are order id, product id, sale price. For an entity transaction the attributes are order
id, customer id, total, transaction date. And for the customer entity the attributes are customer
id, first name, last name, address, region, city, postal code, Email. In company details of
availability of stock are given by a stock entity. Product entity tells the details of product for
sales in the company which gives you the details of price and other product details.
Transaction detail gives the information of product id, order id, sale price where this is the
detail which a customer buys a product the information gets stored in the transaction detail
entity. Customer entity gives the details of a customer the information are regarding personal
information and customer id.

Global conceptual schema for two entities in databases of MSQ and ODB

Client

Schema 1 Schema 2 Analysis/Discussion Mapping


User ID Customer ID Synonyms, both are Client ID = User ID U
Primary Keys Customer ID
User Name First Name Not the same, User ClientName =
Last Name Name = First Name + S1.UserName U
Last Name S2.FirstName “ ” +
S2.LastName
Password NULL Password details of a Password =
customer to access a S1.Password U
information which it S2.(Null)
obtains from the
schema 1
House No Address Not direct mapping, ClientAddress =
Address we can concatenate S1.HouseNo “ ” +
together into S1.Address U
Synonym S2.Address
NULL Region Region of customer Region = S1.(Null) U
obtained from S2.Region
schema 2
NULL City City of customer City = S1.(Null) U
obtained from S2.City
schema 2
Postcode Postalcode Synonyms,both are Postcode =
primary keys S1.Postcode U
S2.Postalcode
Email NULL Contact detail of Email = S1.Email U
customer obtained S2.(Null)
from schema 1.

Schema 1 - User (user id, user name, real name, password, house no, address, postcode)

Schema 2 - Customer (customer id, first name, last name, address, region, city, postal Code,
Email)

Client= schema 1 U schema 2


Client (client id, client name, client address, password, region, city, postcode, email)
Client is an entity which consists of an attributes client id, client name, client address, client
address, password, region, city, postcode, email. Where client is obtained using global
conceptual schema, this global conceptual schema has two functions namely.

• Synonyms

- Two identical things or entities having different names are synonyms

• Homonyms

- Two different things or entities having identical names are homonyms

Where in schema 1 user id and schema 2 customer id are synonyms which they give same
information but their field names are different so we can combinable as an client id. Similarly
in schema 1 and schema 2 address, postcode, names are similar to a customer id and user id
they are said to be synonyms.

Sale

Schema 1 Schema 2 Analysis/Discussion Mapping


OrderID OrderID Same OrderID = S1.OrderID
U S2.OrderID
UserID CustomerID Near Synonyms, both ClientID
are Foreign Keys (Mapped in already
in Client Table)
TotalCost Total Both are Synonyms TotalCost =
TotalCost = Entire S1.TotalCost U
Cost (Cost of the S2.Total
product + (which
may includes
discounts etc.))
Total = RegPrice +
Discount
Date TransactionDate Homonyms, Where OrderDate = S1.Date
S1.Date are The date and
when the order is TransactionDate =
placed and S2.TransactioinDate
S2.TransactionDate
is the date when the
transaction has
taken place.

Schema 1: Order (order id, date, user id, total cost)


Schema 2: Transaction (order id, customer id, total, transaction date)
Global conceptual schema = schema 1 U schema 2

Sale= order U transaction

Sale (order id, client id, total cost, order date)

Where in the entity sale the attributes are order id, client id, total cost, orders date. Where
order id is the same in both the schemas which gives the same information. Where in the
attributes user id and customer id in schemas 1 and 2 respectively which they are near
synonyms but they are foreign keys and together they are called as client id attribute. Total
cost and total are attributes of schemas order and transaction respectively they are a synonym
which gives the detail information of total cost of a product. The attributes date and
transaction date are the homonyms Schema 1 Date are the date when the order is placed and
schema 2 transaction date is the date when the transaction has taken place. Where both give
the different information but they are in same name and it together it is said to be order date.

Sale details

Schema 1 Schema 2 Analysis/Discussion Mapping


ProductID ProductID Same ProductID =
S1.ProductID U
S2.ProductID
OrderID OrderID Same OrderID = S1.OrderID
U S2.OrderID
Price SalePrice Synonyms TotalPrice = S1.Price
U S2.SalePrice

Where sale details are obtained by union of two schemas order detail and transaction detail.

Order detail (product id, order id, price)


Transaction Detail (order id, product id, sale price)

Sale details = order detail U transaction detail


Sale details (product id, order id, total price)

Where product id and order id of schemas 1 and 2 are similar and gives same information.
But price and sale price are called as synonyms where it merely gives the same information
but it has different name.

Product

The product is obtained from the union of product of two schemas MSQ and ODB.
Schema 1: Product (product id, title, artist, publisher, isbn)
Schema 2: Product (product id, Title, artist, publisher, isbn, reg price)

Product = schema1 U schema 2.


Product (product id, title, artist, publisher, isbn, reg price)

Where in the above schema product id, title, artist are same and gives the same information
where as the ISBN also gives the same information but it is not important that what
information is stored in it where the field name is same and type is same so information is not
important whether it may contain same or different data.

Schema 1 Schema 2 Analysis/Discussion Mapping


ProductID ProductID Same ProductID =
S1.ProductID U
S2.ProductID
Title Title Same Title = S1.Title U
S2.Title
Artist Artist Same Artist = S1.Artist U
S2.Artist
Publisher Publisher Same Publisher =
S1.Publisher U
S2.Publisher
ISBN ISBN Same, Because data ISBN = S1.ISBN U
type is same and S2.ISBN
names are same and
it’s not important
what data it stores
NULL RegPrice Cost of a product RegPrice = S1.(Null)
which is obtained U S2.RegPrice
from a schema 2

Stock

Schema 1 Schema 2 Analysis/Discussion Mapping


NULL StoreID Stock of store id StoreID = S1.(Null) U
which is obtained S2.StoreID
from schema 2
NULL ProductID Stock of product id ProductID = S1.(Null)
obtained from U S2.ProductID
schema 2
NULL Quantity Stock of quantity Quantity = S1.(Null)
obtained from U S2.Quantity
schema 2
NULL Discount Discount of a Discount = S1.(Null)
product obtained U S2.Discount
from schema 2
It is the union of two schemas but schema one doesn’t carry any information about stock so
simply we can concatenate the information as global conceptual schemas.

Schema 1: null

Schema 2: Stock (store id, product id, quantity, discount)

Stock = schema 1 U schema 2

Stock (store id, product id, quantity, discount)

Global conceptual schema for MSQ and ODB are

Stock (store id, product id, quantity, discount)


Product (product id, title, artist, publisher, isbn, reg price)
Sale details (product id, order id, total price)
Sale (order id, client id, total cost, order date)
Client (client id, client name, client address, password, region, city, postcode, email)

Global conceptual schema table

Stock

StoreId ProductID Quantity Discount


1 1 10 20%
1 2 20 0%
2 1 13 0%
2 2 18 50%

Product

ProductID Title Artist Publisher ISBN RegPrice


1 Here Before Fever Ray Rabid Records 1-123-6546-2 10.00
2 When I grow up Fever Ray Rabid Records 1-123-6546-2 13.00
3 If I had a heart Fever Ray Rabid Records 1-123-6546-2 15.00

Client

Clientid Client Client Password Region City Postcode Email


name address
1 Mixman 1 london Mix Greenwich London E11 8ZG s.scola@gre.ac.uk
simon road
scola
2 5 Waf Newham London E14 6PJ j.scola@gre.ac.uk
Waffles
flowerpot
john scola
terrace
Sale details

ProductID OrderId Total Price


1 1 9
2 1 9
3 1 10
3 2 12
1 1 8.00
2 1 13.00

Sale

OrderId Client ID Total cost orderDate


1 1 10.97 11/12/2010
2 2 13.99 11/12/2010

ERD of global conceptual schema

Client (client id, client name, client address, password, region, city, postcode, email)
Sale (order id, client id, total cost, order date)
Sale details (product id, order id, total price)
Product (product id, title, artist, publisher, ISBN, reg price)
Stock (store id, product id, quantity, discount)

Order id
Client name
Order date
Postcode
Total cost
Client address Email Client id

Client Sale detail Sale


city

Client id Stock
Region Reg price

Password
Product id
ISBN
Product

Title
Publisher

Artist

Anda mungkin juga menyukai