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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 1 Writing Basic SQL Statements 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 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 1-4 Basic SELECT Statement SELECT [DISTINCT] {*, column [ alias ],. ..} FROM table; • SELECT identifies what columns • FROM identifies which table 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. 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; 1-7 Selecting Specific Columns DEPTNO LOC--------- -------------10 NEW YORK 20 DALLAS 30 CHICAGO 40 BOSTON SQL> SELECT deptno, loc 2 FROM dept; 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 1-9 Arithmetic Expressions Create expressions on NUMBER and DATE Create expressions on NUMBER and DATE data by using arithmetic operators....
View Full Document

This note was uploaded on 06/27/2011 for the course COMPUTER S 133 taught by Professor Andrewstrauss during the Spring '11 term at Bucks Community College.

Page1 / 30

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

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online