CS263 Lec. 2: Three- schema architecture for database development Conceptual Schema (during the Analysis phase) is a detailed specification of the overall.

Slides:



Advertisements
Similar presentations
Chapter 4 5 6_ SQL SQL Is: Structured Query Language
Advertisements

Technical Architectures
Chapter 7: Introduction to SQL
IMS1907 Database Systems Week 5 Database Systems Architecture.
© 2007 by Prentice Hall 1 Chapter 8: Advanced SQL Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
IS 4420 Database Fundamentals Chapter 8: Advanced SQL Leon Chen
Components and Architecture CS 543 – Data Warehousing.
1 © Prentice Hall, 2002 Chapter 7: SQL Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
1 IS 4420 Database Fundamentals Chapter 7: Introduction to SQL Leon Chen.
Concepts of Database Management Sixth Edition
A Guide to MySQL 7. 2 Objectives Understand, define, and drop views Recognize the benefits of using views Use a view to update data Grant and revoke users’
A Guide to SQL, Seventh Edition. Objectives Understand, create, and drop views Recognize the benefits of using views Grant and revoke user’s database.
Client/Server Architecture
Database Development Process
Tiered architectures 1 to N tiers. 2 An architectural history of computing 1 tier architecture – monolithic Information Systems – Presentation / frontend,
Database Management Systems (DBMS)
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 12 Slide 1 Distributed Systems Architectures.
Copyright © 2014 Pearson Education, Inc. 1 CHAPTER 7: ADVANCED SQL Essentials of Database Management Jeffrey A. Hoffer, Heikki Topi, V. Ramesh.
Chapter 6: Introduction to SQL
Lecture On Database Analysis and Design By- Jesmin Akhter Lecturer, IIT, Jahangirnagar University.
CSC271 Database Systems Lecture # 4.
Chapter 4 The Relational Model 3: Advanced Topics Concepts of Database Management Seventh Edition.
Database System Concepts and Architecture Lecture # 2 21 June 2012 National University of Computer and Emerging Sciences.
Database Application Security Models Database Application Security Models 1.
1 Chapter 7 Introduction to SQL. 2 Objectives Definition of terms Interpret history and role of SQL Define a database using SQL data definition language.
1 Chapter 8: Advanced SQL. Chapter 8 2 Processing Multiple Tables – Joins Join – a relational operation that causes two or more tables with a common domain.
Chapter 7 © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer, V. Ramesh, Heikki Topi.
© 2007 by Prentice Hall 1 Chapter 7: Introduction to SQL Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
Chapter 6 Database Administration
The Client/Server Database Environment Ployphan Sornsuwit KPRU Ref.
Database Architectures Database System Architectures Considerations – Data storage: Where do the data and DBMS reside? – Processing: Where.
1 Chapter 8: Advanced SQL Modern Database Management Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
1 © Prentice Hall, 2002 Chapter 8: Advanced SQL Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
Modern Database Management Chapter 8: Advanced SQL.
Chapter 2 Views. Objectives ◦ Create simple and complex views ◦ Creating a view with a check constraint ◦ Retrieve data from views ◦ Data manipulation.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Lec 3- B Database Integrity 1. Overview Define a database using SQL data definition language Work with Views Write single table queries Establish referential.
1 Chapter 6 Database Administration. 2 Introduction Database administration The process of managing a database Database administrator A person or an entire.
© 2005 by Prentice Hall 1 Chapter 7: Introduction to SQL Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
Chapter 7: Introduction to SQL
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 2-1 Data Models Data Model: A set.
Chapter 2 Database System Concepts and Architecture Dr. Bernard Chen Ph.D. University of Central Arkansas.
Chapter 7: advanced sql Jeffrey A. Hoffer, V. Ramesh, Heikki Topi
Chapter 13 Views Oracle 10g: SQL. Oracle 10g: SQL2 Objectives Create a view, using CREATE VIEW command or the CREATE OR REPLACE VIEW command Employ the.
SQL Overview Structured Query Language
 Distributed Database Concepts  Parallel Vs Distributed Technology  Advantages  Additional Functions  Distribution Database Design  Data Fragmentation.
Session id: Darrell Hilliard Senior Delivery Manager Oracle University Oracle Corporation.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Querying Single Tables with SQL.
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
System Architecture & Hardware Configurations Dr. D. Bilal IS 582 Spring 2008.
CSC314 DAY 8 Introduction to SQL 1. Chapter 6 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SQL OVERVIEW  Structured Query Language  The.
1 Database Fundamentals Introduction to SQL. 2 SQL Overview Structured Query Language The standard for relational database management systems (RDBMS)
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Lecture 7: Introduction to SQL Modern Database Management 9 th Edition Jeffrey A. Hoffer,
CSC314 DAY 9 Intermediate SQL 1. Chapter 6 © 2013 Pearson Education, Inc. Publishing as Prentice Hall USING AND DEFINING VIEWS  Views provide users controlled.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
Views / Session 3/ 1 of 40 Session 3 Module 5: Implementing Views Module 6: Managing Views.
Chapter 8 1 Lecture Advanced SQL. Chapter 8 2 Processing Multiple Tables–Joins Join – a relational operation that causes two or more tables with.
Distributed Systems Architectures Chapter 12. Objectives  To explain the advantages and disadvantages of different distributed systems architectures.
Distributed Systems Architectures. Topics covered l Client-server architectures l Distributed object architectures l Inter-organisational computing.
SQL Query Getting to the data ……..
The Client/Server Database Environment
Modern Database Management Jeffrey A. Hoffer, Mary B. Prescott,
CHAPTER 7: ADVANCED SQL.
CHAPTER 6: INTRODUCTION TO SQL
Chapter 2 Views.
A Guide to SQL, Eighth Edition
Chapter 2 Views.
Chapter 8 Advanced SQL.
Presentation transcript:

CS263 Lec. 2: Three- schema architecture for database development Conceptual Schema (during the Analysis phase) is a detailed specification of the overall structure of organisational data that is independent of any database management technology) – depicted in ER or object- modelling notations (a data model). Specifications stored as metadata in repository or data dictionary External Schema (or user view) is some portion of the database that is required for a user to perform some task. Also independent of database technology but typically contains a subset of the associated conceptual schema. Often the original description of a user view is is a computer screen display, business transaction or report.

Three schema architecture Internal Schema (physical schema) contains specifications for how data from a conceptual schema are stored in a computer’s secondary memory.

Three-schema database architecture

Process of developing three-schema architecture for a database project

Three-tiered database location architecture The data for a given information system may reside in multiple locations or tiers of computers, in order to balance various technical and organisational factors Four tiers are possible for data to be on – on a client server, an application server, a Web server and a database server. However, three tiers are more commonly considered (Fig. 2-10): Client tier – typically a desktop or laptop computer, which concentrates on managing the user-system interface and localised data (also called presentation tier). Web scripting tasks may be executed here.

Three-tiered Application/Web server tier – processes HTTP protocols, scripting tasks, performs calculations and provides access to data (also called process services tier). Enterprise server (minicomputer or mainframe tier) – performs sophisticated calculations and manages the merging of data from multiple sources across the organisation (also called the data services tier)

Three-tiered client/server database architecture

Reasons for using a client/server architecture It allows for simultaneous processing on multiple processors for the same application, thus improving application response time and data processing speed It is possible to take advantage of the best data processing features of each computer platform (e.g. the advanced user interface capabilities of PCs versus the speed of minicomputers and mainframes) Can mix client technologies (by different companies such as Intel, Sun, Motorola) and yet share common data Can change technologies in any tier with limited impact on the other tiers

Reasons for using a client/server architecture Processing can be performed close to the source of processed data, improving response times and reducing network traffic Allows for and encourages open system standards Ease of separating the development of the database and the modules that contain the database from the information system modules that present the contents to end users. These are typically developed in Powerbuilder, VB or Delphi and interact through middleware to the routines that access and analyse the data

Using and defining views Views provide users controlled access to tables. Advantages of dynamic views: –Simplify query commands –Help provide data security and confidentiality –Enhance programming productivity –Contain most current base table data –Use little storage space –Provide a customised view for a user –Establish physical database independence

Using and defining views Disadvantages of views: Use processing time re-creating view each time it is referenced May or may not be directly updateable Some disadvantages can be overcome by using materialised views which are stored physically on disk and refreshed at appropriate intervals

The SELECT clause Specifies (or projects) what data elements (columns) are to be included in the view table The FROM clause lists the tables and views involved in the view development The WHERE clause specifies the names of the common columns used to join the tables Because a view is a table its rows may not be sorted

Views e.g., build a query to generate an invoice for order number where rather than having to specify the joining of four tables, the query can include all relevant data elements from the view table INVOICE_V: CREATE VIEW INVOICE_V AS SELECT CUSTOMER_ID, CUSTOMER_ADDRESS, PRODUCT_ID, QUANTITY etc. FROM INVOICE_V WHERE ORDER_ID = 1004;

Views A view may join multiple tables or views together and may contain derived (or virtual) columns e.g., if a user only wants to know the total value of the orders placed for each furniture product, a view can be created from the previous view (INVOICE_V) We can assign a different name (alias) to a view column than the associated base table or expression column name Here PRODUCT is a renaming of PRODUCT_ID, local to only this view

Views TOTAL is the column name given to the expression for total sales of each product The expression can now be referenced via this view in subsequent queries as if it were a column (rather than a derived expression) CREATE VIEW ORDER_TOTALS_V AS SELECT PRODUCT_ID PRODUCT, SUM(UNIT_PRICE*QUANTITY) TOTAL FROM INVOICE_V GROUP BY PRODUCT_ID;

Views Views can establish security because tables and columns that are not included will not be obvious to users of the view Restricting access to a view with GRANT and REVOKE statements adds another layer of security Some people advocate the creation of a view for every single base table, even if that view is identical to the base table This can create to greater programming productivity as databases evolve, through greater flexibility when base tables are changed

Views The following examples are based on the following views: CREATE VIEW CUSTOMER_V AS SELECT * FROM CUSTOMER_T; CREATE VIEW ORDER_V AS SELECT * FROM ORDER_T; CREATE VIEW ORDER_LINE_V AS SELECT * FROM ORDER_LINE_T; CREATE VIEW PRODUCT_V AS SELECT * FROM PRODUCT_T;

Views Updating data directly from a view rather than from base tables is possible under certain limitations Usually permitted as long as the update is unambiguous in terms of data modification in the base table When the CREATE VIEW statement contains any of the following five situations, that view may not be updated directly: 1. The SELECT clause includes the keyword DISTINCT (see later) 2. The SELECT clause contains expressions, including derived columns, aggregates, statistical functions etc.

Views 3. The FROM clause, or a subquery, or a UNION clause references more than one table 4. The FROM clause or a subquery references another view that is not updateable 5. The CREATE VIEW command contains a GROUP BY or HAVING clause It could happen that an update to an instance would result in the instance disappearing from the view. A view EXPENSIVE_STUFF_V lists all furniture products where the unit price is > $300.

Views That view will include PRODUCT_ID 5, a writers desk = $325 dollars. If we update this view and reduce writer’s desk to $295, the desk will no longer appear in the view because its unit price is now less than $300. If it is desired to track everything with an original price over $300, we must include a WITH CHECK OPTION clause after the SELECT clause in the CREATE VIEW COMMAND. This will cause UPDATE or INSERT statements to be rejected when they would cause rows to be removed from the view

Sample CREATE VIEW CREATE VIEW EXPENSIVE_STUFF_V AS SELECT PRODUCT_ID, PRODUCT_NAME, UNIT_PRICE FROM PRODUCT_T WHERE UNIT_PRICE >300 WITH CHECK_OPTION; CHECK_OPTION works only for updateable views and prevents updates that would create rows not included in the view, or cause updated or inserted rows to be removed from the view