{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sql01 - 1 Writing Basic SQL Statements Objectives After...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
1 1 Writing Basic SQL Statements
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1-2 Objectives After completing this lesson, you should After completing this lesson, you should be able to do the following: be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement Differentiate between SQL statements and iSQL*Plus commands
Image of page 2
1-3 Capabilities of SQL SELECT Statements Selection Selection Projection Projection Table 1 Table 1 Table 2 Table 2 Table 1 Table 1 Table 1 Table 1 Join Join
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1-4 Basic SELECT Statement SELECT [DISTINCT] {*, column [ alias ],...} FROM table; SELECT identifies what columns FROM identifies which table
Image of page 4
1-5 Writing SQL Statements SQL statements are not case sensitive. SQL statements can be on one or more lines. Keywords cannot be abbreviated or split across lines. Clauses are usually placed on separate lines. Tabs and indents are used to enhance readability.
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1-6 Selecting All Columns DEPTNO DNAME LOC --------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON SQL> SELECT * 2 FROM dept;
Image of page 6
1-7 Selecting Specific Columns DEPTNO LOC --------- ------------- 10 NEW YORK 20 DALLAS 30 CHICAGO 40 BOSTON SQL> SELECT deptno, loc 2 FROM dept;
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1-8 Column Heading Defaults i SQL*Plus: Default heading justification : Center Default heading display: Uppercase SQL*Plus: Default justification Left: Date and character data Right: Numeric data Default display: Uppercase
Image of page 8
1-9 Arithmetic Expressions Create expressions on NUMBER and DATE Create expressions on NUMBER and DATE data by using arithmetic operators.
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}