Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 2012 Midterm Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account.

Slides:



Advertisements
Similar presentations
Introduction to Database System Wei-Pang Yang, IM.NDHU, Final Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account.
Advertisements

Relational Databases - Amit Bhawnani & Nimesh Shah.
©Silberschatz, Korth and Sudarshan6.1Database System Concepts Chapter 6: Integrity (and Security) Domain Constraints Referential Integrity Assertions Triggers.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
SQL Sangeeta Devadiga CS157A, Fall Outline Background Data Definition Basic Structure Set Operation.
©Silberschatz, Korth and Sudarshan3.1Database System Concepts Chapter 3: Relational Model Structure of Relational Databases Relational Algebra Tuple Relational.
Database Management System (DBMS)
©Silberschatz, Korth and Sudarshan4.1Database System Concepts Chapter 4: SQL Basic Structure Set Operations Aggregate Functions Null Values Nested Subqueries.
©Silberschatz, Korth and Sudarshan4.1Database System Concepts Modification of the Database – Deletion Delete all account records at the Perryridge branch.
1 CMSC424, Spring 2005 CMSC424: Database Design Lecture 7.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. SQL - part 2 - Database Management Systems I Alex Coman, Winter 2006.
MySQL Tutorial (2) Introduction to Database. Banking Example branch (branch-name, branch-city, assets) customer (customer-name, customer-street, customer-city)
Dr. Kalpakis CMSC 461, Database Management Systems Introduction.
Chapter 6: Integrity Objective Key Constraints (Chapter 2) Cardinality Constraints (Chapter 2) Domain Constraints Referential Integrity Assertions Triggers.
Chapter 3: SQL Data Definition Language Data Definition Language Basic Structure of SQL Basic Structure of SQL Set Operations Set Operations Aggregate.
Introduction to DBMS Purpose of Database Systems View of Data
CS 370 Database Systems Lecture 13 Introduction to SQL.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
©Silberschatz, Korth and Sudarshan6.1Database System Concepts Chapter 6: Integrity and Security Domain Constraints Referential Integrity Assertions Triggers.
Introduction Introduction Database Management Systems Purpose of Database Systems View of Data Data Models Database Languages Database Users Database Administrator.
Chapter 4: Advanced SQL. 4.2Unite International CollegeDatabase Management Systems Chapter 4: Advanced SQL SQL Data Types and Schemas Integrity Constraints.
Holliday - COEN 1781 Introduction to SQL. Holliday - COEN 1782 DB Tables and SQL The data is stored in the database in relations or tables Data types.
Introduction to Database System Wei-Pang Yang, IM.NDHU, Midterm Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account.
Lecture 6 Structured Query Language SQL Lecture 6 Structured Query Language SQL Instructor: Haya Sammaneh.
3.1 Chapter 3: SQL Schema used in examples p (omit 3.8.2, , 3.11)
Structured Query Language 2 Presented by: Annisa, M.Kom. Source: Database System Concepts 5 th edition.
Relational Model: Examples. Banking Example branch (branch_name, branch_city, assets) customer (customer_name, customer_street, customer_city) account.
-- Introduction to database principles Maoying Wu March 25, 2013 Chapter 4: Advanced SQL (1)
1 Session 3 Welcome: To session 3- the first learning sequence “ Introduction to Relational Model“ Recap : In the previous learning sequences, we discussed.
Database System Concepts, 5 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Relational.
©Silberschatz, Korth and Sudarshan4.1Database System Concepts Modification of the Database – Deletion Delete all tuples from the loan relation. delete.
Source: Database System Concepts, Silberschatz etc Edited: Wei-Pang Yang, IM.NDHU, Introduction to Database CHAPTER 4 Advanced SQL SQL Data.
Chapter 1 Introduction Yonsei University 1 st Semester, 2015 Sanghyun Park.
Introduction to Database System Wei-Pang Yang, IM.NDHU, Final Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account.
Relational Model By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
Chapter 8: SQL. Data Definition Modification of the Database Basic Query Structure Aggregate Functions.
國立東華大學 資訊管理學系 資料庫管理 試題 Wei-Pang Yang, IM.NDHU, /6/20 Final Test-1 Suppose we have a relationship set borrower between customer and loan as shown.
Source: Database System Concepts, Silberschatz etc Edited: Wei-Pang Yang, IM.NDHU, Introduction to Database CHAPTER 5 Other Relational Languages.
Chapter 2: Relational Model II Relational Algebra basics Relational Algebra basics.
2.1 Chapter 2: Relational Model. 2.2 Chapter 2: Relational Model Structure of Relational Databases Fundamental Relational-Algebra-Operations Additional.
Source: Database System Concepts, Silberschatz etc Edited: Wei-Pang Yang, IM.NDHU, Introduction to Database CHAPTER 2 RELATIONAL MODEL 2.1.
Chapter 2 Introduction to Relational Model. Example of a Relation attributes (or columns) tuples (or rows) Introduction to Relational Model 2.
©Silberschatz, Korth and Sudarshan3.1Database System Concepts Chapter 3: Relational Model Structure of Relational Databases Relational Algebra Extended.
Chapter 1 Introduction Yonsei University 1 st Semester, 2014 Sanghyun Park.
MySQL Tutorial Introduction to Database. Introduction of MySQL  MySQL is an SQL (Structured Query Language) based relational database management system.
Relational Algebra HW2 Turn in as a hardcopy at the start of next class period. You may work this assignment in groups.
Mr.Prasad Sawant, MIT Pune India Introduction to DBMS.
©Silberschatz, Korth and Sudarshan1 Structured Query Language (SQL) Data Definition Language Domains Integrity Constraints.
Index in Database Unit 12 Index in Database 大量資料存取方法之研究 Approaches to Access/Store Large Data 楊維邦 博士 國立東華大學 資訊管理系教授.
Introduction to Database System Wei-Pang Yang, IM.NDHU, Midterm Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account.
Chapter 3: Relational Model  Structure of Relational Databases  Normal forms (chap. 7)  Reduction of an E-R Schema to Relational (Sect. 2.9)  Relational.
1 Session 3 Welcome: To session 3-the fourth learning sequence “Relational algebra “ Recap : In the previous learning sequences, we discussed the four.
Source: Database System Concepts, Silberschatz etc Edited: Wei-Pang Yang, IM.NDHU 3-1 Introduction to Database CHAPTER 3 SQL Data Definition Basic.
ASET 1 Amity School of Engineering & Technology B. Tech. (CSE/IT), III Semester Database Management Systems Jitendra Rajpurohit.
Introduction to Database System Wei-Pang Yang, IM.NDHU, Midterm Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account.
Lecture on Database Management System
Introduction to Database System Wei-Pang Yang, IM.NDHU, Midterm Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account.
Databases Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
©Silberschatz, Korth and Sudarshan 1.1 Database System Concepts قواعد البيانات Data Base قواعد البيانات CCS 402 Mr. Nedal hayajneh E- mail
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
CHAPTER 1: INTRODUCTION Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Storage Management Database.
©Silberschatz, Korth and Sudarshan6.1Database System Concepts Chapter 6: Integrity Constraints Domain Constraints Referential Integrity Assertions Triggers.
Query Languages Language in which user requests information from the database. Categories of languages Procedural Non-procedural, or declarative “Pure”
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Integrity Constraints
國立東華大學試題 系所:資訊管理學系 科目:資料庫管理 第1頁/共6頁
Question 1: Basic Concepts (40 %)
Example: Banking Database
Example: Banking Database
Presentation transcript:

Introduction to Database System Wei-Pang Yang, IM.NDHU, Midterm Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account 存款帳 3. depositor 存款戶 6. loan 貸款帳 4. borrower 貸款戶 分公司 國立東華大學試題 : 資料庫管理 資訊管理學系

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 1: Answer the following Terms (30%) a)Goal of a DBMS. b)Functions of a DBMS c)Relational Database d)Data Dictionary in DBMS e)Schemas and Instances f)Physical Data Independence g)Query Processor h)Storage Manager i)Database administrator j)Authorization and Integrity Manager k)Query evaluation engine l)Three levels of an architecture for a database system m)Relational-Algebra Operation: Cartesian product n)Relational-Algebra Operation: Natural Join o)Aggregate Functions 2012 Midterm Test-2

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 2: Data-Definition Language (10%) Consider the following Table Definition: a) What is the purpose to define: primary key (branch-name), b) What is the purpose to define: check (assets >= 0) c) 這些定義的指令存在那裡 ? 有何用途 ? 如何使用 ? create table branch (branch-namechar(15), branch-citychar(30), assets integer, primary key (branch-name), check (assets >= 0)) 2012 Midterm Test-3

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 3: Flow of Query Processing (10%) Explain the following three tasks: a) Parsing and translation b) Optimization c) Evaluation 2012 Midterm Test-4

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 4: Using the following Example to explain the Referential Integrity Constraint (10%) create table account (account-numberchar(10), branch-namechar(15), balanceinteger, primary key (account-number), create table depositor (customer-namechar(20), account-numberchar(10), primary key (customer-name, account-number), foreign key (account-number) references account, 3. account 4. depositor references ( 存款戶 ) ( 存款帳 ) 2012 Midterm Test-5

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 5: Updates (10%) Query: Increase all accounts with balances over $700 by 6%, all other accounts receive 5%. Consider two update statements: update account set balance = balance  1.06 where balance > 700 update account set balance = balance  1.05 where balance  700 a) Give the account table after execute the above two update statements. b) The order is important, why? c) Please write a SQL by using the case statement for above update statements Midterm Test-6

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 account Question 6: Definition of Relation (10%) Relation: Formally, given sets D 1, D 2, …. D n D 1 x D 2 x … x D n = {(a 1, a 2, …, a n ) | where each a i  D i } a Relation r is a subset of D 1 x D 2 x … x D n Thus a relation is a set of n-tuples (a 1, a 2, …, a n ) where each a i  D i D 1 = { } D 2 = { } D 3 = { } D 1 x D 2 x D 3 = account = a) Write b) Write c) Why the Relation r is a subset of D 1 x D 2 x … x D n, please explain it by using above example Midterm Test-7

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Query: “ Find the names of all customers who have a loan at the Perryridge branch.  Query 2  customer-name (  loan.loan-number = borrower.loan-number ( (  branch-name = “Perryridge” (loan)) x borrower) )  Query 1  customer-name (  branch-name = “Perryridge” (  borrower.loan-number = loan.loan-number (borrower x loan)) ) Question 7: Comparison (10%) c) Which one is better? Why? a) ? b) ? 2012 Midterm Test-8

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 8: multiple relations vs. Single relation (10%) Database: A database consists of multiple relations Information about an enterprise is broken up into parts, with each relation storing one part of the information E.g.: account: stores information about accounts depositor: stores information about which customer owns which account customer: stores information about customers If we store all information as a single relation such as bank(account-number, balance, customer-name,..) Question: The table bank may contain a lot of repetition of information and null values, why? … bank 2012 Midterm Test-9

Introduction to Database System Wei-Pang Yang, IM.NDHU, 2010 Question 9: Database System vs. File System (10%) In the early days, database applications were built on top of file systems Drawbacks of using file systems to store data are: a)Data redundancy and inconsistency, why? b)Difficulty in accessing data, why? c)Integrity problems, why? d)Application program unstable, why? e)Database systems offer solutions to all the above problems, why? 2012 Midterm Test-10