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

Database Management System MIS 520 – Database Theory Fall 2001 (Day) Lecture 13.
CIT 613: Relational Database Development using SQL Introduction to SQL.
Introduction to Database Management  Department of Computer Science Northern Illinois University January 2001.
SLIDE 1IS Fall 2002 Data Administration and Database Administration University of California, Berkeley School of Information Management.
Monday, 08 June 2015Dr. Mohamed Osman1 What is Database Administration A high level function (technical Function) that is responsible for ► physical DB.
10/25/2001Database Management -- R. Larson Data Administration and Database Administration University of California, Berkeley School of Information Management.
SLIDE 1IS Fall 2002 Fourth Generation Languages and OR extensions to SQL University of California, Berkeley School of Information Management.
Database Integrity, Security and Recovery Database integrity Database integrity Database security Database security Database recovery Database recovery.
Oct 31, 2000Database Management -- Fall R. Larson Database Management: Introduction to Terms and Concepts University of California, Berkeley School.
Introduction to Structured Query Language (SQL)
SLIDE 1IS Fall 2005 Database Administration: Security and Integrity University of California, Berkeley School of Information Management.
SLIDE 1IS Fall 2006 Database Administration: Security and Integrity University of California, Berkeley School of Information IS 257:
SLIDE 1IS 257 – Spring 2006 Data Security, Data Administration and Database Administration University of California, Berkeley School of Information.
SLIDE 1IS Fall 2004 Database Administration: Security and Integrity University of California, Berkeley School of Information Management.
Database Management: Getting Data Together Chapter 14.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
SLIDE 1IS 257 – Fall 2011 Data Security, Data Administration and Database Administration University of California, Berkeley School of Information.
SLIDE 1IS 257 – Spring 2005 Data Administration and Database Administration University of California, Berkeley School of Information Management.
SLIDE 1IS 257 – Spring 2004 Data Administration and Database Administration University of California, Berkeley School of Information Management.
Ch1: File Systems and Databases Hachim Haddouti
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 Fall 2002 Fourth Generation Languages and PHP University of California, Berkeley School of Information Management and Systems.
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.
Introduction to Structured Query Language (SQL)
Functions of a Database Management System. Functions of a DBMS C.J. Date n Indexing n Views n Security n Integrity n Concurrency n Backup/Recovery n Design.
11/7/2000Database Management -- R. Larson Object-Oriented, Intelligent and Object-Relational Database Models University of California, Berkeley School.
Dr. Kalpakis CMSC 461, Database Management Systems Introduction.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Chapter 1: The Database Environment
Database Management Systems (DBMS)
10/5/1999Database Management -- R. Larson Data Administration and Database Administration University of California, Berkeley School of Information Management.
Introduction to Databases. Case Example: File based Processing Real Estate Agent’s office Property for sale or rent Potential Buyer/renter Staff/employees.
Chapter 1 Database Systems. Good decisions require good information derived from raw facts Data is managed most efficiently when stored in a database.
Programming Languages – Coding schemes used to write both systems and application software A programming language is an abstraction mechanism. It enables.
© 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 CHAPTER 11: DATA AND DATABASE ADMINISTRATION Modern Database Management 11 th Edition Jeffrey.
Chapter 6: Integrity and Security Thomas Nikl 19 October, 2004 CS157B.
The University of Akron Dept of Business Technology Computer Information Systems DBMS Functions 2440: 180 Database Concepts Instructor: Enoch E. Damson.
© Paradigm Publishing Inc. 9-1 Chapter 9 Database and Information Management.
Objectives Overview Define the term, database, and explain how a database interacts with data and information Define the term, data integrity, and describe.
Concepts of Database Management, Fifth Edition
Database Technical Session By: Prof. Adarsh Patel.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
Databases and Statistical Databases Session 4 Mark Viney Australian Bureau of Statistics 5 June 2007.
Discovering Computers Fundamentals Fifth Edition Chapter 9 Database Management.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
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.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Environment Chapter 2. Data Independence Sometimes the way data are physically organized depends on the requirements of the application. Result:
IT Auditing & Assurance, 2e, Hall & Singleton Chapter 3: Data Management Systems.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Database Management Systems (DBMS)
MBA 664 Database Management Dave Salisbury ( )
TM 13-1 Copyright © 1999 Addison Wesley Longman, Inc. Data and Database Administration.
CIT 613: Relational Database Development using SQL Introduction to SQL DeSiaMorePowered by DeSiaMore 1.
SLIDE 1IS 257 – Fall 2014 NoSQL Databases University of California, Berkeley School of Information IS 257: Database Management.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Copyright © 2016 Pearson Education, Inc. CHAPTER 12: DATA AND DATABASE ADMINISTRATION Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman,
TM 13-1 Copyright © 1999 Addison Wesley Longman, Inc. Data and Database Administration.
Getting started with Accurately Storing Data
Data Security, Data Administration and Database Administration
Database Management:.
Chapter 2 Database Environment.
Data Model.
Chapter 11 Managing Databases with SQL Server 2000
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: Security and Integrity Fourth Generation Languages Object-Relational Extensions to SQL

SLIDE 3IS Fall 2002 Security and Integrity Functions in Database Administration Data Integrity Security Management Backup and Recovery

SLIDE 4IS Fall 2002 Security and Integrity Functions in Database Administration Data Integrity Security Management Backup and Recovery

SLIDE 5IS Fall 2002 Integrity Constraints (review) The constraints we wish to impose in order to protect the database from becoming inconsistent. Five types –Required data –attribute domain constraints –entity integrity –referential integrity –enterprise constraints

SLIDE 6IS Fall 2002 Data and Domain Integrity This is now increasing handled by the database. In Oracle, for example, when defining a table you can specify: CREATE TABLE table-name ( attr2 attr-type NOT NULL, forbids NULL values attrN attr-type CHECK (attrN = UPPER(attrN) verifies that the data meets certain criteria attrO attr-type DEFAULT default_value); Supplies default values

SLIDE 7IS Fall 2002 Referential Integrity Ensures that dependent relationships in the data are maintained. In Oracle, for example: CREATE TABLE table-name ( attr1 attr-type PRIMARY KEY, attr2 attr-type NOT NULL, …, attrM attr-type REFERENCES owner.tablename(attrname) ON DELETE CASCADE, …

SLIDE 8IS Fall 2002 Concurrency Control The goal is to support access by multiple users to the same data, at the same time It must assure that the transactions are serializable and that they are isolated It is intended to handle several problems in an uncontrolled system Specifically: –Lost updates –Inconsistent data states during access –Uncompleted (or committed) changes to data

SLIDE 9IS Fall 2002 Transaction Control in ORACLE Transactions are sequences of SQL statements that ORACLE treats as a unit –From the user’s point of view a private copy of the database is created for the duration of the transaction Transactions are started with SET TRANSACTION, followed by the SQL statements Any changes made by the SQL are made permanent by COMMIT Part or all of a transaction can be undone using ROLLBACK

SLIDE 10IS Fall 2002 Transactions in ORACLE COMMIT; SET TRANSACTION READ ONLY; SELECT NAME, ADDRESS FROM WORKERS; SELECT MANAGER, ADDRESS FROM PLACES; COMMIT; Freezes the data for the user in both tables before either select retrieves any rows, so that changes that occur concurrently will not show up Commits before and after ensure any uncompleted transactions are finish, and then release the frozen data when done

SLIDE 11IS Fall 2002 Transactions in ORACLE Savepoints are places in a transaction that you may ROLLBACK to (called checkpoints in other DBMS) –SET TRANACTION…; –SAVEPOINT ALPHA; –SQL STATEMENTS… –IF (CONDITION) THEN ROLLBACK TO SAVEPOINT ALPHA; –SAVEPOINT BETA; –SQL STATEMENTS… –IF …; –COMMIT;

SLIDE 12IS Fall 2002 Database Security Views or restricted subschemas Authorization rules to identify users and the actions they can perform User-defined procedures (and rule systems) to define additional constraints or limitations in using the database Encryption to encode sensitive data Authentication schemes to positively identify a person attempting to gain access to the database

SLIDE 13IS Fall 2002 Views A subset of the database presented to some set of users –SQL: CREATE VIEW viewname AS SELECT field1, field2, field3,…, FROM table1, table2 WHERE ; –Note: “queries” in Access function as views

SLIDE 14IS Fall 2002 Restricted Views Main relation has the form: Name C_name Dept C_dept Prof C_prof TC J SmithSDept1SCryptographyTS M DoeUDept2SIT SecuritySS R JonesUDept3USecretaryUU U = unclassified : S = Secret : TS = Top Secret

SLIDE 15IS Fall 2002 Restricted Views NAMEDeptProf J SmithDept1--- M DoeDept2IT Security R JonesDept3Secretary NAMEDeptProf M Doe--- R JonesDept3Secretary S-view of the data U-view of the data

SLIDE 16IS Fall 2002 Disaster Recovery Planning Testing and Training Procedures Development Budget & Implement Plan Maintenance Recovery Strategies Risk Analysis From Toigo “Disaster Recovery Planning”

SLIDE 17IS Fall 2002 Threats to Assets and Functions Water Fire Power Failure Mechanical breakdown or software failure Accidental or deliberate destruction of hardware or software –By hackers, disgruntled employees, industrial saboteurs, terrorists, or others

SLIDE 18IS Fall 2002 Threats Between 1967 and 1978 fire and water damage accounted for 62% of all data processing disasters in the U.S. The water damage was sometimes caused by fighting fires More recently improvements in fire suppression (e.g., Halon) for DP centers has meant that water is the primary danger to DP centers

SLIDE 19IS Fall 2002 Lecture Outline Review: Security and Integrity Fourth Generation Languages Object-Relational Extensions to SQL

SLIDE 20IS 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 21IS 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 22IS 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 23IS 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 24IS 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 25IS 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 26IS 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 27IS 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 28IS 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 29IS 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 30IS 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 31IS 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 32IS Fall GLs -- Natural Language Possibilities Problems

SLIDE 33IS 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 34IS 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 35IS 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 36IS 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 37IS Fall 2002 Object Relational Databases Background Object Definitions –inheritance User-defined datatypes User-defined functions

SLIDE 38IS 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 39IS 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 40IS 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 41IS Fall 2002 Object-Relational SQL in ORACLE CREATE (OR REPLACE) TYPE typename AS OBJECT (attr_name, attr_type, …); CREATE TABLE OF typename;

SLIDE 42IS 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 43IS 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 44IS Fall 2002 Selecting from an Object Table Just use the columns in the object… SELECT Name from Animal;

SLIDE 45IS 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 46IS Fall 2002 What Does the Table Look like? DESCRIBE CUSTOMER; NAME TYPE CUSTOMER_ID NUMBER PERSON NAMED TYPE

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

SLIDE 48IS 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 49IS Fall 2002 Selecting from Abstract Datatypes SELECT Customer_id, person.name from Customer; SELECT Customer_id, person.address.street from Customer;

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

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

SLIDE 52IS 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 53IS Fall 2002 Example Select NAME, BALANCE_CHECK(NAME) from Worker;

SLIDE 54IS 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 55IS Fall 2002 Next Week Database Administration More on Database Applications