













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














Requirement Gathering and Analysis Know what user want and what will be stored in the database Conceptual Design Visualize the conceptual design of the database using Entity Relationship Model Logical Design Logical Database representation using Relational Model Physical Design Physical database design using SQL and Implementation using a DBMS
Tables/Relations Relations are saved in the format of Tables. This format stores the relation among entities. Must have a distinct name Tuples/Rows A single row of a table, which contains a single record for that relation Attribute An attribute is a named column of a relation Must have a distinct name
Domain
Example: ◦ name = { Jones, Smith, Paul, Lindsay , …} ◦ street = { Main, North, Park , …} ◦ city = { London, Southampton, Liverpool , …} Then Relation is = { ( Jones, Main, London ), ( Smith, North, Southampton ), ( Paul, North, Liverpool ),( Lindsay, Park, London ) } We can get this by a cartesian product of name x street x city
Attribute values are (normally) required to be atomic ; that is, indivisible ◦ E.g. the value of an attribute can be an account number, but cannot be a set of account numbers Domain is said to be atomic if all its members are atomic NULL is used to represent the values of attributes that may be unknown or may not apply to a tuple
Each cell of the relation contains exactly one atomic (single) value The values of an attribute are all from the same domain Each tuple is distinct. There are no duplicate tuples The order of attributes has no significance The order of tuples has no significance, theoretically. (However, in practice, the order may affect the efficiency of accessing tuples.)
Attrib1 Attrib2 Attrib X Y Z A B C Attrib2 Attrib1 Attrib Y X Z B A C Attrib3 Attrib1 Attrib Z X Y C A B Attrib1 Attrib2 Attrib A B C X Y Z Attrib2 Attrib1 Attrib B A C Y X Z Attrib3 Attrib1 Attrib C A B Z X Y
Example: Consider the CAR relation schema: ◦ STUDENT(Index Number, Name, Birthday,NIC, Academic Year) ◦ STUDENT has two keys (minimal superkeys): ◦ Key1 = {Index Number} ◦ Key2 = {NIC} ◦ Both are also superkeys of STUDENT ◦ {Index Number, Birthday} is a superkey but not a key. In general: ◦ Any key is a superkey (but not vice versa) ◦ Any set of attributes that includes a key is a superkey ◦ A minimal superkey is also a key
COMPANY Database Schema
Entity Integrity: ◦ The primary key attributes PK of each relation schema R in S cannot have null values in any tuple. ◦ This is because primary key values are used to identify the individual tuples. ◦ t[PK] null for any tuple t in r(R) ◦ If PK has several attributes, null is not allowed in any of these attributes ◦ Note: Other attributes of R may be constrained to disallow null values, even though they are not members of the primary key.
Each relation schema can be displayed as a row of attribute names The name of the relation is written above the attribute names The primary key attribute (or attributes) will be underlined A foreign key (referential integrity) constraints is displayed as a directed arc (arrow) from the foreign key attributes to the referenced table’s Primary Key