Chapter31 - CSIS0278A CSIS0278A ManagementSystems...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
CSIS0278A CSIS0278A Introduction to Database  Introduction to Database  Management Systems Management Systems Lecture 3: Relational Model  Part 1 Dr. Reynold Cheng Based on the Ch. 2 notes of “Database System Concepts” by A.  Silberschatz, H. Korth & S. Sudarshan and notes by Dr. HO Wai  Shing
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
DB030:2 Overview Overview Structure of Relational Databases Relational Algebra Extended Relational Algebra Operations Operations on Modification of Databases
Image of page 2
DB030:3 Relational Model Relational Model Models DB as  mathematical relations A relation is a table-like structure Each relation has a  name . A column represents an  attribute  (or field) A row represents a  tuple  (or a record) which  has a value in each attribute.
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
DB030:4 An Example Relation An Example Relation All data in a relational database is stored in a  collection of table-like  relations Data in different relations are related through  keys What level of  abstraction are  we discussing? attributes (or columns) ... tuples (or rows)
Image of page 4
DB030:5 Attributes Attributes Each attribute of a relation has a  name  and a set of  allowed values (the  domain  of the attribute) In relational model, attribute values are  atomic , i.e.,  indivisible multi-valued,  composite attribute values are not atomic The special value  null  is a member of every domain denote unknown or undefined values Null value causes complications in database  definitions – let us ignore null value in the moment
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
DB030:6 Relation Schema & Instance Relation Schema & Instance A 1 , A 2 , …, A n   are  attributes  includes its name and domain. R = ( A 1 , A 2 , …, A n )  is a  relation schema e.g.    Customer = (customer_name:   char(60),  customer_street: char(60),   customer_city:   char(60)) r ( R )  denotes a  relation   instance  on  R e.g., customer (Customer_schema) relation instance  is the collection of tuples of a   relation at a particular time.
Image of page 6
DB030:7 Relation Relation We use “Relation” to denote a table-like structure in  relational model . relation = relation schema + relation instance A relation  R  indicates both its schema and instance.
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
DB030:8 Relations are Unordered Relations are Unordered Since relation is a set, the order of tuples in a relation is  irrelevant In a relation, no two tuples are the same  The following tables / relation instances are the same:
Image of page 8
DB030:9 Database Database A relational database consists of  multiple relations An enterprise contains different relations: E.g., Account :     info. about accounts Depositor : info. about which customer                                       owns which account  Customer :  info. about customers
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
DB030:10 E-R Diagram for the Banking  E-R Diagram for the Banking  Enterprise Enterprise
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern