数据库系统概论讲义, 第 8 章编程 SQL,2015,3

Size: px
Start display at page:

Download "数据库系统概论讲义, 第 8 章编程 SQL,2015,3"

Transcription

1

2 数据库系统概论 An Introduction to Database Systems 第八章数据库编程 (ODBC, PL/SQL) 2016, 3, 29

3 Programmatic SQL Three types of programmatic SQL Embedded SQL statements ISO standard specifies embedded support for C, COBOL, Fortran, Pascal, PL/1 Application Programming Interface (API) ODBC JDBC Specific API, like APIs in COBASE Procedure SQL PL/SQL

4 The Open Database Connectivity Standard(1) An alternative approach to embedding SQL statements directly in a host language is to provide programmers with a library of functions that can be invoked from the application software. For many programmers, the use of library routines is standard practice, and they find API a relatively straightforward way to use SQL

5 ODBC Standard(2) The API consists of a set of library function for many of the common types of database access that programmers required, such as connecting to a database, executing SQL, retrieving individual rows of a result table One problem with this approach has been lack of interoperability Programs have to be processed using the DBMS vendor s precompiler and linked with this vendor s API library That will produces DBMS-specific code for each DBMS they want to access

6 ODBC Standard(3) In an attempt to standardize this approach, Microsoft produced the Open Database Connectivity (ODBC) standard ODBC technology provides a common interface for accessing heterogeneous SQL database, based on SQL as the standard for accessing data This interface provides a high degree of interoperatibility: A single application can access different SQL DBMSs through a common set of code

7 ODBC Standard(4) ODBC has emerged as a de facto industry standard. One reason for ODBC popularity is its flexibility Application are not tied to a proprietary vendor API SQL statements can be explicitly included in source code or constructed dynamically at runtime; An application can ignore the underlying data communications protocols; ODBC is designed in conjunction with the X/Open and ISO Call- Level Interface (CLI) standard There are ODBC database drivers available today for many of most popular DBMSs

8 ODBC Architecture(1) The ODBC interface defines the following: A library of function calls that allow an application to connect to a DBMS, execute SQL statement, and retrieve results; A standard way to connect and log on to a DBMS A standard representation of data types A standard set of error codes SQL syntax based on the X/Open and ISO Call-Level Interface (CLI) specification

9 ODBC Architecture(2) The ODBC architecture has four components: Application Driver Manager Driver and Database Agent Data Source

10 ODBC Architecture(3) Application Driver Manager Driver Driver Driver ODBC interface Application Driver Manager Driver Data source Data source Data source Data source Data source Data source Multiple drivers Single drivers

11 ODBC Architecture(4) Q Application Q Q Q Q Q Source T S Source T S Source T S Source T S Source T S

12 ODBC Architecture(4) Q Application ODBC ODBC ODBC ODBC Q Driver Q Driver Q Driver Q Driver Q ODBC Driver Source T S Source T S Source T S Source T S Source T S

13 ODBC Conformance Levels ODBC defines two different conformance levels for drivers: ODBC API ODBC SQL ODBC defines a core grammar that corresponds to the X/Open CAE specification (1992) ISO CLI specification (1995) ODBC 3.0 fully implements both these specifications and adds features commonly needed by developers of screen-based database applications, such as scrollable cursor

14 ODBC SQL Conformance Levels(1) Minimum SQL grammar DDL: CREATE TABLE DROP TABLE DML: Simple SELECT INSERT, UPDATE, DELETE Expressions: simple ( such as A > B+C ) Data Type CHAR, VARCHAR, LONG VARCHAR

15 ODBC SQL Conformance Levels(2) Core SQL grammar Minimum SQL grammar and data types DDL: ALTER TABLE, CREATE INDEX, DROP INDEX, CREATE VIEW, DROP VIEW, GRANT, REVOKE DML: Full SELECT Expressions: subquery, set function Data Type DECIMAL, NUMBER, SMALLINT, INTEGER, REAL, FLOAT, DOUBLE PRECISION

16 ODBC SQL Conformance Levels(3) Extended SQL grammar Minimum and core SQL grammar and data types DML: Outer joins, positioned UPDATE, positioned DELETE, SELECT FOR UPDATE, union Expressions: scalar functions such as SUBSTRING and ABS, date, time Data Type BIT, TINYBIT, BIGING, BINARY, VARBINARY, LONG VARBINARY, DATE, TIME, TIMESTAMP Batch SQL statements Procedure calls

17 Using ODBC(1) Allocate an environment handle: SQLAllocEnv(): allocates memory for the handle and initialize the ODBC Call-Level Interface for use by the application Allocate a connection handle SQLAllocConnect(): A connection consists of a driver and a data source. A connection handle identifies each connection and identifies which driver to use and which data source to use with that driver.

18 Using ODBC (2) Connect to the data source SQLConnect():This call loads a driver and establishes a connection to the named data source. Allocate a statement handle SQLAllocStmt(): A statement handle references statement information such as network information, SQLSTATE values and error messages, cursor name, number of result set columns On completion, all handles must be freed and the connection to the data source terminated

19 Using ODBC (3) Execute SQL statement SQLExecdirect SQLPrepare, SQLExecute

20 Using ODBC (4) Result processing Get information SQLNumResultCols: return the col number SQLDescribeCol, SQLColAttribute: return the coloumn name, data type, ect.. Automatically using cursor for a query SQLBindCol: SQLFetch SQLGetData SQLClosecursor

21 int Getdata_ODBC(Mo_infor_quad *pdata[routenumber],int rmpid) { HENV henv; HDBC hdbc; HSTMT hstmt; RETCODE rc; UCHAR selstmt[500]; UCHAR sname[6] SDWORD snamelen;

22 rc=sqlallocenv(&henv); /* allocate an environment handle */ rc=sqlallocconnect(henv,&hdbc);/* allocate a connection handle */ rc=sqlconnect(hdbc, (unsigned char *)"SQL Server Source", SQL_NTS,/* data source name */ (unsigned char *)"rding", SQL_NTS, /* user identifier */ (unsigned char *) 1234",SQL_NTS); /* password */ /* Note, SQL_NTS directs the driver to determine the length of the string by locating the null-termination character */ if ( rc==sql_success rc == SQL_SUCCESS_WITH_INFO) { rc=sqlallocstmt(sql_handle_stmt,hdbc,&hstmt); /* allocate statement handle */

23 /* Now set up the SELECT statement, execute it, and then bind the columns of the result set */ lstrcp(selstmt, SELECT name from students WHERE SSN = 2345 ); if ( SQLExecDirect(hStmt, selstmt, SQL_NTS)!= SQL_SUCCESS) exit(-1); SQLBindCol(hStmt, 1, SQL_C_CHAR, sname, (SDWORD)sizeof(sName), &snamelen); /* Now fetch the result set, row by row */ while ( rc == SQL_SUCCESS rc == SQL_SUCCESS_WITH_INFO) { rc = SQLFetch(hStmt); if (rc == SQL_SUCCESS rc == SQL_SUCCESS_WITH_INFO) { } } SQLDisconnect(hstmt); } SQLFreeConnect(hdbc); SQLFreeEnv(henv); }

24 PL/SQL PL/SQL is Oracle's Procedural Language extension to SQL. PL/SQL has many programming language features. Program units written in PL/SQL can be stored in compiled form. PL/SQL code is portable across all operating systems that support Oracle. PL/SQL does not support DDL and DCL.

25 PL/SQL Block A PL/SQL block contains logically related SQL and PL/SQL statements. Three sections in a typical PL/SQL block: declaration (optional): declare identifiers (variables and constants). execution (required): execute SQL and PL/SQL statements. exception (optional): perform error handling.

26 Sample Program 1 (1) declare student_name Students.Name%TYPE; student_dept Students.Dept_name%TYPE; begin select Name, Dept_name into student_name, student_dept /* no : needed before host variables */ from Students where SSN = ` ';

27 Sample Program 1 (2) if (student_dept = Computer Science ) then dbms_output.put_line(`this is a CS student.'); else dbms_output.put_line(`this is not a CS student.'); end if; end; / /* end each PL/SQL program with / */

28 Execute PL/SQL Program Save the program in a file: sample1.sql Execute the program in SQL*Plus SQL> start sample1 Enable output to the screen: SQL> set serveroutput on or place set serveroutput on at the beginning of the PL/SQL program.

29 Procedure procedure procedure_name [(parameter, parameter,, parameter)] is [local declarations] begin execution section; [exception section] end; parameter definition: parameter_name [in out in out] data_type

30 Procedure A parameter has a specified name and data type but can also be designated as: IN parameter is used as an input value only OUT parameter is used as an output value only IN OUT parameter is used as both an input and an output value

31 Sample Program (1) set serveroutput on declare v_cid customers.cid%type; v_cname customers.cname%type; v_city customers.city%type; status boolean; procedure get_customer( cust_id in customers.cid%type, cust_name out customers.cname%type, cust_city out customers.city%type, status out boolean) is

32 Sample Program (2) begin select cname, city into cust_name, cust_city from customers where cid = cust_id; status := true; exception when no_data_found then status := false; end; begin v_cid := c001 ; get_customer(v_cid, v_cname, v_city, status);

33 end; / if (status) then Sample Program (3) dbms_output.put_line(v_cid else v_cname v_city); dbms_output.put_line( Customer v_cid not found ); end if;

34 Stored Procedure and Function (1) procedure or function definitions can be stored for later use (in SQL and other PL/SQL blocks). Stored procedures/functions are stored in compiled form. Stored procedures and functions are created by create or replace procedure proc_name create or replace function func_name only in parameter allowed for function.

35 An Example set serveroutput on create or replace procedure get_cus_name( v_cust_id in customers.cid%type) is v_cust_name customers.cname%type; begin select cname into v_cust_name from customers where cid = v_cust_id; dbms_output.put_line( Customer name: v_cust_name); end; / show errors

36 Stored Procedure and Function (2) Compile stored procedure in file proc.sql SQL> start proc show errors displays errors detected during compiling the procedure. Execute stored procedure get_cus_name SQL> execute get_cus_name( c001 );

37 Package A package is a group of related PL/SQL objects (variables, ), procedures, and functions. Each package definition has two parts: package specification package body Package specification provides an interface to the users of the package. Package body contains actual code.

38 Package Specification (1) create or replace package banking as function check_balance (account_no in Accounts.acct_no%type) return Accounts.balance%type; procedure deposit (account_no in Accounts.acct_no%type, amount in Accounts.balance%type);

39 Package Specification (2) procedure withdraw (account_no in Accounts.acct_no%type, amount in Accounts.balance%type); end; / show errors

40 Package Body (1) create or replace package body banking as function check_balance (account_no in Accounts.acct_no%type) return Accounts.balance%type is acct_balance Accounts.balance%type; begin select balance into acct_balance from Accounts where acct_no = account_no; return acct_balance; end;

41 Package Body (2) procedure deposit (account_no in Accounts.acct_no%type, amount in Accounts.balance%type) is begin if (amount <= 0) then dbms_output.put_line( Wrong amount. ); else update Accounts set balance = balance + amount where acct_no = account_no; end if; end;

42 Package Body (3) procedure withdraw (account_no in Accounts.acct_no%type, amount in Accounts.balance%type) is acct_balance Accounts.balance%type;

43 Package Body (4) begin acct_balance := check_balance(account_no); if (amount > acct_balance) then dbms_output.put_line( Insufficient fund. ); else update Accounts set balance = balance - amount where acct_no = account_no; end if; end; end; /* end of the package body */ / show errors

44 Cursor in PL/SQL (1) Consider an SQL query returning multiple rows. How to save the result of the query? Save the result into a big array. No easy way to estimate the size of the result. The result could be too large for any memory-based array. Save one-row-at-a-time: This is the SQL approach.

45 Cursor in PL/SQL (2) Define a cursor: cursor cursor_name is select_statement; Example: cursor c1 is select cid, cname, city from customers; The query defining the cursor is not executed at the declaration time.

46 Working with Cursor (1) open cursor_name; fetch cursor_name into record_or_variable-list; close cursor_name; Open causes the query defining the cursor to be executed.

47 Built-in Package: dbms_sql (1) dbms_sql can be used to dynamically create and execute SQL statements, including DDL statements. Main steps: Open a handle cursor Parse the statement Close the cursor

48 Built-in Package: dbms_sql (2) declare handle integer; stmt varchar2(256); begin stmt := 'create table test (attr1 number(2) ' primary key, attr2 number(4))'; handle := dbms_sql.open_cursor; dbms_sql.parse(handle,stmt,dbms_sql.v7); dbms_output.put_line('table TEST created'); dbms_sql.close_cursor(handle); end; /

Application Programming and SQL: ODBC

Application Programming and SQL: ODBC Application Programming and SQL: ODBC Spring 2018 School of Computer Science University of Waterloo Databases CS348 (University of Waterloo) SQL and Applications 1 / 15 Call Level Interface/ODBC An interface

More information

IBM -

IBM - 6.1 6.2 6.3 6.4 2 6.1 q 6.1.1 SQL 3 q 6.1.2 Ø q Ø Ø Ø call level interface q Ø Web 4 6.1 6.2 6.3 6.4 5 6.2 q 6.2.1 6.2.2 6.2.3 6.2.4 6.2.5 SQL 6 6.2.1 q q Ø Ø Ø Ø 7 6.2.2 q q CONNECT TO < > < > < > [AS

More information

DataDirect Technologies

DataDirect Technologies DataDirect Technologies Designing Performance-Optimized ODBC Applications WHITE PAPER Abstract Recognized as experts in database access standards such as ODBC, Java JDBC, and ADO/OLE DB, DataDirect Technologies

More information

Designing Performance-Optimized ODBC Applications

Designing Performance-Optimized ODBC Applications Designing Performance-Optimized ODBC Applications Introduction Developing performance-oriented ODBC applications is not easy. Microsoft s ODBC Programmer s Reference does not provide information about

More information

IBM DB2 UDB V8.1 Family Application Development. Download Full Version :

IBM DB2 UDB V8.1 Family Application Development. Download Full Version : IBM 000-703 DB2 UDB V8.1 Family Application Development Download Full Version : https://killexams.com/pass4sure/exam-detail/000-703 Answer: B QUESTION: 114 An ODBC/CLI application performs an array insert

More information

The main ideas are presented via a sequence of four annotated C programs. These slides provide only supporting information.

The main ideas are presented via a sequence of four annotated C programs. These slides provide only supporting information. The main ideas are presented via a sequence of four annotated C programs. These slides provide only supporting information. These notes deal with the Microsoft Visual C++ programming environment. The notes

More information

Slides by: Ms. Shree Jaswal

Slides by: Ms. Shree Jaswal Slides by: Ms. Shree Jaswal A trigger is a statement that is executed automatically by the system as a side effect of a modification to the database. To design a trigger mechanism, we must: Specify the

More information

Oracle TimesTen In-Memory Database

Oracle TimesTen In-Memory Database Oracle TimesTen In-Memory Database C Developer's Guide Release 11.2.1 E13066-05 April 2010 Oracle TimesTen In-Memory Database C Developer's Guide, Release 11.2.1 E13066-05 Copyright 1996, 2010, Oracle

More information

Executing Queries How-to Topics (ODBC) Execute a Statement Directly (ODBC) Prepare and Execute a Statement (ODBC) Set Cursor Options (ODBC) Use a

Executing Queries How-to Topics (ODBC) Execute a Statement Directly (ODBC) Prepare and Execute a Statement (ODBC) Set Cursor Options (ODBC) Use a Table of Contents Executing Queries How-to Topics (ODBC) Execute a Statement Directly (ODBC) Prepare and Execute a Statement (ODBC) Set Cursor Options (ODBC) Use a Statement (ODBC) Executing Queries How-to

More information

Introduction to Computer Science and Business

Introduction to Computer Science and Business Introduction to Computer Science and Business The Database Programming with PL/SQL course introduces students to the procedural language used to extend SQL in a programatic manner. This course outline

More information

Oracle TimesTen In-Memory Database

Oracle TimesTen In-Memory Database Oracle TimesTen In-Memory Database C Developer s Guide Release 11.2.1 E13066-02 August 2009 Oracle TimesTen In-Memory Database C Developer's Guide, Release 11.2.1 E13066-02 Copyright 1996, 2009, Oracle

More information

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine.

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine. 1 PL/SQL INTRODUCTION SQL does not have procedural capabilities. SQL does not provide the programming techniques of condition checking, looping and branching that is required for data before permanent

More information

UNIT II PL / SQL AND TRIGGERS

UNIT II PL / SQL AND TRIGGERS UNIT II PL / SQL AND 1 TRIGGERS TOPIC TO BE COVERED.. 2.1 Basics of PL / SQL 2.2 Datatypes 2.3 Advantages 2.4 Control Structures : Conditional, Iterative, Sequential 2.5 Exceptions: Predefined Exceptions,User

More information

PL/SQL is a combination of SQL along with the procedural features of programming languages.

PL/SQL is a combination of SQL along with the procedural features of programming languages. (24 Marks) 5.1 What is PLSQL? PLSQL stands for Procedural Language extension of SQL. PLSQL is a combination of SQL along with the procedural features of programming languages. It was developed by Oracle

More information

CGS 3066: Spring 2017 SQL Reference

CGS 3066: Spring 2017 SQL Reference CGS 3066: Spring 2017 SQL Reference Can also be used as a study guide. Only covers topics discussed in class. This is by no means a complete guide to SQL. Database accounts are being set up for all students

More information

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language Information Systems Engineering SQL Structured Query Language DDL Data Definition (sub)language 1 SQL Standard Language for the Definition, Querying and Manipulation of Relational Databases on DBMSs Its

More information

SQL Fundamentals. Chapter 3. Class 03: SQL Fundamentals 1

SQL Fundamentals. Chapter 3. Class 03: SQL Fundamentals 1 SQL Fundamentals Chapter 3 Class 03: SQL Fundamentals 1 Class 03: SQL Fundamentals 2 SQL SQL (Structured Query Language): A language that is used in relational databases to build and query tables. Earlier

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 10 Outline Database Programming: Techniques and Issues Embedded SQL, Dynamic SQL, and SQLJ Database Programming with Function Calls: SQL/CLI and JDBC Database Stored Procedures and SQL/PSM Comparing

More information

Oracle TimesTen In-Memory Database C Developer s and Reference Guide Release 6.0 B

Oracle TimesTen In-Memory Database C Developer s and Reference Guide Release 6.0 B Oracle TimesTen In-Memory Database C Developer s and Reference Guide Release 6.0 B25265-03 For last-minute updates, see the TimesTen release notes. Copyright 1996, 2006, Oracle. All rights reserved. ALL

More information

Oracle Database 11g: SQL and PL/SQL Fundamentals

Oracle Database 11g: SQL and PL/SQL Fundamentals Oracle University Contact Us: +33 (0) 1 57 60 20 81 Oracle Database 11g: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn In this course, students learn the fundamentals of SQL and PL/SQL

More information

CMPT 354: Database System I. Lecture 2. Relational Model

CMPT 354: Database System I. Lecture 2. Relational Model CMPT 354: Database System I Lecture 2. Relational Model 1 Outline An overview of data models Basics of the Relational Model Define a relational schema in SQL 2 Outline An overview of data models Basics

More information

DBMaker ODBC Programmer's Guide

DBMaker ODBC Programmer's Guide DBMaker ODBC Programmer's Guide CASEMaker Inc./Corporate Headquarters 1680 Civic Center Drive Santa Clara, CA 95050, U.S.A. www.casemaker.com www.casemaker.com/support Copyright 1995-2017 by CASEMaker

More information

Section I : Section II : Question 1. Question 2. Question 3.

Section I : Section II : Question 1. Question 2. Question 3. Computer Science, 60-415 Midterm Examiner: Ritu Chaturvedi Date: Oct. 27 th, 2011 Student Name: Student Number: INSTRUCTIONS (Please Read Carefully) Examination Period is 1 hour and 15 minutes Answer all

More information

UNIT 2 Set Operators

UNIT 2 Set Operators Course Title: Database Systems ( M.C.A 1 st Semester ) (Evening Batch) UNIT 2 Set Operators Set operators are used to join the results of two (or more) SELECT statements.the SET operators available in

More information

Chapter 13 : Informatics Practices. Class XI ( As per CBSE Board) SQL Commands. New Syllabus Visit : python.mykvs.in for regular updates

Chapter 13 : Informatics Practices. Class XI ( As per CBSE Board) SQL Commands. New Syllabus Visit : python.mykvs.in for regular updates Chapter 13 : Informatics Practices Class XI ( As per CBSE Board) SQL Commands New Syllabus 2018-19 SQL SQL is an acronym of Structured Query Language.It is a standard language developed and used for accessing

More information

SQL Commands & Mongo DB New Syllabus

SQL Commands & Mongo DB New Syllabus Chapter 15 : Computer Science Class XI ( As per CBSE Board) SQL Commands & Mongo DB New Syllabus 2018-19 SQL SQL is an acronym of Structured Query Language.It is a standard language developed and used

More information

SQL User Defined Code. Kathleen Durant CS 3200

SQL User Defined Code. Kathleen Durant CS 3200 SQL User Defined Code Kathleen Durant CS 3200 1 User Session Objects Literals Text single quoted strings Numbers Database objects: databases, tables, fields, procedures and functions Can set a default

More information

Oracle TimesTen In-Memory Database

Oracle TimesTen In-Memory Database Oracle TimesTen In-Memory Database C Developer's Guide Release 11.2.1 E13066-10 March 2012 Oracle TimesTen In-Memory Database C Developer's Guide, Release 11.2.1 E13066-10 Copyright 1996, 2012, Oracle

More information

SQL: Data De ni on. B0B36DBS, BD6B36DBS: Database Systems. h p://www.ksi.m.cuni.cz/~svoboda/courses/172-b0b36dbs/ Lecture 3

SQL: Data De ni on. B0B36DBS, BD6B36DBS: Database Systems. h p://www.ksi.m.cuni.cz/~svoboda/courses/172-b0b36dbs/ Lecture 3 B0B36DBS, BD6B36DBS: Database Systems h p://www.ksi.m.cuni.cz/~svoboda/courses/172-b0b36dbs/ Lecture 3 SQL: Data De ni on Mar n Svoboda mar n.svoboda@fel.cvut.cz 13. 3. 2018 Czech Technical University

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the fundamentals of SQL and PL/SQL along with the

More information

ITCS Implementation. Jing Yang 2010 Fall. Class 14: Introduction to SQL Programming Techniques (Ch13) Outline

ITCS Implementation. Jing Yang 2010 Fall. Class 14: Introduction to SQL Programming Techniques (Ch13) Outline ITCS 3160 Data Base Design and Implementation Jing Yang 2010 Fall Class 14: Introduction to SQL Programming Techniques (Ch13) Outline Database Programming: Techniques and Issues Three approaches: Embedded

More information

Oracle Database: SQL and PL/SQL Fundamentals Ed 2

Oracle Database: SQL and PL/SQL Fundamentals Ed 2 Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Oracle Database: SQL and PL/SQL Fundamentals Ed 2 Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals

More information

INTRODUCTION TO DATABASE

INTRODUCTION TO DATABASE 1 INTRODUCTION TO DATABASE DATA: Data is a collection of raw facts and figures and is represented in alphabets, digits and special characters format. It is not significant to a business. Data are atomic

More information

Database Programming with PL/SQL

Database Programming with PL/SQL Database Programming with PL/SQL 12-1 Objectives This lesson covers the following objectives: Recall the stages through which all SQL statements pass Describe the reasons for using dynamic SQL to create

More information

Procedural Language Structured Query Language (PL/SQL)

Procedural Language Structured Query Language (PL/SQL) The Islamic University of Gaza Faculty of Engineering Dept. of Computer Engineering Database Lab (ECOM 4113) Lab 7 Procedural Language Structured Query Language (PL/SQL) Eng. Ibraheem Lubbad Structured

More information

SEF DATABASE FOUNDATION ON ORACLE COURSE CURRICULUM

SEF DATABASE FOUNDATION ON ORACLE COURSE CURRICULUM On a Mission to Transform Talent SEF DATABASE FOUNDATION ON ORACLE COURSE CURRICULUM Table of Contents Module 1: Introduction to Linux & RDBMS (Duration: 1 Week)...2 Module 2: Oracle SQL (Duration: 3 Weeks)...3

More information

Oracle TimesTen In-Memory Database

Oracle TimesTen In-Memory Database Oracle TimesTen In-Memory Database C Developer's Guide 11g Release 2 (11.2.2) E21637-09 December 2014 Oracle TimesTen In-Memory Database C Developer's Guide, 11g Release 2 (11.2.2) E21637-09 Copyright

More information

ForDBC. Jörg Kuthe. Fortran Database Connectivity

ForDBC. Jörg Kuthe. Fortran Database Connectivity Jörg Kuthe ForDBC Fortran Database Connectivity Revision date: 19th of August 2014 Copyright Jörg Kuthe (QT software GmbH), 1998-2018. All rights reserved. QT software GmbH Karl-Friedr.-Gauß-Str. 18 45657

More information

Chapter 5: Advanced SQL" Chapter 5: Advanced SQL"

Chapter 5: Advanced SQL Chapter 5: Advanced SQL Chapter 5: Advanced SQL" Database System Concepts, 6 th Ed.! Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-use " Chapter 5: Advanced SQL" Accessing SQL From a Programming Language!

More information

Chapter 4 SQL. Database Systems p. 121/567

Chapter 4 SQL. Database Systems p. 121/567 Chapter 4 SQL Database Systems p. 121/567 General Remarks SQL stands for Structured Query Language Formerly known as SEQUEL: Structured English Query Language Standardized query language for relational

More information

Chapter 13 Introduction to SQL Programming Techniques

Chapter 13 Introduction to SQL Programming Techniques Chapter 13 Introduction to SQL Programming Techniques Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Outline Database Programming: Techniques and Issues Embedded

More information

SQL (Structured Query Language)

SQL (Structured Query Language) Lecture Note #4 COSC4820/5820 Database Systems Department of Computer Science University of Wyoming Byunggu Yu, 02/13/2001 SQL (Structured Query Language) 1. Schema Creation/Modification: DDL (Data Definition

More information

Vendor: Oracle. Exam Code: 1Z Exam Name: Oracle Database 11g: Program with PL/ SQL. Version: Demo

Vendor: Oracle. Exam Code: 1Z Exam Name: Oracle Database 11g: Program with PL/ SQL. Version: Demo Vendor: Oracle Exam Code: 1Z0-144 Exam Name: Oracle Database 11g: Program with PL/ SQL Version: Demo QUESTION NO: 1 View the Exhibit to examine the PL/SQL code: SREVROUPUT is on for the session. Which

More information

Optional SQL Feature Summary

Optional SQL Feature Summary Optional SQL Feature Summary The following table lists all optional features included in the SQL standard, from SQL- 2003 to SQL-2016. It also indicates which features that are currently supported by Mimer

More information

Oracle TimesTen In-Memory Database C Developer s and Reference Guide Release 7.0 B

Oracle TimesTen In-Memory Database C Developer s and Reference Guide Release 7.0 B Oracle TimesTen In-Memory Database C Developer s and Reference Guide Release 7.0 B31680-03 Copyright 1996, 2007, Oracle. All rights reserved. ALL SOFTWARE AND DOCUMENTATION (WHETHER IN HARD COPY OR ELECTRONIC

More information

1. Using Bitvise SSH Secure Shell to login to CS Systems Note that if you do not have Bitvise ssh secure shell on your PC, you can download it from

1. Using Bitvise SSH Secure Shell to login to CS Systems Note that if you do not have Bitvise ssh secure shell on your PC, you can download it from 60-539 Fall 2016 Some SQL Commands 1. Using Bitvise SSH Secure Shell to login to CS Systems Note that if you do not have Bitvise ssh secure shell on your PC, you can download it from http://www.putty.org/..

More information

Chapter-14 SQL COMMANDS

Chapter-14 SQL COMMANDS Chapter-14 SQL COMMANDS What is SQL? Structured Query Language and it helps to make practice on SQL commands which provides immediate results. SQL is Structured Query Language, which is a computer language

More information

RDBMS - PL SQL - Topic 5 - MSBTE QUESTIONS AND ANSWERS

RDBMS - PL SQL - Topic 5 - MSBTE QUESTIONS AND ANSWERS RDBMS - PL SQL - Topic 5 - MSBTE QUESTIONS AND ANSWERS SUMMER 2017 Q. Describe Exception handling. Explain with example. 4 Marks Exception Handling: Exception is nothing but an error. Exception can be

More information

ORACLE TRAINING CURRICULUM. Relational Databases and Relational Database Management Systems

ORACLE TRAINING CURRICULUM. Relational Databases and Relational Database Management Systems ORACLE TRAINING CURRICULUM Relational Database Fundamentals Overview of Relational Database Concepts Relational Databases and Relational Database Management Systems Normalization Oracle Introduction to

More information

Unit 2: SQL AND PL/SQL

Unit 2: SQL AND PL/SQL Unit 2: SQL AND PL/SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Outline SQL: Characteristics and advantages, SQL Data Types and Literals, DDL, DML, DCL, TCL, SQL

More information

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Basic SQL Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Outline SQL Data Definition and Data Types Specifying Constraints in SQL Basic Retrieval Queries

More information

2 PL/SQL - fundamentals Variables and Constants Operators SQL in PL/SQL Control structures... 7

2 PL/SQL - fundamentals Variables and Constants Operators SQL in PL/SQL Control structures... 7 Table of Contents Spis treści 1 Introduction 1 2 PLSQL - fundamentals 1 2.1 Variables and Constants............................ 2 2.2 Operators.................................... 5 2.3 SQL in PLSQL.................................

More information

Outline. CS 235: Introduction to Databases. DB Application Programming. Interface Solutions. Basic PSM Form. Persistent Stored Modules

Outline. CS 235: Introduction to Databases. DB Application Programming. Interface Solutions. Basic PSM Form. Persistent Stored Modules Outline CS 235: Introduction to Databases Svetlozar Nestorov Database application programming SQL limitations SQL Persistent, Stored Modules (PSM) Extension of SQL PL/SQL: Oracle s version of PSM Lecture

More information

5. Single-row function

5. Single-row function 1. 2. Introduction Oracle 11g Oracle 11g Application Server Oracle database Relational and Object Relational Database Management system Oracle internet platform System Development Life cycle 3. Writing

More information

INFORMATION TECHNOLOGY NOTES

INFORMATION TECHNOLOGY NOTES Unit-6 SESSION 7: RESPOND TO A MEETING REQUEST Calendar software allows the user to respond to other users meeting requests. Open the email application to view the request. to respond, select Accept, Tentative,

More information

OVERVIEW OF THE TYPES OF PL/SQL BLOCKS:

OVERVIEW OF THE TYPES OF PL/SQL BLOCKS: OVERVIEW OF THE TYPES OF PL/SQL BLOCKS: The P/L SQL blocks can be divided into two broad categories: Anonymous Block: The anonymous block is the simplest unit in PL/SQL. It is called anonymous block because

More information

An Introduction to Structured Query Language

An Introduction to Structured Query Language An Introduction to Structured Query Language Grant Weddell Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Winter 2017 CS 348 (Intro to DB Mgmt) SQL

More information

Model Question Paper. Credits: 4 Marks: 140

Model Question Paper. Credits: 4 Marks: 140 Model Question Paper Subject Code: BT0075 Subject Name: RDBMS and MySQL Credits: 4 Marks: 140 Part A (One mark questions) 1. MySQL Server works in A. client/server B. specification gap embedded systems

More information

SQL: Programming Midterm in class next Thursday (October 5)

SQL: Programming Midterm in class next Thursday (October 5) Announcements (September 28) 2 Homework #1 graded Homework #2 due today Solution available this weekend SQL: Programming Midterm in class next Thursday (October 5) Open book, open notes Format similar

More information

Chapter 10 Java and SQL. Wang Yang

Chapter 10 Java and SQL. Wang Yang Chapter 10 Java and SQL Wang Yang wyang@njnet.edu.cn Outline Concern Data - File & IO vs. Database &SQL Database & SQL How Connect Java to SQL - Java Model for Database Java Database Connectivity (JDBC)

More information

IBM i Version 7.2. Database SQL call level interface IBM

IBM i Version 7.2. Database SQL call level interface IBM IBM i Version 7.2 Database SQL call leel interface IBM IBM i Version 7.2 Database SQL call leel interface IBM Note Before using this information and the product it supports, read the information in Notices

More information

RDBMS-Day3. SQL Basic DDL statements DML statements Aggregate functions

RDBMS-Day3. SQL Basic DDL statements DML statements Aggregate functions RDBMS-Day3 SQL Basic DDL statements DML statements Aggregate functions SQL SQL is used to make a request to retrieve data from a Database. The DBMS processes the SQL request, retrieves the requested data

More information

SQL in Programming Languages Read chapter 5 of Atzeni et al. BD: Modelli e Linguaggi di Interrogazione and section 8.

SQL in Programming Languages Read chapter 5 of Atzeni et al. BD: Modelli e Linguaggi di Interrogazione and section 8. SQL in Programming Languages Read chapter 5 of Atzeni et al. BD: Modelli e Linguaggi di Interrogazione and section 8.4 of Garcia-Molina Slides derived from those by Jeffrey D. Ullman SQL and Programming

More information

An Introduction to Structured Query Language

An Introduction to Structured Query Language An Introduction to Structured Query Language Grant Weddell Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Spring 2016 CS 348 (Intro to DB Mgmt) SQL

More information

Lecture Notes Database Management Patrick E. O'Neil and Elizabeth O'Neil

Lecture Notes Database Management Patrick E. O'Neil and Elizabeth O'Neil Lecture Notes Database Management Patrick E. O'Neil and Elizabeth O'Neil Chapter 5: Embedded SQL Programs. Embedded SQL means SQL statements embedded in host language (C in our case). The original idea

More information

Chapter 3: Introduction to SQL

Chapter 3: Introduction to SQL Chapter 3: Introduction to SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 3: Introduction to SQL Overview of the SQL Query Language Data Definition Basic Query

More information

GridDB Advanced Edition SQL reference

GridDB Advanced Edition SQL reference GMA022C1 GridDB Advanced Edition SQL reference Toshiba Solutions Corporation 2016 All Rights Reserved. Introduction This manual describes how to write a SQL command in the GridDB Advanced Edition. Please

More information

Database Applications. SQL/PSM Embedded SQL JDBC

Database Applications. SQL/PSM Embedded SQL JDBC Database Applications SQL/PSM Embedded SQL JDBC 1 Course Objectives Design Construction Applications Usage 2 Course Objectives Interfacing When the course is through, you should Know how to connect to

More information

Daffodil DB. Design Document (Beta) Version 4.0

Daffodil DB. Design Document (Beta) Version 4.0 Daffodil DB Design Document (Beta) Version 4.0 January 2005 Copyright Daffodil Software Limited Sco 42,3 rd Floor Old Judicial Complex, Civil lines Gurgaon - 122001 Haryana, India. www.daffodildb.com All

More information

Enterprise PeopleTools 8.50 PeopleBook: Supported Integration Technologies

Enterprise PeopleTools 8.50 PeopleBook: Supported Integration Technologies Enterprise PeopleTools 8.50 PeopleBook: Supported Integration Technologies September 2009 Enterprise PeopleTools 8.50 PeopleBook: Supported Integration Technologies SKU pt850pbr0 Copyright 1988, 2009,

More information

Table of Contents. PDF created with FinePrint pdffactory Pro trial version

Table of Contents. PDF created with FinePrint pdffactory Pro trial version Table of Contents Course Description The SQL Course covers relational database principles and Oracle concepts, writing basic SQL statements, restricting and sorting data, and using single-row functions.

More information

Chapter # 7 Introduction to Structured Query Language (SQL) Part I

Chapter # 7 Introduction to Structured Query Language (SQL) Part I Chapter # 7 Introduction to Structured Query Language (SQL) Part I Introduction to SQL SQL functions fit into two broad categories: Data definition language Data manipulation language Basic command set

More information

CMPT 354 Database Systems I

CMPT 354 Database Systems I CMPT 354 Database Systems I Chapter 8 Database Application Programming Introduction Executing SQL queries: Interactive SQL interface uncommon. Application written in a host language with SQL abstraction

More information

SQL. SQL DDL Statements

SQL. SQL DDL Statements SQL Structured Query Language Declarative Specify the properties that should hold in the result, not how to obtain the result Complex queries have procedural elements International Standard SQL1 (1986)

More information

COSC 304 Introduction to Database Systems SQL DDL. Dr. Ramon Lawrence University of British Columbia Okanagan

COSC 304 Introduction to Database Systems SQL DDL. Dr. Ramon Lawrence University of British Columbia Okanagan COSC 304 Introduction to Database Systems SQL DDL Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca SQL Overview Structured Query Language or SQL is the standard query language

More information

UNIT-IV (Relational Database Language, PL/SQL)

UNIT-IV (Relational Database Language, PL/SQL) UNIT-IV (Relational Database Language, PL/SQL) Section-A (2 Marks) Important questions 1. Define (i) Primary Key (ii) Foreign Key (iii) unique key. (i)primary key:a primary key can consist of one or more

More information

unisys ClearPath Enterprise Servers ODBC Access Stored Procedures User s Guide ClearPath MCP 12.0 April

unisys ClearPath Enterprise Servers ODBC Access Stored Procedures User s Guide ClearPath MCP 12.0 April unisys ClearPath Enterprise Servers ODBC Access Stored Procedures User s Guide ClearPath MCP 12.0 April 2008 6885 2664 003 NO WARRANTIES OF ANY NATURE ARE EXTENDED BY THIS DOCUMENT. Any product or related

More information

Chapter 3: Introduction to SQL

Chapter 3: Introduction to SQL Chapter 3: Introduction to SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 3: Introduction to SQL Overview of the SQL Query Language Data Definition Basic Query

More information

Chapter 1 SQL and Data

Chapter 1 SQL and Data Chapter 1 SQL and Data What is SQL? Structured Query Language An industry-standard language used to access & manipulate data stored in a relational database E. F. Codd, 1970 s IBM 2 What is Oracle? A relational

More information

SQL - Basics. SQL Overview

SQL - Basics. SQL Overview SQL - Basics Davood Rafiei 1 SQL Overview Structured Query Language standard query language for relational system. developed in IBM Almaden (system R) Some features Declarative: specify the properties

More information

PL/SQL Block structure

PL/SQL Block structure PL/SQL Introduction Disadvantage of SQL: 1. SQL does t have any procedural capabilities. SQL does t provide the programming technique of conditional checking, looping and branching that is vital for data

More information

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement Chapter 4 Basic SQL Basic SQL SQL language Considered one of the major reasons for the commercial success of relational databases SQL Structured Query Language Statements for data definitions, queries,

More information

ORACLE TRAINING. ORACLE Training Course syllabus ORACLE SQL ORACLE PLSQL. Oracle SQL Training Syllabus

ORACLE TRAINING. ORACLE Training Course syllabus ORACLE SQL ORACLE PLSQL. Oracle SQL Training Syllabus ORACLE TRAINING ORACLE Training Course syllabus ORACLE SQL ORACLE PLSQL Oracle SQL Training Syllabus Introduction to Oracle Database List the features of Oracle Database 11g Discuss the basic design, theoretical,

More information

The SQL data-definition language (DDL) allows defining :

The SQL data-definition language (DDL) allows defining : Introduction to SQL Introduction to SQL Overview of the SQL Query Language Data Definition Basic Query Structure Additional Basic Operations Set Operations Null Values Aggregate Functions Nested Subqueries

More information

Oracle Database 12c: Program with PL/SQL Duration: 5 Days Method: Instructor-Led

Oracle Database 12c: Program with PL/SQL Duration: 5 Days Method: Instructor-Led Oracle Database 12c: Program with PL/SQL Duration: 5 Days Method: Instructor-Led Course Description This training starts with an introduction to PL/SQL and then explores the benefits of this powerful programming

More information

1Z0-144 Q&As Oracle Database 11g: Program with PL/ SQL

1Z0-144 Q&As Oracle Database 11g: Program with PL/ SQL CertBus.com 1Z0-144 Q&As Oracle Database 11g: Program with PL/ SQL Pass Oracle 1Z0-144 Exam with 100% Guarantee Free Download Real Questions & Answers PDF and VCE file from: 100% Passing Guarantee 100%

More information

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints SQL KEREM GURBEY WHAT IS SQL Database query language, which can also: Define structure of data Modify data Specify security constraints DATA DEFINITION Data-definition language (DDL) provides commands

More information

Topics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia

Topics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia Topics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia 1. Creating a Database Alias 2. Introduction to SQL Relational Database Concept Definition of Relational Database

More information

Full file at

Full file at ch2 True/False Indicate whether the statement is true or false. 1. The SQL command to create a database table is an example of DML. 2. A user schema contains all database objects created by a user. 3.

More information

Database DB2 UDB SQL call level interface (ODBC)

Database DB2 UDB SQL call level interface (ODBC) System i Database DB2 UDB SQL call leel interface (ODBC) Version 5 Release 4 System i Database DB2 UDB SQL call leel interface (ODBC) Version 5 Release 4 Note Before using this information and the product

More information

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul 1 EGCI 321: Database Systems Dr. Tanasanee Phienthrakul 2 Chapter 10 Data Definition Language (DDL) 3 Basic SQL SQL language Considered one of the major reasons for the commercial success of relational

More information

SQL Interview Questions

SQL Interview Questions SQL Interview Questions SQL stands for Structured Query Language. It is used as a programming language for querying Relational Database Management Systems. In this tutorial, we shall go through the basic

More information

Lecture 2. Introduction to JDBC

Lecture 2. Introduction to JDBC Lecture 2 Introduction to JDBC Introducing JDBC According to Sun, JDBC is not an acronym, but is commonly misinterpreted to mean Java DataBase Connectivity JDBC: is an API that provides universal data

More information

Contents I Introduction 1 Introduction to PL/SQL iii

Contents I Introduction 1 Introduction to PL/SQL iii Contents I Introduction Lesson Objectives I-2 Course Objectives I-3 Human Resources (HR) Schema for This Course I-4 Course Agenda I-5 Class Account Information I-6 Appendixes Used in This Course I-7 PL/SQL

More information

Question: Which statement would you use to invoke a stored procedure in isql*plus?

Question: Which statement would you use to invoke a stored procedure in isql*plus? What are the two types of subprograms? procedure and function Which statement would you use to invoke a stored procedure in isql*plus? EXECUTE Which SQL statement allows a privileged user to assign privileges

More information

SQL STORED ROUTINES. CS121: Relational Databases Fall 2017 Lecture 9

SQL STORED ROUTINES. CS121: Relational Databases Fall 2017 Lecture 9 SQL STORED ROUTINES CS121: Relational Databases Fall 2017 Lecture 9 SQL Functions 2 SQL queries can use sophisticated math operations and functions Can compute simple functions, aggregates Can compute

More information

Schedule. Feb. 12 (T) Advising Day. No class. Reminder: Midterm is Feb. 14 (TH) Today: Feb. 7 (TH) Feb. 21 (TH) Feb. 19 (T)

Schedule. Feb. 12 (T) Advising Day. No class. Reminder: Midterm is Feb. 14 (TH) Today: Feb. 7 (TH) Feb. 21 (TH) Feb. 19 (T) Schedule Today: Feb. 7 (TH) PL/SQL, Embedded SQL, CLI, JDBC. Read Sections 8.1, 8.3-8.5. Feb. 12 (T) Advising Day. No class. Reminder: Midterm is Feb. 14 (TH) Covers material through Feb. 7 (TH) lecture

More information

DATABASE DESIGN - 1DL400

DATABASE DESIGN - 1DL400 DATABASE DESIGN - 1DL400 Fall 2015 A course on modern database systems http://www.it.uu.se/research/group/udbl/kurser/dbii_ht15 Kjell Orsborn Uppsala Database Laboratory Department of Information Technology,

More information

1) Introduction to SQL

1) Introduction to SQL 1) Introduction to SQL a) Database language enables users to: i) Create the database and relation structure; ii) Perform insertion, modification and deletion of data from the relationship; and iii) Perform

More information

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210 SQL: Concepts Todd Bacastow IST 210: Organization of Data 2/17/2004 1 Design questions How many entities are there? What are the major entities? What are the attributes of each entity? Is there a unique

More information