2002.10.31- SLIDE 1IS 257 - Fall 2002 Fourth Generation Languages and OR extensions to SQL University of California, Berkeley School of Information Management.

Slides:



Advertisements
Similar presentations
Lecture-7/ T. Nouf Almujally
Advertisements

CIT 613: Relational Database Development using SQL Introduction to SQL.
Case Tools Trisha Cummings. Our Definition of CASE  CASE is the use of computer-based support in the software development process.  A CASE tool is a.
Third-Generation Database System Manifesto
SLIDE 1IS Fall 2002 Data Administration and Database Administration University of California, Berkeley School of Information Management.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 28 Database Systems I The Relational Data Model.
Programming Creating programs that run on your PC
Oct 31, 2000Database Management -- Fall R. Larson Database Management: Introduction to Terms and Concepts University of California, Berkeley School.
SLIDE 1IS 257 – Fall 2011 Object-Relational Databases and OR Extensions University of California, Berkeley School of Information IS 257: Database.
Database Management: Getting Data Together Chapter 14.
SLIDE 1IS Fall 2002 Object-Oriented, Intelligent and Object-Relational Database Models University of California, Berkeley School of Information.
SLIDE 1IS 257 – Spring 2004 Data Administration and Database Administration University of California, Berkeley School of Information Management.
Object-Oriented Databases
SLIDE 1IS 257 – Fall 2006 Object-Relational Databases and OR Extensions University of California, Berkeley School of Information IS 257: Database.
October 24, 2000Database Management -- R. Larson Fourth Generation Languages (4GLs) University of California, Berkeley School of Information Management.
SLIDE 1IS 257 – Fall 2006 JDBC and Java Access to DBMS University of California, Berkeley School of Information IS 257: Database Management.
SLIDE 1IS Fall 2002 Fourth Generation Languages and PHP University of California, Berkeley School of Information Management and Systems.
Chapter 14 The Second Component: The Database.
SLIDE 1IS 257 – Spring 2004 Object-Relational Database System Features University of California, Berkeley School of Information Management.
October 23, 2001Database Management -- R. Larson SQL and Fourth Generation Languages (4GLs) University of California, Berkeley School of Information Management.
© Prentice Hall CHAPTER 3 Computer Software.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
11/7/2000Database Management -- R. Larson Object-Oriented, Intelligent and Object-Relational Database Models University of California, Berkeley School.
SLIDE 1IS Fall 2002 Fourth Generation Languages and OR extensions to SQL University of California, Berkeley School of Information Management.
SLIDE 1IS Fall 2002 Database Applications: Using ColdFusion University of California, Berkeley School of Information Management and Systems.
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
Chapter 1 Database Systems. Good decisions require good information derived from raw facts Data is managed most efficiently when stored in a database.
Chapter 5 Business Intelligence: Data Warehousing, Data Acquisition, Data Mining, Business Analytics, and Visualization.
Programming Languages – Coding schemes used to write both systems and application software A programming language is an abstraction mechanism. It enables.
Programming Languages: Telling the Computers What to Do Chapter 16.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Systems Analysis – Analyzing Requirements.  Analyzing requirement stage identifies user information needs and new systems requirements  IS dev team.
5.1 © 2007 by Prentice Hall 5 Chapter Foundations of Business Intelligence: Databases and Information Management.
Chapter 5 Lecture 2. Principles of Information Systems2 Objectives Understand Data definition language (DDL) and data dictionary Learn about popular DBMSs.
1 Introduction to databases concepts CCIS – IS department Level 4.
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
Welcome to OBJECT ORIENTED PROGRAMMIN Date: 10/09/2014 Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Database Design - Lecture 2
1 INTRODUCTION TO DATABASE MANAGEMENT SYSTEM L E C T U R E
COLD FUSION Deepak Sethi. What is it…. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows.
PostgreSQL and relational databases As well as assignment 4…
CMPE13Cyrus Bazeghi 1 Programming Languages Telling computers what to do.
Databases and Statistical Databases Session 4 Mark Viney Australian Bureau of Statistics 5 June 2007.
Chapter 3: Computer Software. Stored Program Concept v The concept of preparing a precise list of exactly what the computer is to do (this list is called.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
5 - 1 Copyright © 2006, The McGraw-Hill Companies, Inc. All rights reserved.
MANAGING DATA RESOURCES ~ pertemuan 7 ~ Oleh: Ir. Abdul Hayat, MTI.
Jim Janson. Agenda Evolution of software architectures 3-tier User interfaces Application servers Databases.
CIT 613: Relational Database Development using SQL Introduction to SQL DeSiaMorePowered by DeSiaMore 1.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 14 Event-Driven Programming with Graphical User Interfaces.
Machine Machine language is PL in which program instructions are written in strings of 0s and 1s.The computer circuitry is wired in a manner that it can.
SLIDE 1IS 257 – Fall 2014 NoSQL Databases University of California, Berkeley School of Information IS 257: Database Management.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
Data Resource Management Lecture 8. Traditional File Processing Data are organized, stored, and processed in independent files of data records In traditional.
Managing Data Resources File Organization and databases for business information systems.
Chapter Goals Describe the application development process and the role of methodologies, models, and tools Compare and contrast programming language generations.
Object-Relational Databases and OR Extensions
Object-Relational DBMSs
Computer Programming.
MANAGING DATA RESOURCES
Presentation transcript:

SLIDE 1IS Fall 2002 Fourth Generation Languages and OR extensions to SQL University of California, Berkeley School of Information Management and Systems SIMS 257: Database Management

SLIDE 2IS Fall 2002 Lecture Outline Review –PHP (a bit more is working now)… Fourth Generation Languages Object-Relational Extensions to SQL

SLIDE 3IS Fall 2002 PHP PHP is an Open Source Software project with many programmers working on the code. –Commonly paired with MySQL, another OSS project –Free –Both Windows and Unix support Estimated that more than 250,000 web sites use PHP as an Apache Module.

SLIDE 4IS Fall 2002 PHP Syntax Similar to ASP Includes most programming structures (Loops, functions, Arrays, etc.) Loads HTML form variables so that they are addressable by name <?php $myvar = “Hello World”; echo $myvar ; ?>

SLIDE 5IS Fall 2002 Combined with MySQL DBMS interface appears as a set of functions: <?php $db = mysql_connect(“localhost”, “root”); mysql_select_db(“mydb”,$db); $result = mysql_query(“SELECT * FROM employees”, $db); printf(“First Name: %s \n”, mysql_result($result, 0 “first”); printf(“Last Name: %s \n”, mysql_result($result, 0 “last”); ?>

SLIDE 6IS Fall 2002 Examples with Diveshop

SLIDE 7IS Fall 2002 Fourth Generation Languages 1st Generation -- Machine Language 2nd Generation -- Assembly Languages 3rd Generation -- High-Level Languages 4th Generation -- Non-Procedural Languages 5th Generation -- ?? Knowledge-based ?? Natural Language ?? Where do Object-Oriented Languages fit??

SLIDE 8IS Fall 2002 Chauffeurs In the early days of the US car industry, production volumes were growing fast, and a well-known sociologist was asked to predict the total number of automobiles that would ever be manufactured. After a great deal of study, the sociologist reported that no more than 2 million would be manufactured in the life cycle of the car. If the car lasted ten years on average, the maximum annual production would never exceed 200,000. This conclusion was based on the much-researched figure that no more than 2 million people would be willing to serve as chauffeurs. From James Martin - Fourth Generation Languages

SLIDE 9IS Fall 2002 Fourth Generation Languages In the database environment these are used for creation of database applications To speed up the application building process To make applications easy and quick to change To minimize debugging problems To generate bug-free code from high-level expressions of requirement To make languages user-friendly so that “end- users” can solve their own problems and put computers to work.

SLIDE 10IS Fall 2002 Basic Principles of 4GLs The Principle of Minimum Work The Principle of Minimum Skill The Principle of avoiding alien syntax and mnemonics The Principle of Minimum Time The Principle of Minimum errors The Principle of Minumum Maintenance The Principle of Maximum Results From James Martin - Fourth Generation Languages

SLIDE 11IS Fall 2002 Properties of 4GLs User Friendly A nonprofessional programmer can obtain results with it It employs the database management system directly Programs for most applications can be created with 10 times fewer instructions than in a Third Generation Language

SLIDE 12IS Fall 2002 More Properties of 4GLs Non procedural code is used wherever possible It make intelligent default assumptions about what the user wants wherever possible It is designed for online operation It enforces or encourages structured code It makes it easy to understand and maintain another person’s code

SLIDE 13IS Fall 2002 More Properties of 4GLs Non-DP users can learn a subset of the language in a short course It is designed for easy debugging Prototypes can be created and modified quickly Results can be obtained in an order of magnitude less time than with a 3GL for most applications

SLIDE 14IS Fall 2002 Selection Criteria for 4GLs Is it intended for routine computing of ad hoc decision making Is it intended for end users or DP professionals? (many 4GLs are appropriate for both) Does it require the skills of a programmer, or can an analyst who does not program in a 3GL use it.

SLIDE 15IS Fall 2002 Selection Criteria for 4GLs Which of the following features does it provide? –Simple queries –Simple queries and updates –Complex queries –Complex queries and updates –The ability to create a database quickly –Intelligent database operations, where the change of one value in the database causes other operations to occur automatically, such as validity checks, cross references, and the updating of related values.

SLIDE 16IS Fall 2002 Selection Criteria for 4GLs Which of the following features does it provide?(cont) –Generation of data-entry screens for key-entry operators (with validity checks) –Generation of data-update screens for key-entry operators (with validity checks) –A procedural language giving full programming capability –Graphics techniques for application design –Spreadsheet manipulation –Multidimensional matrix manipulation –Report generation –Graphics generation

SLIDE 17IS Fall 2002 Selection Criteria for 4GLs Which of the following features does it provide?(cont) –Graphics manipulation –Decision support for what-if questions –Mathematical analysis tools –Financial analysis tools –Other decision-support tools –Text manipulation –Electronic Mailbox Is it on-line or off-line? Does it run on mainframes, minicomputers or personal computers? Can it access mainframe or remote databases Is it genuinely easy to use Can results be obtained with it very quickly?

SLIDE 18IS Fall 2002 Components of a 4GL Application Parameters Testing tools/debugger Interpreter Optimizing compiler Rules Specification Data Specification Report Specification Screen Specification Procedural facility Feedback for building routine applications…

SLIDE 19IS Fall GLs -- Natural Language Possibilities Problems

SLIDE 20IS Fall 2002 Natural Language Advantages of using NL –It encourages untrained users to start –It encourages upper-management use of computers –It reduces the time taken learning complex syntax –It lessens the frustration, bewilderment and anger caused by BAD COMMAND responses –It is likely to extend greatly the usage of computers James Martin, Fourth Generation Languages, 1985

SLIDE 21IS Fall 2002 Natural Language It lacks precision It is not good for expressing precise and complex logic It is not good for expressing neat structures It encourages semantic overshoot It should be combined with other dialogue contructs that aid in the representation of precise logic and structures James Martin, Fourth Generation Languages, 1985 Disadvantages of using NL Appropriate response to the disadvantage

SLIDE 22IS Fall 2002 Natural Language It takes substantial time to key in sentences Ambiguities are possible Substantial processing is needed Sentences and words can be abbreviated Speech input as well as typed input will be used The computer should detect and resolve ambiguities The processing should be on PC workstations. Processing is dropping rapidly in cost. James Martin, Fourth Generation Languages, 1985 Disadvantages of using NL Appropriate response to the disadvantage

SLIDE 23IS Fall 2002 Assumptions and Issues Why 4GLs? –Are they still appropriate? –Are they still useful? Is Cold Fusion a 4GL? What about PHP? Who needs them?

SLIDE 24IS Fall 2002 Object Relational Databases Background Object Definitions –inheritance User-defined datatypes User-defined functions

SLIDE 25IS Fall 2002 Object Relational Databases Began with UniSQL/X unified object- oriented and relational system Some systems (like OpenODB from HP) were Object systems built on top of Relational databases. Miro/Montage/Illustra built on Postgres. Informix Buys Illustra. (DataBlades) Oracle Hires away Informix Programmers. (Cartridges)

SLIDE 26IS Fall 2002 Object Relational Data Model Class, instance, attribute, method, and integrity constraints OID per instance Encapsulation Multiple inheritance hierarchy of classes Class references via OID object references Set-Valued attributes Abstract Data Types

SLIDE 27IS Fall 2002 Object Relational Extended SQL (Illustra) CREATE TABLE tablename {OF TYPE Typename}|{OF NEW TYPE typename} (attr1 type1, attr2 type2,…,attrn typen) {UNDER parent_table_name}; CREATE TYPE typename (attribute_name type_desc, attribute2 type2, …, attrn typen); CREATE FUNCTION functionname (type_name, type_name) RETURNS type_name AS sql_statement

SLIDE 28IS Fall 2002 Object-Relational SQL in ORACLE CREATE (OR REPLACE) TYPE typename AS OBJECT (attr_name, attr_type, …); CREATE TABLE OF typename;

SLIDE 29IS Fall 2002 Example CREATE TYPE ANIMAL_TY AS OBJECT (Breed VARCHAR2(25), Name VARCHAR2(25), Birthdate DATE); Creates a new type CREATE TABLE Animal of Animal_ty; Creates “Object Table”

SLIDE 30IS Fall 2002 Constructor Functions INSERT INTO Animal values (ANIMAL_TY(‘Mule’, ‘Frances’, TO_DATE(‘01-APR-1997’, ‘DD-MM- YYYY’))); Insert a new ANIMAL_TY object into the table

SLIDE 31IS Fall 2002 Selecting from an Object Table Just use the columns in the object… SELECT Name from Animal;

SLIDE 32IS Fall 2002 More Complex Objects CREATE TYPE Address_TY as object (Street VARCHAR2(50), City VARCHAR2(25), State CHAR(2), zip NUMBER); CREATE TYPE Person_TY as object (Name VARCHAR2(25), Address ADDRESS_TY); CREATE TABLE CUSTOMER (Customer_ID NUMBER, Person PERSON_TY);

SLIDE 33IS Fall 2002 What Does the Table Look like? DESCRIBE CUSTOMER; NAME TYPE CUSTOMER_ID NUMBER PERSON NAMED TYPE

SLIDE 34IS Fall 2002 Inserting INSERT INTO CUSTOMER VALUES (1, PERSON_TY(‘John Smith’, ADDRESS_TY(‘57 Mt Pleasant St.’, ‘Finn’, ‘NH’, )));

SLIDE 35IS Fall 2002 Selecting from Abstract Datatypes SELECT Customer_ID from CUSTOMER; SELECT * from CUSTOMER; CUSTOMER_ID PERSON(NAME, ADDRESS(STREET, CITY, STATE ZIP)) PERSON_TY(‘JOHN SMITH’, ADDRESS_TY(‘57...

SLIDE 36IS Fall 2002 Selecting from Abstract Datatypes SELECT Customer_id, person.name from Customer; SELECT Customer_id, person.address.street from Customer;

SLIDE 37IS Fall 2002 Updating UPDATE Customer SET person.address.city = ‘HART’ where person.address.city = ‘Briant’;

SLIDE 38IS Fall 2002 Functions CREATE [OR REPLACE] FUNCTION funcname (argname [IN | OUT | IN OUT] datatype …) RETURN datatype (IS | AS) {block | external body}

SLIDE 39IS Fall 2002 Example Create Function BALANCE_CHECK (Person_name IN Varchar2) RETURN NUMBER is BALANCE NUMBER(10,2) BEGIN SELECT sum(decode(Action, ‘BOUGHT’, Amount, 0)) - sum(decode(Action, ‘SOLD’, amount, 0)) INTO BALANCE FROM LEDGER where Person = PERSON_NAME; RETURN BALANCE; END;

SLIDE 40IS Fall 2002 Example Select NAME, BALANCE_CHECK(NAME) from Worker;

SLIDE 41IS Fall 2002 TRIGGERS Create TRIGGER UPDATE_LODGING INSTEAD OF UPDATE on WORKER_LODGING for each row BEGIN if :old.name <> :new.name then update worker set name = :new.name where name = :old.name; end if; if :old.lodging <> … etc...

SLIDE 42IS Fall 2002 Next Week Database Administration More on Database Applications