Programming with SQL



Similar documents
Oracle SQL. Course Summary. Duration. Objectives

Oracle Database 12c: Introduction to SQL Ed 1.1

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL

DATABASE DESIGN & PROGRAMMING WITH SQL COURSE CODE: 5324

Oracle Database 11g SQL

Oracle Database: Introduction to SQL

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database 10g: Introduction to SQL

Instant SQL Programming

Netezza SQL Class Outline

Database Programming with PL/SQL: Learning Objectives

IT2305 Database Systems I (Compulsory)

IT2304: Database Systems 1 (DBS 1)

MOC 20461C: Querying Microsoft SQL Server. Course Overview

Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

ETL TESTING TRAINING

How To Create A Table In Sql (Ahem)

A basic create statement for a simple student table would look like the following.

Oracle 10g PL/SQL Training

Chapter 9 Joining Data from Multiple Tables. Oracle 10g: SQL

COMP 5138 Relational Database Management Systems. Week 5 : Basic SQL. Today s Agenda. Overview. Basic SQL Queries. Joins Queries

Introduction to Microsoft Jet SQL

Conversion Functions

Porting from Oracle to PostgreSQL

Database Administration with MySQL

Oracle Rdb A Comparison of SQL Dialects for Oracle and Oracle Rdb

ICAB4136B Use structured query language to create database structures and manipulate data

3.GETTING STARTED WITH ORACLE8i

PL/SQL Programming. Oracle Database 12c. Oracle Press ORACLG. Michael McLaughlin. Mc Graw Hill Education

2. Which three statements about functions are true? (Choose three.) Mark for Review (1) Points

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.


Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Course -Oracle 10g SQL (Exam Code IZ0-047) Session number Module Topics 1 Retrieving Data Using the SQL SELECT Statement

Discovering SQL. Wiley Publishing, Inc. A HANDS-ON GUIDE FOR BEGINNERS. Alex Kriegel WILEY

AV-004: Administering and Programming with ORACLE

SQL Server. 1. What is RDBMS?

SQL Server for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25)

Relational Database: Additional Operations on Relations; SQL

SQL SELECT Query: Intermediate

Oracle Database 10g Express

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

A Comparison of Database Query Languages: SQL, SPARQL, CQL, DMX

In This Lecture. SQL Data Definition SQL SQL. Notes. Non-Procedural Programming. Database Systems Lecture 5 Natasha Alechina

Effective Use of SQL in SAS Programming

T-SQL STANDARD ELEMENTS

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

CONVERSION FUNCTIONS QUESTIONS

Financial Data Access with SQL, Excel & VBA

2874CD1EssentialSQL.qxd 6/25/01 3:06 PM Page 1 Essential SQL Copyright 2001 SYBEX, Inc., Alameda, CA

Database Query 1: SQL Basics

Advance DBMS. Structured Query Language (SQL)

Information Systems SQL. Nikolaj Popov

RDBMS Using Oracle. Lecture Week 7 Introduction to Oracle 9i SQL Last Lecture. kamran.munir@gmail.com. Joining Tables

ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT

- Eliminating redundant data - Ensuring data dependencies makes sense. ie:- data is stored logically

Advanced Query for Query Developers

2. Oracle SQL*PLUS Winter Some SQL Commands. To connect to a CS server, do:

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Performing Queries Using PROC SQL (1)

Oracle Database 11g SQL and PL/SQL: A Brief Primer

Information and Computer Science Department ICS 324 Database Systems Lab#11 SQL-Basic Query

Displaying Data from Multiple Tables

SQL. Short introduction

Objectives. Oracle SQL and SQL*PLus. Database Objects. What is a Sequence?

5. CHANGING STRUCTURE AND DATA

4 Logical Design : RDM Schema Definition with SQL / DDL

Key Functions in Oracle SQL

Microsoft Access 3: Understanding and Creating Queries

Part A: Data Definition Language (DDL) Schema and Catalog CREAT TABLE. Referential Triggered Actions. CSC 742 Database Management Systems

More on SQL. Juliana Freire. Some slides adapted from J. Ullman, L. Delcambre, R. Ramakrishnan, G. Lindstrom and Silberschatz, Korth and Sudarshan

Fundamentals of Database Design

Choosing a Data Model for Your Database

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Structured Query Language (SQL)

Course 20461C: Querying Microsoft SQL Server Duration: 35 hours

5.1 Database Schema Schema Generation in SQL

MySQL Command Syntax

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING DR.NAVALAR NEDUNCHEZHIAYN COLLEGE OF ENGINEERING, THOLUDUR , CUDDALORE DIST.

Database Extensions Visual Walkthrough. PowerSchool Student Information System

Mini User's Guide for SQL*Plus T. J. Teorey

Introduction to SQL ( )

ATTACHMENT 6 SQL Server 2012 Programming Standards

David Dye. Extract, Transform, Load

Querying Microsoft SQL Server

Using SQL Server Management Studio

Database Migration from MySQL to RDM Server

Using Temporary Tables to Improve Performance for SQL Data Services


Oracle Database 10g: SQL Fundamentals I

Transcription:

Unit 43: Programming with SQL Learning Outcomes A candidate following a programme of learning leading to this unit will be able to: Create queries to retrieve information from relational databases using both ANSI standard and Oracle specific syntax Understand the application of Data Manipulation Language to insert, update and delete data held in a database Understand the application of Data Definition Language to create, modify and remove Tables, Views, Indexes, Synonyms and Sequences Understand the basics of user access control. NB Before starting this unit please refer to the Vendor website for up-to-date specifications, examination objectives and availability. OCR Level 3 Certificate/Diploma for IT Professionals 281

Unit content: Programming with SQL 1 Create queries to retrieve information a Describe the capabilities of SQL SELECT statements b Describe basic SELECT statements c Describe the limiting of rows retrieved by a query d Describe the sorting of rows retrieved by a query e Describe various categories of functions available in SQL f Describe the use of character, number, and date functions in SELECT statements g Describe the use of conversion functions Describe the use of SELECT statements for projection, selection and joining. Syntax of basic select statements Selecting a column and/or selecting all columns Mathematical and concatenation operators Use of parenthesis Literal character strings DISTINCT keyword WHERE clause Comparison operators Logical operators NULL condition Operator precedence ORDER BY clause To include the following functions: Single row and multiple row Character, number, date and conversion To include functions: Case manipulation functions (LOWER, UPPER, INITCAP) Character manipulation functions (CONCAT, SUBSTR, LENGTH, INSTR, LPAD/RPAD, TRIM, REPLACE) Number functions (ROUND, TRUNC, MOD) Date functions (MONTHS_BETWEEN, ADD_MONTHS, NEXT_DAY, LAST_DAY, ROUND, TRUNC, SYSDATE) Date arithmetic Default date format Implicit data type conversion Explicit data type conversion (TO_CHAR, TO_NUMBER, TO_DATE) Elements of the date format model Null conversions (NVL, NVL2, NULLIF) COALLESE 282 OCR Level 3 Certificate/Diploma for IT Professionals

h Use conditional expressions i j Use SELECT statements to access data from more than one table using equality and non-equality joins Describe how to view data that generally does not meet a join condition by using outer joins CASE DECODE Cartesian product Oracle specific syntax (equijoin, nonequijoin) ANSI standard syntax (CROSS JOIN, NATURAL JOIN, JOIN USING, JOIN ON) Oracle specific syntax (outer joins using (+)) ANSI standard syntax (LEFT/RIGHT/FULL OUTER JOIN) k Use a self join to join a table to itself l Use the available group functions AVG, COUNT, MAX, MIN, STDDEV, SUM, VARIANCE. m Describe how to group data GROUP BY clause. n Describe how to include or exclude grouped HAVING clause. rows o Define subqueries and the types of problem that they can solve p Identify the types of subqueries q Use single-row and multiple-row subqueries 2 Insert, update and delete data in a database a Describe how to add a new row into a table b Describe how to remove a row from a table Subquery syntax Effect of NULL values in a subquery Single row subqueries Multiple row subqueries Single row operators Multiple row operators (IN, ANY, ALL) INSERT statement Inserting NULL values Explicit default values Date values Copying data from another table Inserting into a subquery DELETE statement Deleting rows based on another table OCR Level 3 Certificate/Diploma for IT Professionals 283

c Describe how to change the data in a table UPDATE statement Using a subquery to update two columns Updating rows based upon another table Integrity constraint errors d Describe how to conditionally insert or update data in a table 3 Create, modify and remove database objects a Describe the main database objects b Describe the creation of tables c Describe the use of data types that can be used when specifying column definitions d Use statements to alter table definitions e Use statements to drop, rename, and truncate tables MERGE statement. Objects to include: Table View Sequence Index Synonym Table and column naming restrictions CREATE TABLE Referencing another users table DEFAULT values Creating a table using a subquery Standard data types (VARCHAR2, CHAR, NUMBER, DATE, LONG, CLOB, BLOB, BFILE, ROWID) Basic date time data types (TIMESTAMP and variations, INTERVAL YEAR TO MONTH, INTERVAL DAY To SECOND) ALTER TABLE statements (ADD, MODIFY, DROP COLUMN, SET UNUSED). DROP TABLE RENAME TRUNCATE TABLE f Use constraints NOT NULL UNIQUE PRIMARY KEY FOREIGN KEY CHECK g Describe the creation and maintenance of constraints Constraints to include: Table and column level definitions Naming conventions Disabling, enabling and cascading 284 OCR Level 3 Certificate/Diploma for IT Professionals

h Describe a view Simple and complex views i j k l Use statements to create, replace the definition of, and drop a view Describe the retrieval of data through a view Describe how to insert, update, and delete data through a view Use and create an inline view m Use of top-n analysis n Use statements to create and maintain use of sequences o Create and maintain indexes p Create private and public synonyms 4 User access control a Create users b Create roles to ease set up and maintain security of the model CREATE OR REPLACE DROP VIEW TO include: CREATE SEQUENCE ALTER SEQUENCE DROP SEQUENCE NEXTVAL and CURVAL pseudocolumns REATE INDEX DROP INDEX Automatic and manual creation of indexes Function based indexes CREATE SYNONYM DROP SYNONYM CREATE USER statement CREATE ROLE statement c Grant and revoke object privileges GRANT and REVOKE statements system and object privileges d Describe the creation of database links Assessment This unit will be assessed by an electronic examination set and externally marked by Oracle. Examinations take the form of multiple choice and multiple answer objective tests. The examination is administered on a computer at an authorised Oracle Academy. Notes for Tutors Knowledge for this examination may be gained through the official Oracle Academy: Introduction to Computer Science and Business course: Database Design and Programming. OCR Level 3 Certificate/Diploma for IT Professionals 285