Sets and Set Operations - PowerPoint PPT Presentation

About This Presentation
Title:

Sets and Set Operations

Description:

Two sets A and B are equal if every element in A is also in B and every ... Cherry. Hamilton. 102. Jane. Block. 101. First N. Last N. accountId. Customer table ... – PowerPoint PPT presentation

Number of Views:1095
Avg rating:3.0/5.0
Slides: 15
Provided by: Dep53
Category:
Tags: cherry | operations | set | sets

less

Transcript and Presenter's Notes

Title: Sets and Set Operations


1
Sets and Set Operations
  • A set is an unordered collection of objects
    called elements
  • Explicit definition
  • Implicit definition
  • Two sets A and B are equal if every element in A
    is also in B and every element in B is also in A
    (A B)
  • A is contained in B if every element in A is also
    an element of B (A ? B) Example F ? A for
    every set A

2
Sets and Set Operations
  • The power set of A, ? (A) is the set of all
    subsets of A
  • Example ? (F) F
  • The cross product of two sets A x B (a,
    b) a ? A and b ? B order is important A x B
    ? B x A in general (x is not commutative)
  • A relation is a subset of A x B
  • cross product can be generalized

3
Sets and Set Operations
  • Set operations
  • Union A ?
    B
  • Intersection A ?
    B
  • Difference A ?
    B Complement (Universe of discourse) ?A
  • Venn diagram

4
Useful relations
  • A ? B A B - A ? B
  • DeMorgans law
  • co(A ? B) co(A) ? co(B)
  • DeMorgans law can be generalized

5
Propositions
  • A proposition P is a statement that is either
    true or false
  • Example
  • P It is raining today in Chicago
  • Compound propositions and their truth values
  • P or Q (P V Q), P and Q (P ? Q),
  • not P (P , or ?P), P ? Q, P ? Q

6
Propositions
  • DeMorgans laws
  • (P1 V V Pn ) (P1) ? ? (Pn)
  • (P1 ? ? Pn ) (P1) V V (Pn)

7
Databases
  • A database is a system that allows storage and
    manipulation of information
  • A database management system (DBMS) is a
    combination of hardware and software that allows
    organization and manipulation of the information

8
Databases
  • Why are databases important?
  • databases vs. Archiving, large
    size of data,
  • quick access and manipulation
  • How and why are databases used?
  • DB models aspects of the real world
  • Collection of data
  • logically coherent
  • Meaningful
  • 3. Designed for specific purpose

9
Uses of Databases
  • Traditional (airline reservation, school,
    hospital, )
  • Online Shopping
  • Search Engines
  • Genetic Databases
  • Geographical Information Systems

10
Sizes of Database
  • Personal (1 User), Megabytes
  • Workgroup (lt25 Users), Megabytes
  • Organizational (100-1000s), Gigabytes
  • Internet (100-1000s), Terabytes

11
How do database represent Info.
  • The physical database
  • a collection of files containing the data
    content
  • The schema
  • a specification of the physical databases
    information content and logical structure
  • The database engine
  • software that lets people access and modify the
    database contents
  • The data definition and manipulation languages
  • SQL (Structured Query Language)

12
Relational database manag. Systems (RDBMS)
  • RDBMS
  • Tables of data
  • Schema
  • Name of table
  • Names and types of attributes
  • Contents
  • Row is a fact
  • Attribute value is a characteristic

13
Example
Customer table accountId Last N. First N.
Customer table 101 Block Jane
Customer table 102 Hamilton Cherry
Customer table 103 Harrison Kate
Customer table 104 Breaux Carroll
Logical description (Schema) Customer (accountId, lastName, firstName) Customer (accountId, lastName, firstName) Customer (accountId, lastName, firstName) Customer (accountId, lastName, firstName)
Table creation statement create table Customer (accountId integer, lastName char(20), firstName char(20)) create table Customer (accountId integer, lastName char(20), firstName char(20)) create table Customer (accountId integer, lastName char(20), firstName char(20)) create table Customer (accountId integer, lastName char(20), firstName char(20))
14
Client/Server Interaction
Write a Comment
User Comments (0)
About PowerShow.com