Lecture 1: Introduction to Relational Databases Databases: Schema (rules about the data) + Database instance (actual data) Database Management Systems (DBMS): a tool to manage data Postgresql/Oracle/SQLLite/etc Stable storage Data manipulation/querying Transaction management Relational Databases - stores a set of relations A relation is a class of objects we want to store information about Relation Name Attributes - Domain of possible values 1. A relation stores a set of tuples ---- 2. Each attribute in a relation is a simple value 3. Each relations has one or more keys: A key is a minimal set of attributes such that no two tuples can have the same value for the key Data model: Relation: Book Attributes: Title: string Author: string* NumberofPages: int YearPublished: int PublisherName: string* Genre: string* SeriesName: string Dewey#: string ISBN13: number(13) Book Title Author Genre ---------------------------------------------------------------- DBS Systems Hector Garcia-Molina Textbook DBS Systems Hector Garcia-Molina Science DBS Systems Jennifer Widom Textbook DBS Systems Jennifer Widom Science DBS Systems Jeff Ullman Textbook DBS Systems Jeff Ullman Science --------- Relation: StudentsInClass(Name, Major, RIN) Database instance (tuples) StudentsInClass Name Major RIN ------------------------------------ River CSCI 1 Mountain ECSE 2 Rain CSCI 3 Cloud GSAS 4 Sunshine PHL 5 It is true that (River, CSCI) is a StudentsInClass