e-commerce jobs this project (project number: hu/01/b/f/pp-136012) is carried out with the financial...
TRANSCRIPT
![Page 1: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/1.jpg)
1
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
E-Commerce Databases
Database models
![Page 2: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/2.jpg)
2
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
Relational Databases
• Entities (e.g. Customer, Products ...)• Relationships (e.g. a Customer orders many
Products)• Entity Relationship Diagram (ERD)• Normal Forms (to exclude duplicity of data and
resulting update problems)
![Page 3: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/3.jpg)
3
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
Entity Type / Table
• Tables• Attributes• Records
![Page 4: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/4.jpg)
4
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
Primary Keys
• Primary Keys• Relationships
Primary Key cus_id
![Page 5: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/5.jpg)
5
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
Relationships
Customer Productconfirms sales
n:m
Customer Productconfirms
sales1:n
sold
n:1
Relationshipsbecome Tables
![Page 6: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/6.jpg)
6
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
Relationships
Customer Table
SalesTable
ProductTable
![Page 7: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/7.jpg)
7
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
Entity Relationship Diagram
• Illustrating entity types and their relationships• Input for the database design team which tables
to create
Customer Productconfirms
sales1:n
sold
n:1
![Page 8: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/8.jpg)
8
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
Redundancy Elimination
• First Normal Form– First Normal Form eliminates repeating groups by putting each into a separate table and
connecting them with a one-to-many relationship.
• Second Normal Form– Second Normal Form eliminates functional dependencies on a partial key by putting the
fields in a separate table from those that are dependent on the whole key.
• Third Normal Form– Third Normal Form eliminates functional dependencies on non-key fields by putting them in a separate
table. At this stage, all non-key fields are dependent on the key, the whole key and nothing but the key.
-> Data are normalised !
![Page 9: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/9.jpg)
9
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
1Nf to 2NF Example
• Separate into different entities/tables• Check that no attributes are dependent on key-subset (e.g.
warehouse-address being dependent on key warehouse)
![Page 10: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/10.jpg)
10
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
2NF to 3NF Example
• Identify non-key fields which would be keys of a separate table• Separate out these tables
![Page 11: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/11.jpg)
11
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
4NF / 5NF
Employee
Language
Competence1:n n:1
Skill
1:n
employee_id, skill_id, lang_id
Speaking
Capability
![Page 12: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/12.jpg)
12
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
Exercise 1 Master Example 1
• Design the Entity Realtionship Diagram for a typical customer and product sales situation including stock control
• Identify the primary keys, the relationships, and the attributes required within each table
• Check against the 3NF• Do this work in about 1 hour
![Page 13: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/13.jpg)
13
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
Exercise 2 Master Example 2
• Design the Entity Realtionship Diagram for a typical e-newspaper ordering site with customers, newspapers to select, newspapers to renew and to administer sales and payments
• Identify the primary keys, the relationships, and the attributes required within each table
• Check against the 3NF• Do this work in about 1 hour
![Page 14: E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities](https://reader035.vdocuments.mx/reader035/viewer/2022072008/56649d825503460f94a67a2d/html5/thumbnails/14.jpg)
14
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP-136012) is carried out with the financial support of the Commssion of the European Communities under the Leonardo da Vinci Programme
Database ModelsVer: 1.0
References
• F. Codd, "A Relational Model of Data for Large Shared Data Banks", Comm. ACM 13 (6), June 1970, pp. 377-387. The original paper introducing the relational data model.
• F. Codd, "Normalized Data Base Structure: A Brief Tutorial", ACM SIGFIDET Workshop on Data Description, Access, and Control, Nov. 11-12, 1971, San Diego, California, E.F. Codd and A.L. Dean (eds.). An early tutorial on the relational model and normalization.
• E.F. Codd, "Further Normalization of the Data Base Relational Model", R. Rustin (ed.), Data Base Systems (Courant Computer Science Symposia 6), Prentice-Hall, 1972. Also IBM Research Report RJ909. The first formal treatment of second and third normal forms.
• C.J. Date, An Introduction to Database Systems (third edition), Addison-Wesley, 1981. An excellent introduction to database systems, with emphasis on the relational.
• R. Fagin, "Multivalued Dependencies and a New Normal Form for Relational Databases", ACM Transactions on Database Systems 2 (3), Sept. 1977. Also IBM Research Report RJ1812. The introduction of fourth normal form.
• R. Fagin, "Normal Forms and Relational Database Operators", ACM SIGMOD International Conference on Management of Data, May 31-June 1, 1979, Boston, Mass. Also IBM Research Report RJ2471, Feb. 1979. The introduction of fifth normal form.
• W. Kent, "A Primer of Normal Forms", IBM Technical Report TR02.600, Dec. 1973. An early, formal tutorial on first, second, and third normal forms.
• T.-W. Ling, F.W. Tompa, and T. Kameda, "An Improved Third Normal Form for Relational Databases", ACM Transactions on Database Systems, 6(2), June 1981, 329-346. One of the first treatments of inter-relational dependencies.