Midterm 1 Concepts Relational Algebra (DB4) SQL Querying and updating (DB5) Constraints and Triggers (DB11) Unified Modeling Language (DB9) Relational.

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Relational data integrity
Normal forms - 1NF, 2NF and 3NF
SQL: The Query Language Part 2
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
primary key constraint foreign key constraint
1 Constraints, Triggers and Active Databases Chapter 9.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 SQL: Queries, Programming, Triggers Chapter 5 Modified by Donghui Zhang.
Query Optimization CS634 Lecture 12, Mar 12, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Review for Final Test Indra Budi
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
The Relational Model System Development Life Cycle Normalisation
Midterm Review Lecture 14b. 14 Lectures So Far 1.Introduction 2.The Relational Model 3.Disks and Files 4.Relational Algebra 5.File Org, Indexes 6.Relational.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Database Systems More SQL Database Design -- More SQL1.
CS405G: Introduction to Database Systems Final Review.
The Relational Model Codd (1970): based on set theory Relational model: represents the database as a collection of relations (a table of values --> file)
Database Design & ER Diagrams
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
1 The Relational Data Model, Relational Constraints, and The Relational Algebra.
©Silberschatz, Korth and Sudarshan4.1Database System Concepts Chapter 4: SQL Basic Structure Set Operations Aggregate Functions Null Values Nested Subqueries.
CSE314 Database Systems More SQL: Complex Queries, Triggers, Views, and Schema Modification Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Assume the following relational schema covering vehicle ownership data (forgive lack of key, or assume that all attributes form the key, for now). Name.
CS609 Introduction. Databases Current state? Future?
Oracle DML Dr. Bernard Chen Ph.D. University of Central Arkansas.
Unit III. Views A table that is derived from other tables Considered as a virtual table Does not store data.
Logical Database Design (1 of 3) John Ortiz Lecture 6Logical Database Design (1)2 Introduction  The logical design is a process of refining DB schema.
IST 220 Introduction to Databases Course Wrap-up.
IS 230Lecture 6Slide 1 Lecture 7 Advanced SQL Introduction to Database Systems IS 230 This is the instructor’s notes and student has to read the textbook.
1 Functional Dependencies and Normalization Chapter 15.
DBSQL 5-1 Copyright © Genetic Computer School 2009 Chapter 5 Structured Query Language.
© D. Wong Normalization  Purpose: process to eliminate redundancy in relations due to functional or multi-valued dependencies.  Decompose relation.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
CS 157B Database Systems Dr. T Y Lin. Updates 1.Red color denotes updated data (ppt) 2.Class participation will be part of “extra” credits to to “quiz.
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
1 CS 430 Database Theory Winter 2005 Lecture 5: Relational Algebra.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 The Relational Algebra and Relational Calculus.
1 Announcements Reading for next week: Chapter 4 Your first homework will be assigned as soon as your database accounts have been set up.  Expect an .
1 SQL: The Query Language. 2 Example Instances R1 S1 S2 v We will use these instances of the Sailors and Reserves relations in our examples. v If the.
CSCI 6315 Applied Database Systems Review for Midterm Exam I Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
Midterm Review. Main Topics ER model Relational model Relational Database Design (Theory)
More SQL: Complex Queries, Triggers, Views, and Schema Modification
Logical Database Design and the Rational Model
More SQL: Complex Queries,
Module 2: Intro to Relational Model
COP Introduction to Database Structures
Prepared by : Moshira M. Ali CS490 Coordinator Arab Open University
Relational Model By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany)
CS411 Database Systems 08: Midterm Review Kazuhiro Minami 1.
Schedule Today: Next After that Subqueries, Grouping and Aggregation.
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
CS411 Database Systems 08: Midterm Review Kazuhiro Minami 1.
CPSC-608 Database Systems
CPSC-310 Database Systems
Lecture 2 The Relational Model
Chapter 2: Intro to Relational Model
CS 405G: Introduction to Database Systems
CS405G: Introduction to Database Systems
Instructor: Mohamed Eltabakh
More SQL: Complex Queries, Triggers, Views, and Schema Modification
The Relational Model Textbook /7/2018.
Contents Preface I Introduction Lesson Objectives I-2
Chapter 2: Intro to Relational Model
CS4433 Database Systems Midterm Review.
Example of a Relation attributes (or columns) tuples (or rows)
Chapter 2: Intro to Relational Model
CPSC-608 Database Systems
Presentation transcript:

Midterm 1 Concepts Relational Algebra (DB4) SQL Querying and updating (DB5) Constraints and Triggers (DB11) Unified Modeling Language (DB9) Relational Design Theory (DB8) Thus far, we have studied design and implementation of relational databases, with UML as primarily a tool for (conceptual) DB design in “the large” and functional dependencies as a conceptual tool for DB design in the small. SQL is the common target language for DB implemntation, with the DB implementation being translated and elaborated from both UML and FD models. Relational algebra is a query language of theoretical interest, and it supplies some of the underlying semantics for some of SQL’s query functionality. Goal: understand the relationships between the four basic languages/frameworks that you have studied: Relational algebra SQL UML Functional Dependencies (and for the final exam, multi-valued dependencies too) Study sources include the Widom videos, class handouts/exercises, and sample DBs (i.e., Books and Dorm Energy keys and rubrics)

Relational Algebra Basic Operations Projection Selection Cross Product Join Equivalence to selection on a cross product (B) Equality join Natural join Special case with no attributes with same name/type (>=B) Theta join Properties of joins Symmetry Set Operators Intersection Union Difference Renaming Operator Rho notation Assignment notation Role in self joins Expression Trees Left Deep Expression Tress Relational algebra (RA) is a relational DB query language, of interest because it is often used to clarify and relate the semantics of actual query languages, most notably SQL, and it is the symbolic language of choice in representing (as expression trees) various query evaluation strategies, in search of the most efficient strategy. Be prepared to write RA queries that satisfy specification in English, as well as to recognize equivalences and differences between pairs of RA queries, and between RA queries and SQL queries. You may be asked to write queries from scratch, debug and complete partial queries, and identify relationships, most notably equiivalences, through multiple choice questions.

SQL queries Basic clauses SELECT clause Relation to RA projection operator FROM clause Relation to RA cross product operator WHERE clause Relation to RA selection and joining operators Aggregation and Grouping GROUP BY clause HAVING Clause Aggregation operators (SUM, COUNT, MAX, MIN, AVG) In SELECT Cause Without GROUP BY With GROUP BY In HAVING Clause Subqueries (or nested queries) In FROM clause JOIN keyword constructs In Where clause Correlated queries Logical and set operators IN and NOT IN INTERSECT, UNION, EXCEPT EXISTS and NOT EXISTS ANY and ALL Data modification (UPDATE, both forms of INSERT, DELETE) Other ORDER BY Order of clause evaluation NULL values Be prepared to write SQL queries that satisfy specification in English, to evaluate queries on sample DBs, and recognize equivalences and differences between pairs of SQL queries, and between SQL queries and RA queries. You may be asked to write queries from scratch, debug and complete partial queries, and identify relationships, most notably equiivalences, through multiple choice questions. The complexity of the queries will vary significantly across questions.

Constraints and Triggers (in SQL) Attribute constraints NOT NULL, PRIMARY KEY and UNIQUE when single attributes Tuple Constraints PRIMARY KEY and UNIQUE when single attributes CHECK Statement Syntax Evaluation when inserts or updates made General Assertions Evaluation when any change made to relevant tables FOREIGN KEY Constraints ON DELETE and ON UPDATE actions CASCADE, NO ACTION (OR RESTRICT), SET NULL, SET DEFAULT Emphasis on CASCADE and NO ACTION Be able to reason about chain of actions Triggers ON INSERT ON UPDATE ON DELETE BEFORE and AFTER (focus on AFTER) TABLE and ROW LEVEL (focus on ROW LEVEL) FOCUS on SQLite syntax Be prepared to write SQL CREATE TABLE, CREATE ASSERTION, and CREATE TRIGGER statements in SQL from English specifications, UML specifications, and functional dependency specifications. For Triggers, assume SQLite syntax, and for table and asserion creation be able to use (at your discretion) SQLite syntax and syntax of various sample DBs and keys/rubrics (Dorm energy monitoring and Books databases) that you have been given. Be able to recognize (in)correct and (in)consistent definitions, between frameworks (SQL, UML, Fds) through multiple choice questions.

Unified Modeling Language (UML) Classes Primary Keys (PK) Associations Multiplicity (or Cardinality) Association Classes Keys for Association Classes Subclasses (ISA) Coverage (Complete or Partial Coverage) Overlap (allowed or not) Composition and Aggregation Know the additional PK addition to syntax from sample Books DB and Dorm Energy key Be prepared to draw UML diagrams that are consistent with specifications in English. Be able to compare UML DB specifications with table/assertion definitions in SQL to identify inconsistencies (through multiple choice), and to translate UNL to table/assertion definitions. Study the deliverable keys and sample DB designs that have been provided.

Relational Design Theory Functional Dependencies Identifying minimal sets of FDs over a relation Determining the attribute closure of a set of given attributes given FDs over a relation Identifying keys from functional dependencies over a relation Decomposition of a relation from FDs over the relations Decomposing a relation into a collection of relations, each in BCNF Decomposing a relation into a dependency preserving decomposition see class exercise for meaning of “dependency preserving” Identifying lossless decompostions, and those that aren’t lossless (i.e., lossy) You will not be trested on multi-valued dependencies on the midterm Given a collection of functional dependencies over a relation, be prepared to do all the steps above, and know the steps necessary when asked to decompose a relation into BCNF relations, given only the relation and FDs. Be able to recognize (in)correct derivations using FDs (relative to all tasks above) through multiple choice questions.