Presentation is loading. Please wait.

Presentation is loading. Please wait.

Databases Introduction - concepts. Concepts of Relational Databases.

Similar presentations


Presentation on theme: "Databases Introduction - concepts. Concepts of Relational Databases."— Presentation transcript:

1 Databases Introduction - concepts

2 Concepts of Relational Databases

3 Domain definitions

4 Example

5

6 Catch Up Relationtablefile Attributecolumnfield Tuplerowrecord Domain Cardinality Candidate key primary keyforeign key Null Entity integrity (row have a primary key) Referential integrity ()

7 Entity Integrity Normal forms – 1,2,3 NF – Boyce-codd – 4,5 NF

8 1 st Normal Form The first normal form (1NF) is all about eliminating repeating groups of data Guaranteeing atomicity (the data is self- contained and independent). At a high level, it works by creating a primary key In short: primary key + no double values

9 2 nd Normal Form The table must be in 1NF Each column must depend on the whole key i.e. only relevant for combined keys part of columns can not be dependent of only a part of the key In short: 1NF + all values(attributes) are pointed out by the whole key

10 3 rd Normal Form The table must be in 2NF No column can have any dependency on any other non-key column You cannot have derived data In short: 2NF + all values(attributes) can only be pointed out by the whole key

11 Referential Integrity Constraints on foreign key’s – On Delete – No Action, Null(0-*), Default, Cascade(composite / 1-*) – On Update – No Action, Null, Default, Cascade – See more: http://technet.microsoft.com/en-us/library/aa902684(v=sql.80).aspx

12 Structured Query Language Data Definition Language (DDL) or data description language – Define tables, relations, triggers, stored procedures, user datatype etc. Data Manipulation Language (DML) – Request data (select) – Update data (insert, update, delete)

13 Select (Read) Select (columns | *) – From table (combination of tables = join) – Where only some values select * from scouts select id,name from scouts select id,name from scouts where 1<id AND id<10 select * from scouts where 1<id AND id<10 select * from scouts where id between 1 AND 10


Download ppt "Databases Introduction - concepts. Concepts of Relational Databases."

Similar presentations


Ads by Google