Oracle Database 10g Express



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

DbSchema Tutorial with Introduction in SQL Databases

Using SQL Server Management Studio

Oracle Database 10g: Introduction to SQL

Create a Database Driven Application

A Brief Introduction to MySQL

How To Use Databook On A Microsoft Powerbook (Robert Birt) On A Pc Or Macbook 2 (For Macbook)

Database Migration : An In Depth look!!

UQC103S1 UFCE Systems Development. uqc103s/ufce PHP-mySQL 1

How To Load Data Into An Org Database Cloud Service - Multitenant Edition

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

How To Create A Table In Sql (Ahem)

Toad for Data Analysts, Tips n Tricks

End the Microsoft Access Chaos - Your simplified path to Oracle Application Express

Database 10g Edition: All possible 10g features, either bundled or available at additional cost.

MySQL for Beginners Ed 3

Creating Database Tables in Microsoft SQL Server

Developing SQL and PL/SQL with JDeveloper

Avatier Identity Management Suite

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries

INTRODUCING ORACLE APPLICATION EXPRESS. Keywords: database, Oracle, web application, forms, reports

Oracle Data Integrator: Administration and Development

CSCI110 Exercise 4: Database - MySQL

Database Forms and Reports Tutorial

Setting Up ALERE with Client/Server Data

Netezza Workbench Documentation

Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC

Introducing Oracle s SQL Developer

Developing Web Applications for Microsoft SQL Server Databases - What you need to know

Welcome to Collage (Draft v0.1)

Working with Oracle Database XE. Create New User Account Using SQL Run Script Files PL/SQL Objects PL/SQL Server Pages

SQL. Short introduction

The Relational Model. Why Study the Relational Model?

Constant Contact Export

Mul$media im Netz (Online Mul$media) Wintersemester 2014/15. Übung 03 (Nebenfach)

LAB 1: Getting started with WebMatrix. Introduction. Creating a new database. M1G505190: Introduction to Database Development

Resources You can find more resources for Sync & Save at our support site:

The Welcome screen displays each time you log on to PaymentNet; it serves as your starting point or home screen.

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

The SkySQL Administration Console

news from Tom Bacon about Monday's lecture

Informatica Corporation Proactive Monitoring for PowerCenter Operations Version 3.0 Release Notes May 2014

SNAMP Data Server Tutorial

Rational Software. Getting Started with Rational Customer Service Online Case Management. Release 1.0

Programming with SQL

DbSchema Tutorial with Introduction in MongoDB

Oracle Database Express Edition

User Manual - Sales Lead Tracking Software

Database Administration with MySQL

Teach Yourself InterBase

Connecting to your Database!... 3

In This Lecture. Security and Integrity. Database Security. DBMS Security Support. Privileges in SQL. Permissions and Privilege.

SQL Server An Overview

Information Systems SQL. Nikolaj Popov

MICROSOFT ACCESS 2003 TUTORIAL

Oracle Database Express Edition

Geodatabase Programming with SQL

Migrate Topaz databases from One Server to Another

System requirements 2. Overview 3. My profile 5. System settings 6. Student access 10. Setting up 11. Creating classes 11

How to Set Up pgagent for Postgres Plus. A Postgres Evaluation Quick Tutorial From EnterpriseDB

How to Create Dashboards. Published

A table is a collection of related data entries and it consists of columns and rows.

Student User Guide. Introduction to the Module Management System (MMS) in Philosophy. Logging in; Submitting work; Logging out

Top 10 Oracle SQL Developer Tips and Tricks

Setting up SQL Translation Framework OBE for Database 12cR1

Tutorial: How to Use SQL Server Management Studio from Home

Oracle Database 12c: Introduction to SQL Ed 1.1

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

Oracle. Brief Course Content This course can be done in modular form as per the detail below. ORA-1 Oracle Database 10g: SQL 4 Weeks 4000/-

User Guide. Trade Finance Global. Reports Centre. October nordea.com/cm OR tradefinance Name of document 8/8 2015/V1

ECAT SWE Exchange Customer Administration Tool Web Interface User Guide Version 6.7

AUTHENTICATION... 2 Step 1:Set up your LDAP server... 2 Step 2: Set up your username... 4 WRITEBACK REPORT... 8 Step 1: Table structures...

mylittleadmin for MS SQL Server Quick Start Guide

Qualtrics Survey Software. Create an Account

Oracle Data Miner (Extension of SQL Developer 4.0)

Introduction to Microsoft Access 2003

Setting up the Oracle Warehouse Builder Project. Topics. Overview. Purpose

Welcome to PowerClaim Net Services!

IBM DB2 XML support. How to Configure the IBM DB2 Support in oxygen

Quick Start SAP Sybase IQ 16.0

Application note: Connecting the to a Database

Search help. More on Office.com: images templates

How Do I Upload Multiple Trucks?

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

Supplement IV.D: Tutorial for MS Access. For Introduction to Java Programming By Y. Daniel Liang

Supplement IV.C: Tutorial for Oracle. For Introduction to Java Programming By Y. Daniel Liang

1 Changes in this release

VERSION 8.0 RELEASE NOTES

Oracle Database 11g SQL

IBM Campaign Version-independent Integration with IBM Engage Version 1 Release 3 April 8, Integration Guide IBM

Lab 2: PostgreSQL Tutorial II: Command Line

Sophos Enterprise Console Auditing user guide. Product version: 5.2

Firebird. A really free database used in free and commercial projects

At the end of this lesson, you will be able to create a Request Set to run all of your monthly statements and detail reports at one time.

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

Oracle 10g PL/SQL Training

Transcription:

Oracle Database 10g Express This tutorial prepares the Oracle Database 10g Express Edition Developer to perform common development and administrative tasks of Oracle Database 10g Express Edition. Objectives After taking this tutorial, you should be able to: Install Oracle Database 10g Express Edition Access the Oracle Database Home Page Manage Database Objects Access and Manipulate Data What is Oracle Database 10g Express Edition? Oracle Database 10g Express Edition (Oracle Database XE) is a free, downloadable version of the world's most capable relational database. Oracle Database XE is easy to install and easy to manage. With Oracle Database XE, you use the Database Home Page, an intuitive browser-based interface, to administer the database; create tables, views, and other schema objects; import, export, and view table data; run queries and SQL scripts; and generate reports. Oracle Database XE includes Oracle HTML DB 2.1, a declarative, graphical development environment for creating database-centric Web applications. In addition to HTML DB 2.1, you can use popular Oracle and third-party languages and tools to develop your Oracle Database XE applications. Installation Installation of Oracle Database 10g Express Edition is extremely easy and can be done in less than 15 minutes. Oracle Database 10g Express Edition can be installed on both Linux and Windows platforms What to Do First In this module, you learn how to log in to the Oracle Database 10g Express Edition browser-based user interface, create administration and database users. Users access Oracle Database 10g Express Edition through database user accounts. Some of these accounts are automatically created administrative accounts accounts with database administration privileges. You log in with these accounts to create and manage other user accounts and to maintain database security. Creating a New Administration Account The installation process creates an account named SYSTEM. This account is considered an administrator account because it has DBA access.

Using an Oracle best practice, try to create its own administrator account and password so that you can create database user accounts when needed!!! 1. Log in as SYSTEM 2. Select Administration>Database Users>Create User 3. Input user information, check the DBA role for user and click Create Create your own administrator account! Creating a New Database User Account You can now log in with your administration account and create the necessary developer user accounts. Another user needs access to develop his portion of the application later, so you will create a new account for him!!! The same steps but don t check the DBA role for user. Create a user account! Loading Data You have an sql file manager that contains all the necessary commands and insert statements to load into the Oracle Database 10g Express Edition database. The script that will be loaded is called http://software.ucv.ro/~aion/pbd.html. This data contains information about each employee and about that employee's department. 1. Log in with your account 2. Select SQL>SQL Scripts> Upload 3. Select the file you want to upload and click Upload 4. Select the file icon and click Run twice to execute the script 5. Review the results of the execution 6. Browse the database objects and data Working with Database Objects Oracle Database XE provides an organized mechanism for storing, managing, and retrieving information. Tables are the basic storage structure for holding business data. In this module, you learn how to create tables and work with them. You may want to modify data entered in tables. You may also want to maintain integrity with the data. Sometimes, you may want to remove tables that are no longer useful. Creating tables You create tables with the SQL CREATE TABLE statement. With Oracle Database XE, you have two options for creating tables.

Use the graphical interface that generates the SQL statement Enter the CREATE TABLE statement in the SQL Workshop tool When creating tables, you must provide: Table name Column name(s) Data types for each column Guidelines for creating tables: Table and column naming rules Must start with a letter, which is followed by a sequence of letters, numbers, _, #, or $ Must be 1 to 30 characters long Must not be an Oracle server reserved password Most common data types VARCHAR2 NUMBER DATE TIMESTAMP CHAR You can also set up constraints on your columns to control the data in them. 1. Creating Tables by Using the Object Browser Create the DEPENDENTS table, which will contain the following columns: Id, FirstName, LastName, BirthDate, Relation, Gender, Benefits, and RelativeId. In the DEPENDENTS table, no two rows have the same ID. The Gender column holds only one value of M or F. Also, the Benefits column stores large blocks of character data. 1. Log in to Oracle Database XE 2. Click the Object Browser 3. Go to Create. Click the Table link 4. Enter the table name and column definitions. Click Next 5. Specify the primary key information. Click Next 6. Specify the foreign key information. Click Add 7. Proceed to check constraint information. Click Finish

8. On the conformation page click Create 2. Creating Tables Using SQL Sheila needs to create the AUDIT_RECORD_TB1 table. This table will contain two columns. The user_value column is of the data type varchar2, and the date_recorded column is of the data type timestamp. Later, Sheila will use this table to record audit information when the salary column in the EMPLOYEES table changes. 1. Navigate to Oracle Database>Home Page 2. Click the SQL command 3. Go to SQL Commands 4. Click Enter Command 5. Type the SQL command 6. Click Run 3. Creating a Copy of a Table To copy the EMPLOYEES table so that she can practice without affecting the real data. Create a copy of the table by using the Object Browser. 4. Modifying Tables You can modify tables using the SQL ALTER TABLE statement. You may need to change the table structure due to any of the following reasons: You omitted a column. Your column definition needs to be changed. You need to remove columns. The ALTER TABLE statement is used to: Add a new column Modify an existing column Define a default value for the new column Drop a column Manage constraints In Oracle Database XE, you can modify tables: Using the Object Browser Using the SQL Workshop tool 5. Adding a New Column Add a new column BirthDate of Date type to the EMPLOYEES table by using the Object Browse. 6. Managing Constraints What Are Constraints?

Data integrity ensures the consistency and correctness of data stored in a database. Such integrity can be enforced by incorporating business rules. Constraints are the rules that are enforced on data stored in a table. Why Should I Use Constraints? You can use constraints to do the following: Enforce rules on the data in a table whenever a row is updated, inserted, or deleted from that table Prevent the deletion of a table if there are dependencies from other tables Types of Constraints: PRIMARY KEY The PRIMARY KEY constraint is a column or a set of columns that uniquely identifies each row in a table. This constraint enforces uniqueness of the column or column combination. It ensures that no column that is part of the primary key can contain a null value. A null value is a value that does not exist. For example, in the DEPENDENTS table, the column ID is the primary key.this column will not allow either a duplicate value or a null value. FOREIGN KEY The FOREIGN KEY constraint designates a column or a combination of columns as a foreign key. It establishes a relationship between a primary key or a unique key in the same table or different table. A foreign key enforces that the value within the column matches the value in the relationship column. For example, the RelativeId column in the DEPENDENTS table refers to the EMPLOYEES table. You cannot delete a record in the EMPLOYEES table whose RelativeId is used in the DEPENDENTS table. Also, with a non-existing RelativeId in the EMPLOYEES table, you cannot insert a record into the DEPENDENTS table. CHECK

The CHECK constraint enforces integrity by restricting the values to be inserted in a column. It defines a condition that each row must satisfy. You can define multiple check constraints on a single column. Also, you can apply a single check constraint to multiple columns. For example, when you impose the CHECK constraint on the Gender column in the DEPENDENTS table, you can specify that the only valid values are either M or F. UNIQUE The UNIQUE constraint requires that no two rows of a table can have duplicate values in a specified column or a set of columns. A table can have more than one unique key. If the UNIQUE constraint comprises more than one column, then the group of columns is called a coomposite key. For example, you can impose the UNIQUE constraint on the Email column of the EMPLOYEES table. You ensure that each employee has a unique email ID NOT NULL Constraints can be enforced at two levels: Column level Table level A constraint can be created with either of the following statements: CREATE TABLE ALTER TABLE With the ALTER TABLE statement, you can disable or enable the imposed constraint without dropping it or re-creating it: Disable a constraint by using the DISABLE clause. Enable a constraint by using the ENABLE clause. 1. Manage the constraints on the DEPENDENTS table by using the Object Browser: 1. Navigate to Oracle Database XE>Home Page 2. Click the Object Browser arrow 3. Go to Browse

4. Click the Table link 5. Click the table name 6. Click Constraints 7. Click Create 8. Specify the constraint information 9. Click Next 10. Click Finish Create two constaints on table Dependents: 1. Dependents_CON: the Gender column to take the values ( M, F ) and 2. Dependents_FK: the relativeid is the foreign key( reference Employees(Employee_ID)) 2.Disable the foreign key constraint on the DEPENDENTS table by using the appropriate SQL statement. 1.Click the SQL arrow 2.Go to SQL Commands 3. Click Enter Command: SQL Alter table dependents disable constraint dependents_fk 4.Type the SQL command 5.Click Run Accessing Data In this module, you learn how to retrieve data from tables. The SQL SELECT statement is used to access and report data back from the XE tables. This is known as "querying" the data. In XE, you can either write SELECT statements using the SQL Workshop tool, or you can use the Query Builder tool to build queries with a GUI interface. 1. Building Queries Use the SQL Workshop tool to type her SELECT statements Use the Query Builder tool to build the query graphically Bibliografie: www.oracle.com