1 / 15

Chapter Four

Chapter Four. Objectives Introduction to SQL Introduction to iSQL*PLUS Types of SQL statements Concepts of DDL & DML Data Manipulation Language (DML). SQL. Structured Query Language Developed by IBM Used in most Commercial DBMS Statements are not case sensitive.

rusty
Download Presentation

Chapter Four

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter Four Objectives Introduction to SQL Introduction to iSQL*PLUS Types of SQL statements Concepts of DDL & DML Data Manipulation Language (DML)

  2. SQL • Structured Query Language • Developed by IBM • Used in most Commercial DBMS • Statements are not case sensitive. • Statements can be on one or more lines. • Reserved words cannot be abbreviated or split over lines. • Terminated with a semi colon. • Statements are entered at SQL prompt. The subsequent lines are numbered (SQL buffer) • Only one statement can be current at any time in the buffer.

  3. Types of SQL Statements • Data Definition Language (DDL) • Data Manipulation Language (DML)

  4. Example:

  5. Data Definition Language Name:User Identifiers: 1-30 characters Start with an alphabet Followed by alphabet, digit, _ Unique Not reserved Not case sensitive

  6. Data Types Oracle Data Types: • CHAR(size) • VARCHAR2(max_size) • NUMBER(n,d) • DATE

  7. Data Types: 1-Character: CHAR(Size) VARCHAR2(MaxSize) ‘4321’ ‘19 Main St. Frostburg’ ‘ * ’ ‘Student’’s ID’

  8. Data Types: 2-Number:NUMBERNUMBER(T,D) 1,234,567.89 NUMBER 1,234,567.89 1,234,567.89 NUMBER(9) 1,234,567 1,234,567.89 NUMBER(9,1) 1,234,567.8 1,234,567.89 NUMBER(7,-2) 1,234,500 1,234,567.89 NUMBER(6) ??

  9. Data Types: • 3-Date:DATE MyBirthdate = ‘11-JAN-37’ • Default time 00:00:00 A.M. • Use TO_DATE()

  10. Display a Structure of a Table: DESCRIBE Student; Name Null? Type ---------------------------------------------------------- NAME VARCHAR2(80) ID NUMBER(9) • GPA NUMBER(3,2) • B_Date DATE • Major CHAR(4)

  11. iSQL*PLUS • iSQL*Plus consists of the following three layers: 1-Client layer (Web browser) 2-Middle layer (Oracle HTTP Server and iSQL*Plus Server) 3-Database layer (Oracle database and Oracle Net)

  12. iSQL*PLUSInterface Configuration • History Size: Set the number of scripts displayed in the script history. • Input Area Size: Set the size of the script input area. -Width -Height

  13. iSQL*PLUSInterface Configuration • Output Location: Set where script output is displayed. -Below Input Area-Save to HTML File • Set whether output is displayed on a single page, or over multiple pages. -Single page -Multiple pages • Number of rows on each page

  14. iSQL*PLUSInterface Configuration • Show Line Numbers -On-Off • Indent Attribute or Column Names -On-Off • Whether commands in scripts are displayed in output as the script is executed. -On-Off

  15. Changing the name of a table: RENAME student TO GradStudent;

More Related