Programming Languages

Size: px
Start display at page:

Download "Programming Languages"

Transcription

1 Programming Languages Chapter 19 - Continuations Dr. Philip Cannata 1

2 Exceptions (define (f n) (let/cc esc (/ 1 (if (zero? n) (esc 1) n)))) > (f 0) 1 > (f 2) 1/2 > (f 1) 1 > Dr. Philip Cannata 2

3 Exceptions (define (f n) (let/cc esc (/ 1 (if (zero? n) (esc 1) n)))) When you invoke the continuation, it s as if the entire let/cc expression that binds esc should be cut out of the program and replaced with the value passed to esc, i.e., its as if the actual code for f is really this: (define (f n) 1) Dr. Philip Cannata 3

4 Escaping Procedures (define (f n) (+ n (let/cc k (- 5 (k 5))))) > (f 6) 11 > Dr. Philip Cannata 4

5 (define route-producer (local ([define resume (box false)]) (lambda (real-send) (local ([define send (lambda (value-to-send) (let/cc k (set-box! resume k) ((unbox resume) 'dummy) (send 'providence) (send 'houston) (send 'bangalore))))))) Producers and Consumers We ll see these (real-send value-to-send))))]) details in a few slides 'providence 'houston 'bangalore 'dummy Dr. Philip Cannata 5

6 Producers and Consumers Oracle sequence example CREATE TABLE EMP (EMPNO NUMBER(7) NOT NULL, CONSTRAINT emp_pkey PRIMARY KEY (empno), ENAME VARCHAR2(10), JOB VARCHAR2(9), MGR NUMBER(4), HIREDATE DATE, SAL NUMBER(7, 2), COMM NUMBER(7, 2), DEPTNO NUMBER(2)); drop sequence emp_empno; create sequence emp_empno start with 1 increment by 1 nomaxvalue; create or replace trigger emp_empno_trigger before insert on emp for each row begin select emp_empno.nextval into :new.empno from dual; end; INSERT INTO EMP VALUES (7369, 'SMITH', 'CLERK', 7902, TO_DATE('17-DEC-1980', 'DD-MON-YYYY'), 800, NULL, 20); INSERT INTO EMP VALUES (7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('20-FEB-1981', 'DD-MON-YYYY'), 1600, 300, 30); INSERT INTO EMP VALUES (7521, 'WARD', 'SALESMAN', 7698, TO_DATE('22-FEB-1981', 'DD-MON-YYYY'), 1250, 500, 30); INSERT INTO EMP VALUES (7566, 'JONES', 'MANAGER', 7839, TO_DATE('2-APR-1981', 'DD-MON-YYYY'), 2975, NULL, 20); INSERT INTO EMP VALUES (7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('28-SEP-1981', 'DD-MON-YYYY'), 1250, 1400, 30); INSERT INTO EMP VALUES (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('1-MAY-1981', 'DD-MON-YYYY'), 2850, NULL, 30); INSERT INTO EMP VALUES (7782, 'CLARK', 'MANAGER', 7839, TO_DATE('9-JUN-1981', 'DD-MON-YYYY'), 2450, NULL, 10); INSERT INTO EMP VALUES (7788, 'SCOTT', 'ANALYST', 7566, TO_DATE('09-DEC-1982', 'DD-MON-YYYY'), 3000, NULL, 20); INSERT INTO EMP VALUES (7839, 'KING', 'PRESIDENT', NULL, TO_DATE('17-NOV-1981', 'DD-MON-YYYY'), 5000, NULL, 10); INSERT INTO EMP VALUES (7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('8-SEP-1981', 'DD-MON-YYYY'), 1500, NULL, 30); INSERT INTO EMP VALUES (7876, 'ADAMS', 'CLERK', 7788, TO_DATE('12-JAN-1983', 'DD-MON-YYYY'), 1100, NULL, 20); INSERT INTO EMP VALUES (7900, 'JAMES', 'CLERK', 7698, TO_DATE('3-DEC-1981', 'DD-MON-YYYY'), 950, NULL, 30); INSERT INTO EMP VALUES (7902, 'FORD', 'ANALYST', 7566, TO_DATE('3-DEC-1981', 'DD-MON-YYYY'), 3000, NULL, 20); INSERT INTO EMP VALUES (7934, 'MILLER', 'CLERK', 7782, TO_DATE('23-JAN-1982', 'DD-MON-YYYY'), 1300, NULL, 10); Dr. Philip Cannata 6

7 Producers and Consumers Oracle sequence example Dr. Philip Cannata 7

8 (define (f n) (let/cc esc (/ 1 (if (zero? n) (esc 1) n)))) Continuations 1. When you invoke the continuation, it s as if the entire let/cc expression that binds esc should be cut out of the program and replaced with the value passed to esc, i.e., its as if the actual code for f is really this: (define (f n) 1) 2. let/cc binds its variable to the next sexp when it is invoked. 3. let/cc causes the interpreter to revert to the state that it was in when the let/cc was defined when the let/cc variable is invoked. Dr. Philip Cannata 8

9 (define (route-producer send) (send 'providence) (send 'houston) (send 'bangalore))) Producers and Consumers > (route-producer display) providencehoustonbangalore 'providence 'providence Dr. Philip Cannata 9

10 Producers and Consumers (define route-producer (local ([define resume (box false)]) (lambda (send) ((unbox resume) 'dummy) (send 'providence) (send 'houston) (send 'bangalore)))))) 'providence 'providence Dr. Philip Cannata 10

11 Producers and Consumers (define route-producer (local ([define resume (box false)]) (lambda (send) ((unbox resume) 'dummy) (send (unbox resume)) (send 'houston) (send 'bangalore)))))) false > Dr. Philip Cannata 11

12 (define route-producer (local ([define resume (box false)]) (lambda (real-send) (local ([define send (lambda (value-to-send) (let/cc k (set-box! resume k) (real-send value-to-send))))]) ((unbox resume) 'dummy) (send 'providence) (send 'houston) (send 'bangalore))))))) Producers and Consumers > (let/cc q (route-producer q)) 'providence > (let/cc q (route-producer q)) 'houston > (let/cc q (route-producer q)) 'bangalore > (let/cc q (route-producer q)) 'dummy Dr. Philip Cannata 12

13 (define route-producer (local ([define resume (box false)]) (lambda (real-send) (local ([define send (lambda (value-to-send) (let/cc k (set-box! resume k) (real-send value-to-send))))]) ((unbox resume) 'dummy) (send 'providence) (send 'houston) (send 'bangalore))))))) Producers and Consumers > (route-producer display) providencehoustonbangalore > (route-producer display) 'dummy > (route-producer display) 'dummy Dr. Philip Cannata 13

14 (define route-producer (local ([define resume (box false)]) (lambda (real-send) (local ([define send (lambda (value-to-send) (let/cc k (set-box! resume k) (real-send value-to-send))))]) ((unbox resume) 'dummy) (send 'providence) (send 'houston) (send 'bangalore))))))) > (let/cc q (route-producer q)) 'providence > (let/cc q (route-producer q)) 'houston > (let/cc q (route-producer q)) 'bangalore > (let/cc q (route-producer q)) 'dummy Producers and Consumers Run 1. and then run 2. Then restart and just run What will this do? (let ((a 1)) (display (let/cc q (route-producer q))) (display a) (display " ") (let ((a 2)) (display a))) 2. What will this do? (let ((a 1)) (display (let/cc q (route-producer q))) (display a) (display " ") (let ((a 2)) (route-producer display) (display a))) Dr. Philip Cannata 14

15 Producers and Consumers (define (make-producer body) (define resume (box false)) (lambda (real-send) (define send-to (box real-send)) (define (send value-to-send) (set-box! send-to (let/cc k (set-box! resume k) ((unbox send-to) value-to-send))))) ((unbox resume) real-send) (body send)))) (define number-producer (make-producer (lambda (send) (send 1) (send 2) (send 3))))) (define get call/cc) (get number-producer) press Run > (+ (get number-producer) (get number-producer) (get number-producer) ) 6 > press Run > (+ (get number-producer) (get number-producer) (get number-producer) (get number-producer)).. user break > Dr. Philip Cannata 15

16 (define (make-producer body) (define resume (box false)) (lambda (real-send) (define send-to (box real-send)) (define (send value-to-send) (set-box! send-to (let/cc k (set-box! resume k) ((unbox send-to) value-to-send))))) ((unbox resume) real-send) (body send)))) (define (odds-producer-body send) (local ([define (loop n) (send n) (loop (+ n 2)))]) (loop 1))) (define odds-producer (make-producer odds-producer-body)) (define (get producer) (let/cc k (producer k))) Producers and Consumers press Run > (+ (get odds-producer) (get odds-producer) (get odds-producer) (get odds-producer) (get odds-producer)) 25 > Dr. Philip Cannata 16

17 (define (make-producer body) (define resume (box false)) (lambda (real-send) (define send-to (box real-send)) (define (send value-to-send) (set-box! send-to (let/cc k (set-box! resume k) ((unbox send-to) value-to-send))))) ((unbox resume) real-send) (body send)))) (define (integer-producer-body send) (local ([define (loop n) (send n) (loop (+ n 1)))]) (loop 1))) (define integer-producer (make-producer integer-producer-body)) (define (get producer) (let/cc k (producer k))) Producers and Consumers (define (Loop n) (define integer-producer (make-producer integer-producer-body)) (define List (box (list))) (let y ((x n)) (set-box! List (cons (get integer-producer) (unbox List ))) (if (> x 1) (y (- x 1) ) (display (unbox List)) (newline) (eval (cons '* (unbox List))))))) Dr. Philip Cannata 17

CS2 Current Technologies Lecture 2: SQL Programming Basics

CS2 Current Technologies Lecture 2: SQL Programming Basics T E H U N I V E R S I T Y O H F R G E D I N B U CS2 Current Technologies Lecture 2: SQL Programming Basics Dr Chris Walton (cdw@dcs.ed.ac.uk) 4 February 2002 The SQL Language 1 Structured Query Language

More information

Real-World Performance Training SQL Introduction

Real-World Performance Training SQL Introduction Real-World Performance Training SQL Introduction Real-World Performance Team Basics SQL Structured Query Language Declarative You express what you want to do, not how to do it Despite the name, provides

More information

CS2 Current Technologies Lecture 3: SQL - Joins and Subqueries

CS2 Current Technologies Lecture 3: SQL - Joins and Subqueries T E H U N I V E R S I T Y O H F R G E D I N B U CS2 Current Technologies Lecture 3: SQL - Joins and Subqueries Chris Walton (cdw@dcs.ed.ac.uk) 11 February 2002 Multiple Tables 1 Redundancy requires excess

More information

King Fahd University of Petroleum and Minerals

King Fahd University of Petroleum and Minerals 1 King Fahd University of Petroleum and Minerals Information and Computer Science Department ICS 334: Database Systems Semester 041 Major Exam 1 18% ID: Name: Section: Grades Section Max Scored A 5 B 25

More information

CS2 Current Technologies Note 1 CS2Bh

CS2 Current Technologies Note 1 CS2Bh CS2 Current Technologies Note 1 Relational Database Systems Introduction When we wish to extract information from a database, we communicate with the Database Management System (DBMS) using a query language

More information

Department of Computer Science and Information Systems, College of Business and Technology, Morehead State University

Department of Computer Science and Information Systems, College of Business and Technology, Morehead State University 1 Department of Computer Science and Information Systems, College of Business and Technology, Morehead State University Lecture 3 Part A CIS 311 Introduction to Management Information Systems (Spring 2017)

More information

Database Management System. * First install Mysql Database or Wamp Server which contains Mysql Databse.

Database Management System. * First install Mysql Database or Wamp Server which contains Mysql Databse. Database Management System * First install Mysql Database or Wamp Server which contains Mysql Databse. * Installation steps are provided in pdf named Installation Steps of MySQL.pdf or WAMP Server.pdf

More information

Pivot Tables Motivation (1)

Pivot Tables Motivation (1) Pivot Tables The Pivot relational operator (available in some SQL platforms/servers) allows us to write cross-tabulation queries from tuples in tabular layout. It takes data in separate rows, aggregates

More information

Informatics Practices (065) Sample Question Paper 1 Section A

Informatics Practices (065) Sample Question Paper 1 Section A Informatics Practices (065) Sample Question Paper 1 Note 1. This question paper is divided into sections. Section A consists 30 marks. 3. Section B and Section C are of 0 marks each. Answer the questions

More information

Introduction. Introduction to Oracle: SQL and PL/SQL

Introduction. Introduction to Oracle: SQL and PL/SQL Introduction Introduction to Oracle: SQL and PL/SQL 1 Objectives After completing this lesson, you should be able to do the following: Discuss the theoretical and physical aspects of a relational database

More information

Part III. Data Modelling. Marc H. Scholl (DBIS, Uni KN) Information Management Winter 2007/08 1

Part III. Data Modelling. Marc H. Scholl (DBIS, Uni KN) Information Management Winter 2007/08 1 Part III Data Modelling Marc H. Scholl (DBIS, Uni KN) Information Management Winter 2007/08 1 Outline of this part (I) 1 Introduction to the Relational Model and SQL Relational Tables Simple Constraints

More information

Table : Purchase. Field DataType Size Constraints CustID CHAR 5 Primary key CustName Varchar 30 ItemName Varchar 30 PurchaseDate Date

Table : Purchase. Field DataType Size Constraints CustID CHAR 5 Primary key CustName Varchar 30 ItemName Varchar 30 PurchaseDate Date Q1. Write SQL query for the following : (i) To create above table as per specification given (ii) To insert 02 records as per your choice (iii) Display the Item name, qty & s of all items purchased by

More information

RDBMS Using Oracle. BIT-4 Lecture Week 3. Lecture Overview

RDBMS Using Oracle. BIT-4 Lecture Week 3. Lecture Overview RDBMS Using Oracle BIT-4 Lecture Week 3 Lecture Overview Creating Tables, Valid and Invalid table names Copying data between tables Character and Varchar2 DataType Size Define Variables in SQL NVL and

More information

Introduc.on to Databases

Introduc.on to Databases Introduc.on to Databases G6921 and G6931 Web Technologies Dr. Séamus Lawless Housekeeping Course Structure 1) Intro to the Web 2) HTML 3) HTML and CSS Essay Informa.on Session 4) Intro to Databases 5)

More information

GIFT Department of Computing Science Data Selection and Filtering using the SELECT Statement

GIFT Department of Computing Science Data Selection and Filtering using the SELECT Statement GIFT Department of Computing Science [Spring 2013] CS-217: Database Systems Lab-2 Manual Data Selection and Filtering using the SELECT Statement V1.0 4/12/2016 Introduction to Lab-2 This lab reinforces

More information

SQL Structured Query Language Introduction

SQL Structured Query Language Introduction SQL Structured Query Language Introduction Rifat Shahriyar Dept of CSE, BUET Tables In relational database systems data are represented using tables (relations). A query issued against the database also

More information

Topic 8 Structured Query Language (SQL) : DML Part 2

Topic 8 Structured Query Language (SQL) : DML Part 2 FIT1004 Database Topic 8 Structured Query Language (SQL) : DML Part 2 Learning Objectives: Use SQL functions Manipulate sets of data Write subqueries Manipulate data in the database References: Rob, P.

More information

CS Reading Packet: "Views, and Simple Reports - Part 1"

CS Reading Packet: Views, and Simple Reports - Part 1 CS 325 - Reading Packet: "Views, and Simple Reports - Part 1" p. 1 Sources: CS 325 - Reading Packet: "Views, and Simple Reports - Part 1" * Oracle9i Programming: A Primer, Rajshekhar Sunderraman, Addison

More information

Database implementation Further SQL

Database implementation Further SQL IRU SEMESTER 2 January 2010 Semester 1 Session 2 Database implementation Further SQL Objectives To be able to use more advanced SQL statements, including Renaming columns Order by clause Aggregate functions

More information

PBarel@Qualogy.com http://blog.bar-solutions.com About me Patrick Barel Working with Oracle since 1997 Working with PL/SQL since 1999 Playing with APEX since 2003 (mod_plsql) ACE since 2011 OCA since December

More information

Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Slide 17-1

Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Slide 17-1 Slide 17-1 Chapter 17 Introduction to Transaction Processing Concepts and Theory Multi-user processing and concurrency Simultaneous processing on a single processor is an illusion. When several users are

More information

TO_CHAR Function with Dates

TO_CHAR Function with Dates TO_CHAR Function with Dates TO_CHAR(date, 'fmt ) The format model: Must be enclosed in single quotation marks and is case sensitive Can include any valid date format element Has an fm element to remove

More information

CS Reading Packet: "Writing relational operations using SQL"

CS Reading Packet: Writing relational operations using SQL CS 325 - Reading Packet: "Writing relational operations using SQL" p. 1 CS 325 - Reading Packet: "Writing relational operations using SQL" Sources: Oracle9i Programming: A Primer, Rajshekhar Sunderraman,

More information

Overview of PL/SQL. About PL/SQL. PL/SQL Environment. Benefits of PL/SQL. Integration

Overview of PL/SQL. About PL/SQL. PL/SQL Environment. Benefits of PL/SQL. Integration About PL/ Overview of PL/ PL/ is an extension to with design features of programming languages. Data manipulation and query statements of are included within procedural units of code. PL/ Environment Benefits

More information

Objectives. After completing this lesson, you should be able to do the following:

Objectives. After completing this lesson, you should be able to do the following: Objectives After completing this lesson, you should be able to do the following: Describe the types of problems that subqueries can solve Define subqueries List the types of subqueries Write single-row

More information

1 SQL Structured Query Language

1 SQL Structured Query Language 1 SQL Structured Query Language 1.1 Tables In relational database systems (DBS) data are represented using tables (relations). A query issued against the DBS also results in a table. A table has the following

More information

CS345 Project Presentation

CS345 Project Presentation CS345 Project Presentation Language: Hmm++ TanmayaGodbole, Melissa Olson, Sriratana Sutasirisap Project Overview: Hmm++ Revise and correct existing BNF Implement First Class Function Add an object oriented

More information

SQL. - single row functions - Database Design ( 데이터베이스설계 ) JUNG, Ki-Hyun ( 정기현 )

SQL. - single row functions - Database Design ( 데이터베이스설계 ) JUNG, Ki-Hyun ( 정기현 ) SQL Database Design ( 데이터베이스설계 ) - single row functions - JUNG, Ki-Hyun ( 정기현 ) 1 SQL Functions Input Function Output Function performs action that defined already before execution 2 Two Types of SQL Functions

More information

7/17/2018. Copyright 2016, Oracle and/or its affiliates. All rights reserved. 2

7/17/2018. Copyright 2016, Oracle and/or its affiliates. All rights reserved. 2 Copyright 2016, Oracle and/or its affiliates. All rights reserved. 2 1 Typical speaker ego slide blog connor-mcdonald.com youtube tinyurl.com/connor-tube twitter @connor_mc_d Copyright 2016, Oracle and/or

More information

1 SQL Structured Query Language

1 SQL Structured Query Language 1 SQL Structured Query Language 1.1 Tables In relational database systems (DBS) data are represented using tables (relations). A query issued against the DBS also results in a table. A table has the following

More information

The Seven Case Tables

The Seven Case Tables A P P E N D I X A The Seven Case Tables This appendix offers an overview of the seven case tables used throughout this book, in various formats. Its main purpose is to help you in writing SQL commands

More information

KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOMEWORK CLASS-XII INFORMATICS PRACTICES

KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOMEWORK CLASS-XII INFORMATICS PRACTICES KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOMEWORK 18-19 CLASS-XII INFORMATICS PRACTICES 1. Arrange the following data types in increasing order of their size : byte, int, float, double, char, boolean.

More information

CIS Reading Packet: "Views, and Simple Reports - Part 1"

CIS Reading Packet: Views, and Simple Reports - Part 1 CIS 315 - Reading Packet: "Views, and Simple Reports - Part 1" p. 1 CIS 315 - Reading Packet: "Views, and Simple Reports - Part 1" Sources: * Oracle9i Programming: A Primer, Rajshekhar Sunderraman, Addison

More information

Database Compatibility for Oracle Developers Tools and Utilities Guide

Database Compatibility for Oracle Developers Tools and Utilities Guide Database Compatibility for Oracle Developers EDB Postgres Advanced Server 10 August 29, 2017 by EnterpriseDB Corporation Copyright 2007-2017 EnterpriseDB Corporation. All rights reserved. EnterpriseDB

More information

Code No. 90 Please check that this question paper contains 6 printed pages. Code number given on the right hand side of the question paper should be written on the title page of the answer-book by the

More information

Creating and Managing Tables Schedule: Timing Topic

Creating and Managing Tables Schedule: Timing Topic 9 Creating and Managing Tables Schedule: Timing Topic 30 minutes Lecture 20 minutes Practice 50 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe the

More information

Practical Workbook Database Management Systems

Practical Workbook Database Management Systems Practical Workbook Database Management Systems Name : Year : Batch : Roll No : Department: Third Edition Reviewed in 2014 Department of Computer & Information Systems Engineering NED University of Engineering

More information

NURSING_STAFF NNbr NName Grade

NURSING_STAFF NNbr NName Grade The SELECT command is used to indicate which information we need to obtain not how the information is to be processed. SQL is a non-procedural language. SELECT [DISTINCT ALL] {* [column_expression [AS

More information

CIS Week 11 Lab Exercise p. 1 Fall 2009

CIS Week 11 Lab Exercise p. 1 Fall 2009 CIS 315 - Week 11 Lab Exercise p. 1 Sources: CIS 315 - Slightly-different version of Week 11 Lab, 11-03-09 additional create-table constraints, introduction to sequences, SQL*Loader, and views, and very

More information

Q5 Question Based on SQL & Database Concept Total Marks 8. Theory Question 2 Marks / SQL Commands 6 Marks / Output of commands 2 Marks

Q5 Question Based on SQL & Database Concept Total Marks 8. Theory Question 2 Marks / SQL Commands 6 Marks / Output of commands 2 Marks Q5 Question Based on SQL & Database Concept Total Marks 8 Theory Question 2 Marks / SQL Commands 6 Marks / Output of commands 2 Marks Q1 Define the Following with example i) Primary Key ii) Foreign Key

More information

GIFT Department of Computing Science. [Spring 2016] CS-217: Database Systems. Lab-3 Manual. Single Row Functions in SQL

GIFT Department of Computing Science. [Spring 2016] CS-217: Database Systems. Lab-3 Manual. Single Row Functions in SQL GIFT Department of Computing Science [Spring 2016] CS-217: Database Systems Lab-3 Manual Single Row Functions in SQL V3.0 4/26/2016 Introduction to Lab-3 Functions make the basic query block more powerful,

More information

Autonomous Transactions

Autonomous Transactions Autonomous Transactions Autonomous transactions allow you to create a new transaction within a transaction that may commit or roll back changes, independently of its parent transaction. They allow you

More information

a 64-bit Environment Author: Rob procedures. SSIS servers. Attunity.

a 64-bit Environment Author: Rob procedures. SSIS servers. Attunity. Oracle Driver configuration for SSIS, SSRS and SSAS in Environment a 64-bit Technical Article Author: Rob Kerr ( rkerr@blue-granite.com, http://blog.robkerr.com ) Published: March 2010 Applies to: SQL

More information

Oracle Database 18c. Gentle introduction to Polymorphic Tables Functions with Common patterns and sample use cases

Oracle Database 18c. Gentle introduction to Polymorphic Tables Functions with Common patterns and sample use cases Oracle Database 18c Gentle introduction to Polymorphic Tables Functions with Common patterns and sample use cases About me. Keith Laker Product Manager for Analytic SQL and Autonomous DW Oracle Blog: oracle-big-data.blogspot.com

More information

Programming Languages. Dr. Philip Cannata 1

Programming Languages. Dr. Philip Cannata 1 Programming Languages Dr. Philip Cannata 1 10 High Level Languages This Course Jython in Java Java (Object Oriented) Relation ASP RDF (Horn Clause Deduction, Semantic Web) Dr. Philip Cannata 2 I think

More information

Active Databases Part 1: Introduction CS561

Active Databases Part 1: Introduction CS561 Active Databases Part 1: Introduction CS561 1 Active Databases n Triggers and rules are developed for data integrity and constraints n Triggers make passive database active Database reacts to certain situations

More information

Relational Database Management Systems Oct I. Section-A: 5 X 4 =20 Marks

Relational Database Management Systems Oct I. Section-A: 5 X 4 =20 Marks Relational Database Management Systems Oct 2015 1 I. Section-A: 5 X 4 =20 Marks 1. Data Consistency Files and application programs are created by different programmers over a long period of time, the files

More information

Power Up Your Apps with Recursive Subquery Factoring. Jared Still 2014

Power Up Your Apps with Recursive Subquery Factoring. Jared Still 2014 Power Up Your Apps with Recursive Subquery Factoring Jared Still 2014 About Me Prefer cmdline to GUI Like to know how things work Perl aficionado Oak Table Member Oracle ACE Started Oracle-L Twitter: @PerlDBA

More information

THE INDIAN COMMUNITY SCHOOL, KUWAIT

THE INDIAN COMMUNITY SCHOOL, KUWAIT THE INDIAN COMMUNITY SCHOOL, KUWAIT SERIES : II MID TERM /FN/ 18-19 CODE : M 065 TIME ALLOWED : 2 HOURS NAME OF STUDENT : MAX. MARKS : 50 ROLL NO. :.. CLASS/SEC :.. NO. OF PAGES : 3 INFORMATICS PRACTICES

More information

Miguel Anjo (IT/ADC)

Miguel Anjo (IT/ADC) Database Workshop for LHC online/offline developers SQL (2/2) (IT/ADC) Miguel.Anjo@cern.ch http://cern.ch/it-adc (based on Andrea Valassi slides on Advanced SQL) 26 January 2005 Previous tutorials: Database

More information

Create Rank Transformation in Informatica with example

Create Rank Transformation in Informatica with example Create Rank Transformation in Informatica with example Rank Transformation in Informatica. Creating Rank Transformation in Inforamtica. Creating target definition using Target designer. Creating a Mapping

More information

Databases IIB: DBMS-Implementation Exercise Sheet 13

Databases IIB: DBMS-Implementation Exercise Sheet 13 Prof. Dr. Stefan Brass January 27, 2017 Institut für Informatik MLU Halle-Wittenberg Databases IIB: DBMS-Implementation Exercise Sheet 13 As requested by the students, the repetition questions a) will

More information

Q1. (SQL) Consider the following table HOSPITAL. Write SQL commands for the statements (i) to (v)

Q1. (SQL) Consider the following table HOSPITAL. Write SQL commands for the statements (i) to (v) Q1. (SQL) Consider the following table HOSPITAL. Write SQL commands for the statements (i) to Table : HOSPITAL No Name Age Department Date of adm Charges Sex 1 Arpit 62 Surgery 21.01.98 300 M 2 Zarina

More information

: ADMINISTRATION I EXAM OBJECTIVES COVERED IN THIS CHAPTER:

: ADMINISTRATION I EXAM OBJECTIVES COVERED IN THIS CHAPTER: 4367c01.fm Page 1 Wednesday, April 6, 2005 8:14 AM Chapter 1 Oracle Database 10g Components and Architecture ORACLE DATABASE 10G: ADMINISTRATION I EXAM OBJECTIVES COVERED IN THIS CHAPTER: Installing Oracle

More information

Relational Database Management Systems Mar/Apr I. Section-A: 5 X 4 =20 Marks

Relational Database Management Systems Mar/Apr I. Section-A: 5 X 4 =20 Marks Relational Database Management Systems Mar/Apr 2015 1 I. Section-A: 5 X 4 =20 Marks 1. Database Database: Database is a collection of inter-related data which contains the information of an enterprise.

More information

Databases - 4. Other relational operations and DDL. How to write RA expressions for dummies

Databases - 4. Other relational operations and DDL. How to write RA expressions for dummies Databases - 4 Other relational operations and DDL How to write RA expressions for dummies Step 1: Identify the relations required and CP them together Step 2: Add required selections to make the CP Step

More information

Database Compatibility for Oracle Developers Tools and Utilities Guide

Database Compatibility for Oracle Developers Tools and Utilities Guide Database Compatibility for Oracle Developers EDB Postgres Advanced Server 9.6 August 22, 2016 by EnterpriseDB Corporation Copyright 2007-2016 EnterpriseDB Corporation. All rights reserved. EnterpriseDB

More information

Practical Workbook Database Management Systems

Practical Workbook Database Management Systems Practical Workbook Database Management Systems Name : Year : Batch : Roll No : Department: Department of Computer & Information Systems Engineering NED University of Engineering & Technology, Karachi 75270,

More information

SQL. Char (30) can store ram, ramji007 or 80- b

SQL. Char (30) can store ram, ramji007 or 80- b SQL In Relational database Model all the information is stored on Tables, these tables are divided into rows and columns. A collection on related tables are called DATABASE. A named table in a database

More information

Definitions. Database Architecture. References Fundamentals of Database Systems, Elmasri/Navathe, Chapter 2. HNC Computing - Databases

Definitions. Database Architecture. References Fundamentals of Database Systems, Elmasri/Navathe, Chapter 2. HNC Computing - Databases HNC Computing - s HNC Computing - s Architecture References Fundamentals of Systems, Elmasri/Navathe, Chapter 2 Systems : A Practical Approach, Connolly/Begg/Strachan, Chapter 2 Definitions Schema Description

More information

11 things about Oracle Database 11g Release 2. Thomas Kyte

11 things about Oracle Database 11g Release 2. Thomas Kyte 11 things about Oracle Database 11g Release 2 Thomas Kyte http://asktom.oracle.com/ 1 Do it yourself Parallelism Incrementally modify a table in parallel Used to do this manually all of the time Search

More information

ajpatelit.wordpress.com

ajpatelit.wordpress.com ALPHA COLLEGE OF ENGINEERING & TECHNOLOGY COMPUTER ENGG. / INFORMATION TECHNOLOGY Database Management System (2130703) All Queries 1. Write queries for the following tables. T1 ( Empno, Ename, Salary,

More information

What are temporary tables? When are they useful?

What are temporary tables? When are they useful? What are temporary tables? When are they useful? Temporary tables exists solely for a particular session, or whose data persists for the duration of the transaction. The temporary tables are generally

More information

Databases. Relational Model, Algebra and operations. How do we model and manipulate complex data structures inside a computer system? Until

Databases. Relational Model, Algebra and operations. How do we model and manipulate complex data structures inside a computer system? Until Databases Relational Model, Algebra and operations How do we model and manipulate complex data structures inside a computer system? Until 1970.. Many different views or ways of doing this Could use tree

More information

Trigger is a stored procedure which is called implicitly by oracle engine whenever a insert, update or delete statement is fired.

Trigger is a stored procedure which is called implicitly by oracle engine whenever a insert, update or delete statement is fired. Aim:- TRIGGERS Trigger is a stored procedure which is called implicitly by oracle engine whenever a insert, update or delete statement is fired. Advantages of database triggers: ---> Data is generated

More information

5 Integrity Constraints and Triggers

5 Integrity Constraints and Triggers 5 Integrity Constraints and Triggers 5.1 Integrity Constraints In Section 1 we have discussed three types of integrity constraints: not null constraints, primary keys, and unique constraints. In this section

More information

Oracle REST Data Services Quick Start Guide. Release 17.4

Oracle REST Data Services Quick Start Guide. Release 17.4 Oracle REST Data Services Quick Start Guide Release 17.4 E88402-01 December 2017 Oracle REST Data Services Quick Start Guide, Release 17.4 E88402-01 Copyright 2011, 2017, Oracle and/or its affiliates.

More information

Q.1 Short Questions Marks 1. New fields can be added to the created table by using command. a) ALTER b) SELECT c) CREATE. D. UPDATE.

Q.1 Short Questions Marks 1. New fields can be added to the created table by using command. a) ALTER b) SELECT c) CREATE. D. UPDATE. ID No. Knowledge Institute of Technology & Engineering - 135 BE III SEMESTER MID EXAMINATION ( SEPT-27) PAPER SOLUTION Subject Code: 2130703 Date: 14/09/27 Subject Name: Database Management Systems Branches:

More information

Objectives. After completing this lesson, you should be able to do the following:

Objectives. After completing this lesson, you should be able to do the following: Objectives After completing this lesson, you should be able to do the following: Write SELECT statements to access data from more than one table using equality and nonequality joins View data that generally

More information

151 Mixed bag of HOTS questions from VB 15 A VB program accepts a number in a text box and rounds the number to 0 decimal places. Write the VB code under the button cmdround to achieve this feature. Do

More information

@vmahawar. Agenda Topics Quiz Useful Links

@vmahawar. Agenda Topics Quiz Useful Links @vmahawar Agenda Topics Quiz Useful Links Agenda Introduction Stakeholders, data classification, Rows/Columns DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE CONSTRAINTS, DATA TYPES DML Data

More information

Tuning Considerations for Different Applications Lesson 4

Tuning Considerations for Different Applications Lesson 4 4 Tuning Considerations for Different Applications Lesson 4 Objectives After completing this lesson, you should be able to do the following: Use the available data access methods to tune the logical design

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 4-3 Objectives This lesson covers the following objectives: Demonstrate the use of SYSDATE and date functions State the implications for world businesses to be able to easily

More information

Oracle 12c New Features For Developers

Oracle 12c New Features For Developers Oracle 12c New Features For Developers Presented by: John Jay King Download this paper from: 1 Session Objectives Learn new Oracle 12c features that are geared to developers Know how existing database

More information

CS Reading Packet: "Simple Reports - Part 2"

CS Reading Packet: Simple Reports - Part 2 CS 325 - Reading Packet: "Simple Reports - Part 2" p. 1 CS 325 - Reading Packet: "Simple Reports - Part 2" Sources: * Oracle9i Programming: A Primer, Rajshekhar Sunderraman, Addison Wesley. * Classic Oracle

More information

PL/SQL User s Guide and Reference

PL/SQL User s Guide and Reference PL/SQL User s Guide and Reference Release 2.2 March 1995 Part No. A19486 2 PL/SQL User s Guide and Reference, Release 2.2 Part No. A19486 2 Copyright Oracle Corporation 1988, 1995 All rights reserved.

More information

C. Use the TO_CHAR function around SYSDATE, that is, 1_date := TO_CHAR (SYSDATE).

C. Use the TO_CHAR function around SYSDATE, that is, 1_date := TO_CHAR (SYSDATE). Volume: 75 Questions Question: 1 Examine this code: Users of this function may set different date formats in their sessions. Which two modifications must be made to allow the use of your session s date

More information

ACCESS isn t only a great development tool it s

ACCESS isn t only a great development tool it s Upsizing Access to Oracle Smart Access 2000 George Esser In addition to showing you how to convert your Access prototypes into Oracle systems, George Esser shows how your Access skills translate into Oracle.

More information

<Insert Picture Here> Oracle Database 11g: Neue Features im Oracle Optimizer

<Insert Picture Here> Oracle Database 11g: Neue Features im Oracle Optimizer Oracle Database 11g: Neue Features im Oracle Optimizer Hermann Bär, Oracle Director Product Management, Server Technologies Data Warehousing Inside the Oracle Database 11g Optimizer

More information

GET POST ORDS JSON: Web Services for APEX Decoded

GET POST ORDS JSON: Web Services for APEX Decoded GET POST ORDS JSON: Web Services for APEX Decoded Welcome 2 About Me About Sumner Technologies scott@sumnertech.com @sspendol Originally Established 2005 Relaunched in 2015 Focused exclusively on Oracle

More information

Chapter _CH06/CouchmanX 10/2/01 1:32 PM Page 259. Manipulating Oracle Data

Chapter _CH06/CouchmanX 10/2/01 1:32 PM Page 259. Manipulating Oracle Data Chapter 6 200095_CH06/CouchmanX 10/2/01 1:32 PM Page 259 Manipulating Oracle Data 200095_CH06/CouchmanX 10/2/01 1:32 PM Page 260 260 OCP Introduction to Oracle9i: SQL Exam Guide T his chapter covers the

More information

INDEX. 1 Introduction. 2 Types of Cursors 2.1 Explicit cursor 2.2 Attributes 2.3 Implicit cursor 2.4 Attributes. 3 Parameterized cursor

INDEX. 1 Introduction. 2 Types of Cursors 2.1 Explicit cursor 2.2 Attributes 2.3 Implicit cursor 2.4 Attributes. 3 Parameterized cursor INDEX 1 Introduction 2 Types of Cursors 2.1 Explicit cursor 2.2 Attributes 2.3 Implicit cursor 2.4 Attributes 3 Parameterized cursor INTRODUCTION what is cursor? we have seen how oracle executes an SQL

More information

Infrastructure at your Service. In-Memory-Pläne für den 12.2-Optimizer: Teuer oder billig?

Infrastructure at your Service. In-Memory-Pläne für den 12.2-Optimizer: Teuer oder billig? Infrastructure at your Service. In-Memory-Pläne für den 12.2-Optimizer: Teuer oder billig? About me Infrastructure at your Service. Clemens Bleile Senior Consultant Oracle Certified Professional DB 11g,

More information

Expert Oracle Database Architecture

Expert Oracle Database Architecture Expert Oracle Database Architecture Oracle Database 9i, 10g, and 11g Programming Techniques and Solutions Second Edition Thomas Kyte Expert Oracle Database Architecture: Oracle Database 9i, 10g, and 11g

More information

Using the Set Operators. Copyright 2006, Oracle. All rights reserved.

Using the Set Operators. Copyright 2006, Oracle. All rights reserved. Using the Set Operators Objectives After completing this lesson, you should be able to do the following: Describe set operators Use a set operator to combine multiple queries into a single query Control

More information

Tables From Existing Tables

Tables From Existing Tables Creating Tables From Existing Tables After completing this module, you will be able to: Create a clone of an existing table. Create a new table from many tables using a SQL SELECT. Define your own table

More information

Partitioning. The Uses of Partitioning

Partitioning. The Uses of Partitioning Partitioning Partitioning in Oracle was first introduced in Oracle 8.0. It is the ability to physically break a table or index into many smaller more manageable pieces. As far as the application accessing

More information

Question Bank. Class : XII( ) Subject : Informatics Practices(065)

Question Bank. Class : XII( ) Subject : Informatics Practices(065) Question Bank Class : XII(2017-18) Subject : Informatics Practices(065) 1. What is the purpose of modem? [1] 2. Define Domain Name Resolution. [1] 3. What do you mean by transmission media? Name the type

More information

Using RESTfull services and remote SQL

Using RESTfull services and remote SQL Using RESTfull services and remote SQL from APEX Apex 18.15.2 EA2EA1 Agenda What is REST Using REST within APEX Web Source Modules Legacy Web Service References Build a Restful API for MySQL with NodeJS

More information

Databases - 3. Null, Cartesian Product and Join. Null Null is a value that we use when. Something will never have a value

Databases - 3. Null, Cartesian Product and Join. Null Null is a value that we use when. Something will never have a value Databases - 3 Null, Cartesian Product and Join Null Null is a value that we use when Something will never have a value Something will have a value in the future Something had a value but doesn t at the

More information

Appendix C. Database Administration. Using SQL. SQL Statements. Data Definition Statements (DDL)

Appendix C. Database Administration. Using SQL. SQL Statements. Data Definition Statements (DDL) Appendix C Appendix C Database Administration The following sections provide information about the tools that can be used to maintain your Oracle Utilities Work and Asset Management database. Using SQL

More information

Maintaining Data 3.3.1

Maintaining Data 3.3.1 Maintaining Data Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 4.0.3 3.3.1 Unit Objectives After completing this unit, you should be able to: Create

More information

Downloaded from

Downloaded from Unit-III DATABASES MANAGEMENT SYSTEM AND SQL DBMS & Structured Query Language Chapter: 07 Basic Database concepts Data : Raw facts and figures which are useful to an organization. We cannot take decisions

More information

SYSTEM CODE COURSE NAME DESCRIPTION SEM

SYSTEM CODE COURSE NAME DESCRIPTION SEM Course: CS691- Database Management System Lab PROGRAMME: COMPUTER SCIENCE & ENGINEERING DEGREE:B. TECH COURSE: Database Management System Lab SEMESTER: VI CREDITS: 2 COURSECODE: CS691 COURSE TYPE: Practical

More information

Computer Science 21b (Spring Term, 2015) Structure and Interpretation of Computer Programs. Lexical addressing

Computer Science 21b (Spring Term, 2015) Structure and Interpretation of Computer Programs. Lexical addressing Computer Science 21b (Spring Term, 2015) Structure and Interpretation of Computer Programs Lexical addressing The difference between a interpreter and a compiler is really two points on a spectrum of possible

More information

Database Programming with SQL 5-1 Conversion Functions. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Programming with SQL 5-1 Conversion Functions. Copyright 2015, Oracle and/or its affiliates. All rights reserved. Database Programming with SQL 5-1 Objectives This lesson covers the following objectives: Provide an example of an explicit data-type conversion and an implicit data-type conversion Explain why it is important,

More information

P.G.D.C.M. (Semester I) Examination, : ELEMENTS OF INFORMATION TECHNOLOGY AND OFFICE AUTOMATION (2008 Pattern)

P.G.D.C.M. (Semester I) Examination, : ELEMENTS OF INFORMATION TECHNOLOGY AND OFFICE AUTOMATION (2008 Pattern) *4089101* [4089] 101 P.G.D.C.M. (Semester I) Examination, 2011 101 : ELEMENTS OF INFORMATION TECHNOLOGY AND OFFICE AUTOMATION (2008 Pattern) Time : 3 Hours Max. Marks : 70 Note : 1) Q. 1 is compulsory.

More information

Crystal Reports. Overview. Contents. Oracle Stored Procedures and Crystal Reports

Crystal Reports. Overview. Contents. Oracle Stored Procedures and Crystal Reports Overview This article provides information for Oracle stored procedures and Crystal Reports (CR). You will find detailed information on the following: Contents CR versions that support Oracle stored procedures.

More information

SQL Simple Queries. Chapter 3.1 V3.01. Napier University

SQL Simple Queries. Chapter 3.1 V3.01. Napier University SQL Simple Queries Chapter 3.1 V3.01 Copyright @ Napier University Introduction SQL is the Structured Query Language It is used to interact with the DBMS (database management system) SQL can Create Schemas

More information

Michigan Tech University Banner Finance Self-Service User Guide. Revised 1/11/17

Michigan Tech University Banner Finance Self-Service User Guide. Revised 1/11/17 Michigan Tech University Banner Finance Self-Service User Guide Revised 1/11/17 TABLE OF CONTENTS Chart Terminology... 3 MTU Fiscal Year... 3 Web Resource Banner and Reporting... 3 Reports Listing your

More information