Download presentation
Presentation is loading. Please wait.
Published byTheodora Holland Modified over 9 years ago
1
Introduction to Database System Wei-Pang Yang, IM.NDHU, 2008 2008 Midterm Test-1 Example: Banking Database 1. branch 2. customer 客戶 ( 存款戶, 貸款戶 ) 5. account 存款帳 3. depositor 存款戶 6. loan 貸款帳 4. borrower 貸款戶 分公司 國立東華大學試題 : 資料庫管理 資訊管理學系 2008.4.22
2
Introduction to Database System Wei-Pang Yang, IM.NDHU, 2008 2008 Midterm Test-2 Question 1: Database System vs. File System (15%) In the early days, database applications were built on top of file systems Drawbacks of using file systems to store data: a)Data redundancy and inconsistency, why? b)Difficulty in accessing data, why? c)Integrity problems, why? d)Security problems, why? e)Database systems offer solutions to all the above problems, why?
3
Introduction to Database System Wei-Pang Yang, IM.NDHU, 2008 2008 Midterm Test-3 Question 2: About Keys (12%) a)Explain what is the Superkey? b)List all possible superkeys from relation table account in the page 1. c)Explain what is the Candidate key? d)List all possible Primary Key from relation table account. e)Explain what is the Foreign key? f)Refer to page 1, what attribute in account should define as a Foreign Key? Why? 5. account 存款帳
4
Introduction to Database System Wei-Pang Yang, IM.NDHU, 2008 2008 Midterm Test-4 account Question 3: Definition of Relation (15%) 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.
5
Introduction to Database System Wei-Pang Yang, IM.NDHU, 2008 2008 Midterm Test-5 Question 4: Composition of Operations (10%) We can build expressions by using multiple operations Example: expression: A=C (r x s) op1: r x s op2: A=C (r x s) AB 1111222211112222 CD 10 20 10 20 10 E aabbaabbaabbaabb ABCDE 122122 20 aabaab AB 1212 r s CDE 10 20 10 aabbaabb a) ? b) ?
6
Introduction to Database System Wei-Pang Yang, IM.NDHU, 2008 2008 Midterm Test-6 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 5: Comparison (9%) c) Which one is better? Why? a) ? b) ?
7
Introduction to Database System Wei-Pang Yang, IM.NDHU, 2008 2008 Midterm Test-7 Assume we have two queries: Q1 and Q2 as follows: Question 6: View (15%) b) If we want to add a new tuple to big-customer insert into big-customer values (‘A-999’, ‘Hualien’) Where the insertion values will be placed? Draw a table to show your answer. a) Draw the result of Q2 c) What are the advantages of the View? Q1. create view big-customer as (select account-number, branch-name from account where balance > 500 Q2 select * from big-customer
8
Introduction to Database System Wei-Pang Yang, IM.NDHU, 2008 2008 Midterm Test-8 Question 7: Fill in the following components to the Overall System Structure and explain them in details (24%) low-level data stored database 1. Query Processor 2. Storage Manager 3. Database administrator 4. Application programmers 5. DDL interpreter 6. Compiler and Linker 7. Buffer manager 8. Data dictionary 9. Index 10. Data 11. Na ï ve users 12. Application programs
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.