SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.

Slides:



Advertisements
Similar presentations
CIT 613: Relational Database Development using SQL Revision of Tables and Data Types.
Advertisements

SQL Query Slides Sharif University Of Technology Database Systems CE 384 Prepared By: Babak Bagheri Hariri
Chapter 11 Group Functions
Copyright © by Royal Institute of Information Technology Introduction To Structured Query Language (SQL) 1.
Representing Data Elements Gayatri Gopalakrishnan.
1 A GUIDE TO ORACLE8 CHAPTER 2: Creating and ModifyingDatabaseTables 2.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 11.
Database Modifications A modification command does not return a result as a query does, but it changes the database in some way. There are three kinds.
--The SQL Query Language DML--1 LIKE  LIKE allows to select character strings which have some element in common by using wild cards:  Wild cards:  “%”
Creating Database Tables © Abdou Illia MIS Spring /21/2015.
SQL SQL stands for Structured Query Language SQL allows you to access a database SQL is an ANSI standard computer language SQL can execute queries against.
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,
Enhancements to the GROUP BY Clause Fresher Learning Program January, 2012.
Rationale Aspiring Database Developers should be able to efficiently query and maintain databases. This module will help students learn the Structured.
Basis Data Terapan Yoannita. SQL Server Data Types Character strings: Data typeDescriptionStorage char(n)Fixed-length character string. Maximum 8,000.
Chapter 3 Single-Table Queries
Oracle Database Architecture An Oracle server: –Is a database management system that provides an open, comprehensive, integrated approach to information.
Database Design lecture 3_1 1 Database Design Lecture 3_1 Data definition in SQL.
Said Salomon Unitrin Direct Insurance T-SQL Date and Time Functions Said Salomon.
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.
Daybase (DayCart) Introduction What is ‘Daybase’ ? Oracle Schema Objects. Oracle Datatypes. Simple Example. Demo.
Sizing Basics  Why Size?  When to size  Sizing issues:  Bits and Bytes  Blocks (aka pages) of Data  Different Data types  Row Size  Table Sizing.
1 SQL Tarek El-Shishtawy Professor Ass. Of Computer Engineering.
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
CN2180 MS SQL Server Kemtis Kunanuraksapong MSIS with Distinction, A+ MCTS, MCDST, MCP.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 14 Globalization Support in the Database.
Chapter 8: SQL. Data Definition Modification of the Database Basic Query Structure Aggregate Functions.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
Advanced SELECT Queries CS 146. Review: Retrieving Data From a Single Table Syntax: Limitation: Retrieves "raw" data Note the default formats… SELECT.
SQL Server 2005 Implementation and Maintenance Chapter 3: Tables and Views.
# 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.
Week 7 Lecture 2 Globalization Support in the Database.
SQL – Structured Query Language
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.
1 Querying a Single Table Structured Query Language (SQL) - Part II.
Lecture5: SQL Overview, Oracle Data Type, DDL and Constraints Ref. Chapter6 Lecture4 1.
8 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects.
SQL CREATING AND MANAGING TABLES lecture4 1. Database Objects ObjectDescription TableBasic unit of storage; composed of rows and columns ViewLogically.
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
Academic Year 2015 Autumn. MODULE CC2006NI: Data Modelling and Database Systems Academic Year 2015 Autumn.
Oracle & SQL. Oracle Data Types Character Data Types: Char(2) Varchar (20) Clob: large character string as long as 4GB Bolb and bfile: large amount of.
SQL server Section 2&3. What are Data Types Character Data Types Number Data Types Date and Time Data Types CAST and CONVERT functions TRY_PARSE and TRY_CONVERT.
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.
Lab 3: Single-row Functions College of Information Technology, Universiti Tenaga Nasional 1 CISB224 02A, 02B Semester I, 2009/2010.
SQL: Structured Query Language It enables to create and operate on relational databases, which are sets of related information stored in tables. It is.
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
Creating and Managing Tables. Database Objects ObjectDescription TableBasic unit of storage; composed of rows and columns ViewLogically represents subsets.
7 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects.
Relational Databases and SQL The relational model and the most common SQL commands.
PLSQL Cont…. Most Common Oracle Data Types VARCHAR2 –Stores variable-length character data. –Takes a required parameter that specifies a maximum length.
Creating Database Objects
Introduction To Oracle
CS 3630 Database Design and Implementation
Working with Data Types
Chapter # 7 Introduction to Structured Query Language (SQL) Part II.
ORACLE I 2 Salim Phone : YM : talim_bansal.
Chapter 4 Summary Query.
1.6) Storing Integer:.
Query Functions.
Lab 3: Single-row Functions
Database Management System
Creating Database Objects
Introduction to Oracle
1.6) Storing Integer: 1.7) storing fraction:
SQL (Structured Query Language)
Presentation transcript:

SQL ORACLE 1

Data Type 2

3

VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size is 4000 bytes or characters, and minimum is 1 byte or 1 character. You must specify size for VARCHAR2.BYTE indicates that the column will have byte length semantics. CHAR indicates that the column will have character semantics CHAR [(size [BYTE | CHAR])] Fixed-length character data of length size bytes or characters. Maximum size is 2000 bytes or characters. Default and minimum size is 1 byte. 4

NUMBER [ (p [, s]) ] Number having precision p and scale s. The precision p can range from 1 to 38. The scale s can range from -84 to 127. Both precision and scale are in decimal digits. A NUMBER value requires from 1 to 22 bytes. 5

LONG Character data of variable length up to 2 gigabytes, or bytes. Provided for backward compatibility. RAW(size) Raw binary data of length size bytes. Maximum size is 2000 bytes. You must specify size for a RAW value. 6

DATE Valid date range from January 1, 4712 BC, to December 31, 9999 AD. The default format is determined explicitly by the NLS_DATE_FORMAT parameter or implicitly by the NLS_TERRITORY parameter. The size is fixed at 7 bytes. This data type contains the date time fields YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND. It does not have fractional seconds or a time zone. 7

8

9

Key structure SELECT select_list [ INTO new_table ] FROM table_source [ WHERE search_condition ] [ GROUP BY group_by_expression ] [ HAVING search_condition ] [ ORDER BY order_expression [ ASC | DESC ] ] 10

Grammar SELECT statement ::= [ ORDER BY { order_by_expression | column_position [ ASC | DESC ] } [,...n ] ] [ COMPUTE { { AVG | COUNT | MAX | MIN | SUM } ( expression ) } [,...n ] [ BY expression [,...n ] ] ] [ FOR { BROWSE | XML { RAW | AUTO | EXPLICIT } [, XMLDATA ] [, ELEMENTS ] [, BINARY base64 ] } ] [ OPTION ( [,...n ]) ] 11

Grammar-cont. ::= { | ( ) } [ UNION [ ALL ] ) [...n ] ] ::= SELECT [ ALL | DISTINCT ] [ { TOP integer | TOP integer PERCENT } [ WITH TIES ] ] [ INTO new_table ] [ FROM { } [,...n ] ] [ WHERE ] [ GROUP BY [ ALL ] group_by_expression [,...n ] [ WITH { CUBE | ROLLUP } ] ] [HAVING ] 12