February 7th – Exam Review

Slides:



Advertisements
Similar presentations
1 Datalog: Logic Instead of Algebra. 2 Datalog: Logic instead of Algebra Each relational-algebra operator can be mimicked by one or several Database Logic.
Advertisements

DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Query Optimization CS634 Lecture 12, Mar 12, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
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.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Midterm 1 Concepts Relational Algebra (DB4) SQL Querying and updating (DB5) Constraints and Triggers (DB11) Unified Modeling Language (DB9) Relational.
CS2008/CS5035 Exam Preparation. Dept. of Computing Science, University of Aberdeen2 Organization of Lecture Notes Group 1 - SQL –L1 – Introduction –L2.
Database Technical Session By: Prof. Adarsh Patel.
CODD’s 12 RULES OF RELATIONAL DATABASE
Chapter 16 Practical Database Design and Tuning Copyright © 2004 Pearson Education, Inc.
Object Persistence (Data Base) Design Chapter 13.
Indexes and Views Unit 7.
1 Final Review Tuesday, March 6, The Final Date: Tuesday, March 13, 2007 Time: 6:30 - 8:30 Room: EE 037 You must come to campus Open book exam.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
Lu Chaojun, SJTU 1 Extended Relational Algebra. Bag Semantics A relation (in SQL, at least) is really a bag (or multiset). –It may contain the same tuple.
Lecture 15: Query Optimization. Very Big Picture Usually, there are many possible query execution plans. The optimizer is trying to chose a good one.
There’s a particular style to it… Rob Hatton
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
CHAPTER 19 Query Optimization. CHAPTER 19 Query Optimization.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
XML: Extensible Markup Language
Practical Database Design and Tuning
Schedule Today: Jan. 28 (Mon) Jan. 30 (Wed) Next Week Assignments !!
MySQL Subquery Source: Dev.MySql.com
Top 50 SQL Interview Questions & Answers
Relational Database Design
COP Introduction to Database Structures
Prepared by : Moshira M. Ali CS490 Coordinator Arab Open University
Physical Database Design
MongoDB Er. Shiva K. Shrestha ME Computer, NCIT
Database Systems: Design, Implementation, and Management Tenth Edition
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.
ITD1312 Database Principles Chapter 5: Physical Database Design
Chapter 4 Relational Databases
Database Management  .
RELATIONAL DATABASE MODEL
Relational Algebra Chapter 4, Part A
Cse 344 May 7th – Exam Review.
Chapter 2 Database Environment.
Database management concepts
April 6th – relational algebra
Physical Database Design
Database solutions Database environment Marzena Nowakowska Faculty of Management and Computer Modelling Kielce University of Technology rooms: 3.21 C,
Practical Database Design and Tuning
Cse 344 January 29th – Datalog.
SQL: The Query Language Part 1
Relational Algebra Chapter 4, Sections 4.1 – 4.2
Introduction to Database Systems CSE 444 Lecture 23: Final Review
Lecture 1 File Systems and Databases.
Cse 344 June 1st – Final Review.
Database management concepts
CMPT 354: Database System I
Lecture 30: Final Review Wednesday, December 6, 2000.
Contents Preface I Introduction Lesson Objectives I-2
Probabilistic Databases
Relational Database Design
Chapter 8 Advanced SQL.
Distributed Database Management Systems
Database Systems: Design, Implementation, and Management Tenth Edition
Lecture 24: Final Review Friday, March 10, 2006.
Lecture 30: Final Review Wednesday, December 10, 2003.
Query Optimization.
CPSC-608 Database Systems
Introduction to Database Systems CSE 444 Lecture 23: Final Review
Final Review Friday, December 8, 2006.
Lecture 29: Final Review Wednesday, December 11, 2002.
Relationships—Topics
Presentation transcript:

February 7th – Exam Review Cse 344 February 7th – Exam Review

Examination Stations Exam Friday 3:30 – 4:50 No note sheets/calculators/computers Practice solutions out after section tomorrow Good luck!

Exam Length Production v. Verification Practice exam Short answer Simplest answer possible Problems not necessarily in order of difficulty

General Topics Databases Motivations and definitions Relational Databases SQL Relational Algebra Datalog Semi-structured Data

Databases Motivations Collections of related files Databases vs. DBMS What is stored? What is the DBMS’ responsibility?

Databases Motivations Collections of related files Databases vs. DBMS What is stored? What is the DBMS’ responsibility? Data storage and manipulation Black box thought Physical data independence

Relational Databases Motivations Breaking away from singular flat files Why/how do we break up data? Data model Schemas and keys Records and attributes Attribute types/typing

Relational Databases Primary keys What are the constraints? When do we select keys? Multiple keys Foreign keys Constraints vs. Joining Keys across different data

SQl Structure Flat tables First normal form Crosswalks and joins Breaking up data into multiple relations

SQl Code Create statements Key declarations Type declarations Insert/Delete statements Update statements Drop table

SQl Code Select From Where Group by Having Order by

SQl Code Distinct (and relation to group by) Inner vs. Outer Joining Left/Right/Full Nested loop semantics Cross join with selection Self joins Produce companies that produce gadgets and cameras

SQl Code Aggregation Count,sum,min,max,avg Null values IS NOT null Count(null) Where vs. Having

SQl Code Constructing Queries FWGHOS Subqueries In Select (Single attribute projection) In From (subquery AS, WITH AS) In Where (EXISTS, IN, ANY) Correlated vs. Non-correlated Un-nesting Finding the Witness

SQl Code Negation in subqueries Monotonicity Definitions Example Difficulties and necessity of subqueries

Relational ALgebra Set vs. Bag semantics Why bag? Query plans and RA expressions Operations (on relations, some with conditions) Union, difference Selection Projection Joins

Relational ALgebra Operations (on relations, some with conditions) Union, difference Selection Projection Joins Duplicate elimination Grouping Sorting

Relational ALgebra Operations (on relations, some with conditions) Union, difference Selection Projection Joins (remember your conditions) Duplicate elimination Grouping Sorting

Relational ALgebra How do we know SQL and RA are equally expressive? Translating one to the other Multiple RA expressions possible for same query DBMS optimization

Relational ALgebra Producing RA expressions/trees From queries Visa-versa Bag vs. Set RA Datalog is set semantic

Datalog Queries which cannot be defined in RA Recursive queries Expressing RA expressions in datalog Set semantics (procedural) “Simple, concise, elegant” Fixed point semantics Recursion builds from basecase Left/right/non-linear

Datalog Logical framework Explicitly defined intermediate results Terminology Facts and Rules Extensional vs. Intensional Predicates Head and body Head vs. Existential Variables Unsafe rules

Datalog Writing Rules Safety Base cases Aggregation and negation Variable scope Simple recursive queries Converting from RA

Semistructured Data Motivations Transactional vs. Analytical Data Data distribution Consistency Partition vs. Replication Key-value storage -> Document Storage

jSON Gives structure to data Objects and collections Self described Separate and less constrained than SQL++ Nested structure (non-first normal form)

Asterix DB Document-based NoSQL Semi-structured Over JSON objects Constraints (types, no duplicates) SQL++ Description vs. Manipulation

Asterix DB Dataverse Database – set of data currently working with Types UUID – auto generated Null vs. Missing Nested collections Open v. Closed Required v. Optional fields

Asterix DB Datasets Relations Defined over a type Must have a key Indexes Over particular attributes Speeds up 1-d selection (BTREE), 2-d selection (RTREE) and substring selection (KEYWORD)

Asterix DB SQL++ Heterogeneity Unnesting Nesting/Aggregation and non-first normal Multi-value join Supports one to many Can often be represented in SQL

Semistructured Distributed systems Short-term analysis Lower set-up costs Higher query costs (often)

Questions That’s the material Things that will be on the exam Short answer SQL Subquery Datalog Relational Algebra

Questions Probably on the exam Design motivations RA/SQL/Datalog equivalency Data model construction

Questions Probably on the exam Design motivations RA/SQL/Datalog equivalency Data model construction Not on the exam Acronyms SQL++ code

Advice Look through the exam first Try and do easiest questions first Short answer questions are worth equal amounts, varying difficulty Always be sure you understand the question More “toy” examples on midterm

Advice Go through previous exams Good judgement for questions Go through HW,OQ assignments If I’ve asked you something before, I am certain that you should know how to do it Think about how null values/your assumptions impact the interpretation of the data