6.
Models, Schemas and States• A data model defines the constructs available for defining a schema – defines possible schemas• A schema defines the constructs available for storing the data – defines database structure – limits the possible database states• A database state (or instance) is all the data at some point in time  the database content

7.
Models, Schemas and States• data model – fixed by the DBMS – Defined by DB designer• schema – defined by the DB designer – generally fixed once defined *• database state – changes over time due to user updates * schema modifications are possible once the database is populated, but this generally causes difficulties

9.
Relation Schemas• A relation is defined by a name and a set of attributes• Each attribute has a name and a domain – a domain is a set of possible values – all domains are sets of atomic values – RDM does not recommend complex data types – domains may contain a special null value

10.
Definition: Relation Schema• Relation Schema R(A1, A2, … , An) – R is the relation name – A1 … An are the attribute names• Domains are denoted by dom(Ai)• degree = the number of attributes

11.
Characteristics of Relations• A relation is a set – tuples are unordered – no duplicate tuples• Attribute values within tuples are ordered – values are matched to attributes by position

12.
Characteristics of Relations• Values in tuples are atomic• Each Column has distinct name• The values of the attribute come from the same domain• The order of the column is immaterial• Each row/tuple/record is distinct

13.
SQL: Relation States• A relation is viewed as a table• The attributes define the columns of the table• Each row in the table holds related values for each attribute – a row often represents a conceptual entity (object)• Values in each column must come from the domain of the attribute