DOC PREVIEW
SJSU CS 157A - 26FL11CS157Mid2Review

This preview shows page 1-2-3-4-5-32-33-34-35-64-65-66-67-68 out of 68 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 68 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Midterm 2 RevisionSlide 2Slide 3Slide 4Slide 5E-R Diagram for the Banking EnterpriseDetermining Keys from E-R SetsChapter 3: Relational ModelBasic StructureAttribute TypesRelation SchemaRelation InstanceRelations are UnorderedKeysQuery LanguagesRelational AlgebraSelect Operation – ExampleSelect OperationProject Operation – ExampleProject OperationUnion Operation – ExampleUnion OperationSet Difference Operation – ExampleSet Difference OperationCartesian-Product Operation-ExampleCartesian-Product OperationComposition of OperationsRename OperationBanking ExampleExample QueriesSlide 31Slide 32Slide 33Slide 34Additional OperationsSet-Intersection OperationSet-Intersection Operation - ExampleNatural-Join OperationNatural Join Operation – ExampleDivision OperationDivision Operation – ExampleAnother Division ExampleDivision Operation (Cont.)Assignment OperationSlide 45Slide 46Extended Relational-Algebra-OperationsGeneralized ProjectionAggregate Functions and OperationsAggregate Operation – ExampleSlide 51Aggregate Functions (Cont.)Outer JoinOuter Join – ExampleSlide 55Slide 56Null ValuesSlide 58Slide 59Modification of the DatabaseDeletionDeletion ExamplesInsertionInsertion ExamplesUpdatingUpdate ExamplesSlide 67Slide 68Midterm 2 RevisionMidterm 2 RevisionProf. Sin-Min LeeDepartment of Computer ScienceSan Jose State University©Silberschatz, Korth and Sudarshan3.2Database System Concepts1. Know the difference between a database and a DBMS Functions/advantages and disadvantages of a DBMS 2.Understand the meaning of all of the E-R symbols .3.Know the basis of the mathematical relation and the properties of a relation. Understand and recognize symbols for Selection, projection, Cartesian product, union and set difference. Understand the difference between an inner join and an outerjoin 4.Know the characteristics of superkey, candidate key, primary key, and foreign key. 5.Know the rules of relational integrity and referential integrity. 6. Be able to recognize and read relational algebra statements with the primary operators. 7.Be able to recognized simple relational calculus statements (like the ones used in class) and understand the difference between the algebra and calculus. Materials cover in Exam.©Silberschatz, Korth and Sudarshan3.3Database System ConceptsMultiple Choice Problems©Silberschatz, Korth and Sudarshan3.4Database System Concepts©Silberschatz, Korth and Sudarshan3.5Database System Concepts©Silberschatz, Korth and Sudarshan3.6Database System ConceptsE-R Diagram for the Banking EnterpriseE-R Diagram for the Banking Enterprise©Silberschatz, Korth and Sudarshan3.7Database System ConceptsDetermining Keys from E-R SetsDetermining Keys from E-R SetsStrong entity set. The primary key of the entity set becomes the primary key of the relation.Weak entity set. The primary key of the relation consists of the union of the primary key of the strong entity set and the discriminator of the weak entity set.Relationship set. The union of the primary keys of the related entity sets becomes a super key of the relation.For binary many-to-one relationship sets, the primary key of the “many” entity set becomes the relation’s primary key.For one-to-one relationship sets, the relation’s primary key can be that of either entity set.For many-to-many relationship sets, the union of the primary keys becomes the relation’s primary key©Silberschatz, Korth and Sudarshan3.8Database System ConceptsChapter 3: Relational ModelChapter 3: Relational ModelStructure of Relational DatabasesRelational AlgebraTuple Relational CalculusDomain Relational CalculusExtended Relational-Algebra-Operations©Silberschatz, Korth and Sudarshan3.9Database System ConceptsBasic StructureBasic StructureFormally, given sets D1, D2, …. Dn a relation r is a subset of D1 x D2 x … x DnThus a relation is a set of n-tuples (a1, a2, …, an) where ai  DiExample: ifcustomer-name = {Jones, Smith, Curry, Lindsay}customer-street = {Main, North, Park}customer-city = {Harrison, Rye, Pittsfield}Then r = { (Jones, Main, Harrison), (Smith, North, Rye), (Curry, North, Rye), (Lindsay, Park, Pittsfield)} is a relation over customer-name x customer-street x customer-city©Silberschatz, Korth and Sudarshan3.10Database System ConceptsAttribute TypesAttribute TypesEach attribute of a relation has a nameThe set of allowed values for each attribute is called the domain of the attributeAttribute values are (normally) required to be atomic, that is, indivisibleE.g. multivalued attribute values are not atomicE.g. composite attribute values are not atomicThe special value null is a member of every domainThe null value causes complications in the definition of many operations we shall ignore the effect of null values in our main presentation and consider their effect later©Silberschatz, Korth and Sudarshan3.11Database System ConceptsRelation SchemaRelation SchemaA1, A2, …, An are attributesR = (A1, A2, …, An ) is a relation schemaE.g. Customer-schema = (customer-name, customer-street, customer-city)r(R) is a relation on the relation schema RE.g. customer (Customer-schema)©Silberschatz, Korth and Sudarshan3.12Database System ConceptsRelation InstanceRelation InstanceThe current values (relation instance) of a relation are specified by a tableAn element t of r is a tuple, represented by a row in a tableJonesSmithCurryLindsaycustomer-nameMainNorthNorthParkcustomer-streetHarrisonRyeRyePittsfieldcustomer-citycustomerattributestuples©Silberschatz, Korth and Sudarshan3.13Database System ConceptsRelations are UnorderedRelations are Unordered Order of tuples is irrelevant (tuples may be stored in an arbitrary order) E.g. account relation with unordered tuples©Silberschatz, Korth and Sudarshan3.14Database System ConceptsKeysKeysLet K  RK is a superkey of R if values for K are sufficient to identify a unique tuple of each possible relation r(R) by “possible r” we mean a relation r that could exist in the enterprise we are modeling.Example: {customer-name, customer-street} and {customer-name} are both superkeys of Customer, if no two customers can possibly have the same name.K is a candidate key if K is minimalExample: {customer-name} is a candidate key for Customer, since it is a superkey {assuming no two customers can possibly have the same name), and no subset of it is a


View Full Document

SJSU CS 157A - 26FL11CS157Mid2Review

Documents in this Course
SQL

SQL

18 pages

Lecture

Lecture

44 pages

Chapter 1

Chapter 1

56 pages

E-R Model

E-R Model

16 pages

Lecture

Lecture

48 pages

SQL

SQL

15 pages

SQL

SQL

26 pages

Lossless

Lossless

26 pages

SQL

SQL

16 pages

Final 3

Final 3

90 pages

Lecture 3

Lecture 3

22 pages

SQL

SQL

25 pages

Load more
Download 26FL11CS157Mid2Review
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view 26FL11CS157Mid2Review and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view 26FL11CS157Mid2Review 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?