Introduction to Oracle

Slides:



Advertisements
Similar presentations
A Guide to Oracle9i1 Creating and Modifying Database Tables Chapter 2.
Advertisements

Data Definition Language (DDL)
SQL’s Data Definition Language (DDL) n DDL statements define, modify and remove objects from data dictionary tables maintained by the DBMS n Whenever you.
Access Lesson 2 Creating a Database
1 A GUIDE TO ORACLE8 CHAPTER 2: Creating and ModifyingDatabaseTables 2.
1 Chapter 2: Creating and Modifying Database Tables.
Guide to Oracle 10g1 Chapter 2: Creating and Modifying Database Tables.
Creating a Blank Database 1. Open up Microsoft Access 2. Click on Blank document button 3. On the right panel, Specify the location for saving your database.
Creating Database Tables © Abdou Illia MIS Spring /21/2015.
Murali Mani SQL DDL and Oracle utilities. Murali Mani Datatypes in SQL INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME.
DT211 Stage 2 Databases Lab 1. Get to know SQL Server SQL server has 2 parts: –A client, running on your machine, in the lab. You access the database.
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
DATABASES AND SQL. Introduction Relation: Relation means table(data is arranged in rows and columns) Domain : A domain is a pool of values appearing in.
Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial Password: UWPstudent Password is case sensitive.
Introduction to SQL  SQL or sequel  It is a standardised language with thousands of pages in the standard  It can be in database system through GUI,
1 Chapter 2: Creating and Modifying Database Tables.
Oracle Data Definition Language (DDL)
Structured Query Language (SQL) A2 Teacher Up skilling LECTURE 2.
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Access Lesson 2 Creating a Database
SQL data definition using Oracle1 SQL Data Definition using Oracle.
CS 3630 Database Design and Implementation. Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial.
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
SQL data definition using Oracle1 SQL Data Definition using Oracle.
Oracle Data Definition Language (DDL) Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
1 Creating and Modifying Database Objects. 2 An Oracle database consists of multiple user accounts Each user account owns database objects Tables Views.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
CS146 References: ORACLE 9i PROGRAMMING A Primer Rajshekhar Sunderraman
Intro to SQL| MIS 2502  Spacing not relevant › BUT… no spaces in an attribute name or table name  Oracle commands keywords, table names, and attribute.
SCUHolliday - coen 1788–1 Schedule Today u Modifications, Schemas, Views. u Read Sections (except and 6.6.6) Next u Constraints. u Read.
A Guide to MySQL 3. 2 Introduction  Structured Query Language (SQL): Popular and widely used language for retrieving and manipulating database data Developed.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
Tables and Constraints Oracle PL/SQL. Datatypes The SQL Data Definition Language Commands (or DDL) enable us to create, modify and remove database data.
# 1# 1 Creating Tables, Setting Constraints, and Datatypes What is a constraint and why do we use it? What is a datatype? What does CHAR mean? CS 105.
SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.
Data types  CHAR (size): This data type is used to store character strings values of fixed length. The size in brackets determines the number of characters.
SQL CREATING AND MANAGING TABLES lecture4 1. Database Objects ObjectDescription TableBasic unit of storage; composed of rows and columns ViewLogically.
1 Chapter 2: Creating and Modifying Database Objects.
Sql DDL queries CS 260 Database Systems.
©Silberschatz, Korth and Sudarshan1 Structured Query Language (SQL) Data Definition Language Domains Integrity Constraints.
>> Introduction to MySQL. Introduction Structured Query Language (SQL) – Standard Database Language – Manage Data in a DBMS (Database Management System)
Academic Year 2015 Autumn. MODULE CC2006NI: Data Modelling and Database Systems Academic Year 2015 Autumn.
Basic SQL*Plus edit and execute commands SQL*Plus buffer and built-in editor holds the last SQL statement Statements are created in free-flow style and.
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
CDT/1 Creating data tables and Referential Integrity Objective –To learn about the data constraints supported by SQL2 –To be able to relate tables together.
Creating and Managing Tables. Database Objects ObjectDescription TableBasic unit of storage; composed of rows and columns ViewLogically represents subsets.
3 A Guide to MySQL.
CIT 214 Introduction to Database Management
Aga Private computer Institute Prepared by: Srwa Mohammad
Guide to Oracle 10g Chapter 2: Creating and Modifying Database Tables.
Introduction To Oracle
CS 3630 Database Design and Implementation
Managing Tables, Data Integrity, Constraints by Adrienne Watt
Data Definition and Data Types
SQL and SQL*Plus Interaction
Data Definition and Data Types
ORACLE SQL Developer & SQLPLUS Statements
DATABASE MANAGEMENT SYSTEM
Access Lesson 2 Creating a Database
SQL OVERVIEW DEFINING A SCHEMA
SQL data definition using Oracle
Defining a Database Schema
Oracle Data Definition Language (DDL)
Session - 6 Sequence - 1 SQL: The Structured Query Language:
Chapter 2: Creating And Modifying Database Tables
Session - 6 Sequence - 1 SQL: The Structured Query Language:
CMSC-461 Database Management Systems
SQL (Structured Query Language)
Presentation transcript:

Introduction to Oracle CSI 3317 (LAB 1) Introduction to Oracle

Introduction to Oracle…… In SITE Labs Programs  Database apps  Oracle – ORAHOME 92  Application Development  SQL*PLUS

Introduction to Oracle……

Introduction to Oracle……

Introduction to Oracle…… Client / Server Database

Data Types VARCHAR2 CHAR Variable length character data Max. 2000 characters Field size must be specified on declaration If entered data is smaller than specified size only entered data is stored. Trailing blank spaces are omitted. CHAR Fixed length character data. Max. 255 characters. If no size specification – size only one character. If size specified and the data entered is smaller – trailing spaces added.

Data Types Continue…. NUMBER Negative, Positive, fixed and floating point numbers. Range 10-130 to 10126 Precision up to 38 decimal points. Integer Number e.g sid NUMBER(5) Can store up to 99,999 Fixed-Point Number e.g price NUMBER(5,2) Can store up to 999.99 Floating-Point Number e.g gpa NUMBER Notice: No precision or scale Can store 2.7 as well as 3.725

Data Types Continued….. DATE -From January 1, 4712 BC to December 31, 4712 AD -Stores Century Year Month Day Hour Minute Second -Default (DD-MON-YY) Use Mask to change. e.g dob DATE

Data Types Continued….. Other Data Types LONG RAW and LONG RAW Up to 2GB Variable length character RAW and LONG RAW Binary data

RDBMS Remember your SQL operations *Oracle is a hybrid of Relational and object oriented databases For Our LAB we will only touch Relational Properties Remember your SQL operations -create (to create a new object or table for our lab purpose) -select (view) -update (change) -insert

Oracle SQL*PLUS CREATE TABLE <table name> To Create Table use CREATE TABLE <table name> ( <field name> <data type> CONSTRAINT, <field name> <data type> CONSTRAINT); To delete Table use DROPTABLE <table name>;

Oracle SQL*PLUS……. DROP TABLE location; CREATE TABLE LOCATION (locid NUMBER(5) CONSTRAINT location_locid_pk PRIMARY KEY, bldg_code VARCHAR2(10) CONSTRAINT location_bldg_code_nn NOT NULL, room VARCHAR2(6) CONSTRAINT location_room_nn NOT NULL, capacity NUMBER(5) CONSTRAINT location_capacity_nn NOT NULL); Notice that the every constraint has a name.

Oracle SQL*PLUS……. To view the table specifications DESCRIBE <table name>; To rename the table RENAME <oldtablename> <newtablename>; To add Additional Fields ALTER TABLE <table name> ADD <field name> <data declaration> <constraints>; To modify existing Fields MODIFY <field name> <new data declaration>;

Oracle SQL*PLUS……. Now lets populate the table INSERT INTO location VALUES (53, 'BUS', '424', 1); INSERT INTO location VALUES (54, 'BUS', '402', 1); INSERT INTO location VALUES (45, 'CR', '101', 150);

Oracle SQL*PLUS……. Remember… we can we view this data with SELECT Statement. SELECT * from LOCATION;

Oracle Navigator Start  Programs  Database apps  Oracle – ORAHOME 92  Application Development Oracle Navigator

Oracle Navigator …… Right-click on Database Connections  New Use the connection info similar to one used for SQL*PLUS introduction.

Oracle Navigator Click on Plus sign besides your Connection on left pane. Right-click on Table  New Now use the wizard to create the same table. (Remember to Drop table before creating it again)