1 / 8

Relational Database Concepts

Relational Database Concepts. relational database example. contain tables tables contain records (rows) records are broken into columns (fields). first design for the MyQuotes database. Are records 1 and 4 from the same source?. Quotes table:. a better design for the MyQuotes database.

etienne
Télécharger la présentation

Relational Database Concepts

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Relational Database Concepts db.ppt

  2. relational database example • contain tables • tables contain records (rows) • records are broken into columns (fields) db.ppt

  3. first design for the MyQuotes database • Are records 1 and 4 from the same source? Quotes table: db.ppt

  4. a better design for the MyQuotes database Quotes1 table: Sources1 table: SELECT Quotes1.QuoteBody, Quotes1.FK_SourceID, Sources1.PK_SourceID, Sources1.SourceBody FROM Quotes1, Sources1 WHERE Quotes1.FK_SourceID=Sources1.PK_SourceID db.ppt

  5. “inner join” SQL statement SELECT Quotes1.QuoteBody, Quotes1.FK_SourceID, Sources1.PK_SourceID, Sources1.SourceBody FROM Quotes1, Sources1 WHERE Quotes1.FK_SourceID=Sources1.PK_SourceID theAnswer = myResultSet.getString(1) + " " + myResultSet.getString(4); “join” because it gets data from two different tables “inner” because each table only returns matching records db.ppt

  6. tables represent “relationships” • one to one relationship (1 table) • a table of Persons may directly contain the social security number • one to many relationship (2 tables) • a table of Sources • a table of Quotes • each Quotes record points to one Sources record • many to many relationship (3 tables) • a table of Persons • a table of Skills • a table of Person-Skills • for each skill that a person has, there is a record here • for each person that has a skill, there is a record here db.ppt

  7. Relational Database Concepts • Relationships • Contraints • Triggers • Stored procedures • Tables • Rows (Records) • Columns (Fields) • Views • Indexes • Clustered indexes • Non-clustered indexes • Keys • Primary keys • Composite keys • Foreign keys • Locking • optimistic • pessimistic • Isolation Levels (for transactions) • gets complicated! db.ppt

  8. the end of this PowerPoint file Hooray! db.ppt

More Related