Top Banner

Click here to load reader

of 30

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 1. Prepared by:
    Noha Mostafa Bakry
    Introduction to relational database

2. Where are relational databases?
You cannot avoid it and its everywhere!
You can say it actually makes the current society and your life work!
Banking/Credit card /Social Security Info
Online shopping/booking
3. 4. 5. 6. What are relational databases?
A relational database stores all its data inside tables, and nothing more.
All operations on data are done on the tables themselves or produces another tables as the result.
You never see anything except for tables.
7. 8. Create relational database?
9. 10. To create table must determine field name and data type and select primary key for table which must be unique and used for relations .
11. Table 2 contain ID as foreign key
12. Relation between tables
1-one to one .
2-one to many.
3 many to many.
13. One to one
In one-to-one relationship, two tables are associated in such a way that each record in first table can have only one matching record in second table, and each record in second table can have only one matching record in first table.
14. 15. One to many
In one-to-many relationship, two tables are associated in such a way that each record in the first table can have many matching records in second table, but a record in second table has only one matching record in first table.
16. 17. Manyto many
In many-to-many relationship, two tables are associated in such a way that each record in the first table can have many matching records in second table, and a record in second table can have many matching records in first table.
18. 19. Relation between tables in our example is one to many.
20. What is E-R diagram?
Shortfor entity relationship diagram.
Used to representrelations between tables andrelation types.
21. What is Query ?
A database query is a request for information from a database.
22. 23. normalization

  • Normalization is the process of efficiently organizing data in a database.

24. There are two goals of the normalization process: 1-eliminating redundant data ( storing the same data in more than one table) .
2- ensuring data dependencies (only storing related data in a table).
25. First normal form

  • Eliminate duplicativecolumnsfrom the same table.

26. Create separate tables for each group of related data and identify each rowwith a unique column or set of columns (the primary key).