Enviar pesquisa
Carregar
Lesson01 学会使用基本的SQL语句
•
0 gostou
•
468 visualizações
R
renguzi
Seguir
Oracle OCP考试之007第1章,学会使用基本的SQL语句!
Leia menos
Leia mais
Tecnologia
Vista de apresentação de diapositivos
Denunciar
Compartilhar
Vista de apresentação de diapositivos
Denunciar
Compartilhar
1 de 46
Baixar agora
Baixar para ler offline
Recomendados
Les01
Les01
Akmal Rony
Sql oracle
Sql oracle
Md.Abu Noman Shuvo
Writing Basic SQL SELECT Statements
Writing Basic SQL SELECT Statements
Salman Memon
PL/SQL 3 DML
PL/SQL 3 DML
Richard Eliseo Mendoza Gafaro
Displaying Data from Multiple Tables - Oracle Data Base
Displaying Data from Multiple Tables - Oracle Data Base
Salman Memon
Aggregating Data Using Group Functions
Aggregating Data Using Group Functions
Salman Memon
PL/SQL CURSORES
PL/SQL CURSORES
Richard Eliseo Mendoza Gafaro
PL/SQL CONDICIONALES Y CICLOS
PL/SQL CONDICIONALES Y CICLOS
Richard Eliseo Mendoza Gafaro
Recomendados
Les01
Les01
Akmal Rony
Sql oracle
Sql oracle
Md.Abu Noman Shuvo
Writing Basic SQL SELECT Statements
Writing Basic SQL SELECT Statements
Salman Memon
PL/SQL 3 DML
PL/SQL 3 DML
Richard Eliseo Mendoza Gafaro
Displaying Data from Multiple Tables - Oracle Data Base
Displaying Data from Multiple Tables - Oracle Data Base
Salman Memon
Aggregating Data Using Group Functions
Aggregating Data Using Group Functions
Salman Memon
PL/SQL CURSORES
PL/SQL CURSORES
Richard Eliseo Mendoza Gafaro
PL/SQL CONDICIONALES Y CICLOS
PL/SQL CONDICIONALES Y CICLOS
Richard Eliseo Mendoza Gafaro
SQL SELECT Statement
SQL SELECT Statement
IslamicUniversityofL
Lesson04 学会使用分组函数
Lesson04 学会使用分组函数
renguzi
Les10
Les10
Abrianto Nugraha
Les09
Les09
Abrianto Nugraha
Les01
Les01
Abrianto Nugraha
Les02
Les02
Akmal Rony
Lesson06 使用子查询
Lesson06 使用子查询
renguzi
Les06
Les06
Akmal Rony
Lesson10
Lesson10
renguzi
Lesson05 从多表中查询数据
Lesson05 从多表中查询数据
renguzi
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)
Achmad Solichin
Understanding
Understanding
Arun Gupta
Android de la A a la Z XML Ulises Gonzalez
Android de la A a la Z XML Ulises Gonzalez
Android UNAM
Les04
Les04
Akmal Rony
Dare to build vertical design with relational data (Entity-Attribute-Value)
Dare to build vertical design with relational data (Entity-Attribute-Value)
Ivo Andreev
Analytical Functions for DWH
Analytical Functions for DWH
Emrah METE
EMF-IncQuery 0.7 Presentation for Itemis
EMF-IncQuery 0.7 Presentation for Itemis
Istvan Rath
Functional Programming With Lambdas and Streams in JDK8
Functional Programming With Lambdas and Streams in JDK8
IndicThreads
Php 5 3-study_guide_v1a
Php 5 3-study_guide_v1a
luckysher007
Subconsultas
Subconsultas
Maria
Les01 Writing BAsic SQL SELECT Statement.ppt
Les01 Writing BAsic SQL SELECT Statement.ppt
DrZeeshanBhatti
Database Management Systems SQL And DDL language
Database Management Systems SQL And DDL language
HSibghatUllah
Mais conteúdo relacionado
Mais procurados
SQL SELECT Statement
SQL SELECT Statement
IslamicUniversityofL
Lesson04 学会使用分组函数
Lesson04 学会使用分组函数
renguzi
Les10
Les10
Abrianto Nugraha
Les09
Les09
Abrianto Nugraha
Les01
Les01
Abrianto Nugraha
Les02
Les02
Akmal Rony
Lesson06 使用子查询
Lesson06 使用子查询
renguzi
Les06
Les06
Akmal Rony
Lesson10
Lesson10
renguzi
Lesson05 从多表中查询数据
Lesson05 从多表中查询数据
renguzi
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)
Achmad Solichin
Understanding
Understanding
Arun Gupta
Android de la A a la Z XML Ulises Gonzalez
Android de la A a la Z XML Ulises Gonzalez
Android UNAM
Les04
Les04
Akmal Rony
Dare to build vertical design with relational data (Entity-Attribute-Value)
Dare to build vertical design with relational data (Entity-Attribute-Value)
Ivo Andreev
Analytical Functions for DWH
Analytical Functions for DWH
Emrah METE
EMF-IncQuery 0.7 Presentation for Itemis
EMF-IncQuery 0.7 Presentation for Itemis
Istvan Rath
Functional Programming With Lambdas and Streams in JDK8
Functional Programming With Lambdas and Streams in JDK8
IndicThreads
Php 5 3-study_guide_v1a
Php 5 3-study_guide_v1a
luckysher007
Subconsultas
Subconsultas
Maria
Mais procurados
(20)
SQL SELECT Statement
SQL SELECT Statement
Lesson04 学会使用分组函数
Lesson04 学会使用分组函数
Les10
Les10
Les09
Les09
Les01
Les01
Les02
Les02
Lesson06 使用子查询
Lesson06 使用子查询
Les06
Les06
Lesson10
Lesson10
Lesson05 从多表中查询数据
Lesson05 从多表中查询数据
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)
Understanding
Understanding
Android de la A a la Z XML Ulises Gonzalez
Android de la A a la Z XML Ulises Gonzalez
Les04
Les04
Dare to build vertical design with relational data (Entity-Attribute-Value)
Dare to build vertical design with relational data (Entity-Attribute-Value)
Analytical Functions for DWH
Analytical Functions for DWH
EMF-IncQuery 0.7 Presentation for Itemis
EMF-IncQuery 0.7 Presentation for Itemis
Functional Programming With Lambdas and Streams in JDK8
Functional Programming With Lambdas and Streams in JDK8
Php 5 3-study_guide_v1a
Php 5 3-study_guide_v1a
Subconsultas
Subconsultas
Semelhante a Lesson01 学会使用基本的SQL语句
Les01 Writing BAsic SQL SELECT Statement.ppt
Les01 Writing BAsic SQL SELECT Statement.ppt
DrZeeshanBhatti
Database Management Systems SQL And DDL language
Database Management Systems SQL And DDL language
HSibghatUllah
SQL, consultas rapidas y sencillas, oracle
SQL, consultas rapidas y sencillas, oracle
marycielocartagena73
Lesson03 学会使用单行函数
Lesson03 学会使用单行函数
renguzi
Lesson02 学会使用WHERE、ORDER BY子句
Lesson02 学会使用WHERE、ORDER BY子句
renguzi
plsql les02
plsql les02
sasa_eldoby
Lesson08
Lesson08
renguzi
Introduction of Oracle
Introduction of Oracle
Salman Memon
Oracle Baisc Tutorial
Oracle Baisc Tutorial
bunny0143
Lesson09
Lesson09
renguzi
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
rehaniltifat
SQL.ppt
SQL.ppt
nikhilachinni1
War of the Indices- SQL vs. Oracle
War of the Indices- SQL vs. Oracle
Kellyn Pot'Vin-Gorman
plsql les01
plsql les01
sasa_eldoby
Introduction to Oracle SQL Database Systems.ppt
Introduction to Oracle SQL Database Systems.ppt
DrZeeshanBhatti
Lesson07
Lesson07
renguzi
Producing Readable Output with iSQL*Plus - Oracle Data Base
Producing Readable Output with iSQL*Plus - Oracle Data Base
Salman Memon
plsql Les08
plsql Les08
sasa_eldoby
Les08
Les08
Abrianto Nugraha
Les02 Restricting and Sorting Data using SQL.ppt
Les02 Restricting and Sorting Data using SQL.ppt
DrZeeshanBhatti
Semelhante a Lesson01 学会使用基本的SQL语句
(20)
Les01 Writing BAsic SQL SELECT Statement.ppt
Les01 Writing BAsic SQL SELECT Statement.ppt
Database Management Systems SQL And DDL language
Database Management Systems SQL And DDL language
SQL, consultas rapidas y sencillas, oracle
SQL, consultas rapidas y sencillas, oracle
Lesson03 学会使用单行函数
Lesson03 学会使用单行函数
Lesson02 学会使用WHERE、ORDER BY子句
Lesson02 学会使用WHERE、ORDER BY子句
plsql les02
plsql les02
Lesson08
Lesson08
Introduction of Oracle
Introduction of Oracle
Oracle Baisc Tutorial
Oracle Baisc Tutorial
Lesson09
Lesson09
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
SQL.ppt
SQL.ppt
War of the Indices- SQL vs. Oracle
War of the Indices- SQL vs. Oracle
plsql les01
plsql les01
Introduction to Oracle SQL Database Systems.ppt
Introduction to Oracle SQL Database Systems.ppt
Lesson07
Lesson07
Producing Readable Output with iSQL*Plus - Oracle Data Base
Producing Readable Output with iSQL*Plus - Oracle Data Base
plsql Les08
plsql Les08
Les08
Les08
Les02 Restricting and Sorting Data using SQL.ppt
Les02 Restricting and Sorting Data using SQL.ppt
Último
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Juan lago vázquez
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Rustici Software
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
The Digital Insurer
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
lior mazor
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
MIND CTI
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Overkill Security
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
apidays
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Khushali Kathiriya
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Igalia
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Jeffrey Haguewood
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Deepika Singh
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
apidays
Último
(20)
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Lesson01 学会使用基本的SQL语句
1.
Oracle OCP 考试系列培训
之 1Z0-007 Lesson1 www.OracleOnLinux.cn 1-1 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
2.
1
Retrieving Data Using the SQL SELECT Statement 1-2 Copyright © 2011, www.OracleOnLinux . Part rights reserved. OracleOnLinux OracleOnLinux.cn
3.
Objectives
After completing this lesson, you should 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 SQL* 1-3 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
4.
Lesson Agenda
• Basic SELECT statement • Arithmetic expressions and NULL values in the SELECT statement • Column aliases • Use of concatenation operator, literal character strings, alternative quote operator, and the DISTINCT keyword • DESCRIBE command 1-4 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
5.
Capabilities of SQL
SELECT Statements Projection Selection Table 1 Table 1 Join Table 1 Table 2 1-5 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
6.
Basic SELECT Statement
SELECT *|{[DISTINCT] column|expression [alias],...} FROM table; • SELECT identifies the columns to be displayed • FROM identifies the table containing those columns 1-6 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
7.
Selecting All Columns
SELECT * FROM departments; 1-7 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
8.
Selecting Specific Columns
SELECT department_id, location_id FROM departments; 1-8 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
9.
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. • Indents are used to enhance readability. • In iSQL*Plus, SQL statements can optionally be SQL* terminated by a semicolon (;). Semicolons are required if you execute multiple SQL statements. • In SQL*plus, you are required to end each SQL SQL* statement with a semicolon (;). 1-9 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
10.
Column Heading Defaults
• iSQL*Plus: SQL* – Default heading alignment: Center – Default heading display: Uppercase • SQL*Plus: SQL* – Character and Date column headings are Left- aligned – Number column headings are right-aligned – Default heading display: Uppercase 1-10 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
11.
Arithmetic Expressions
Create expressions with number and date data by using arithmetic operators. Operator Description + Add - Subtract * Multiply / Divide 1-11 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
12.
Using Arithmetic Operators
SELECT last_name, salary, salary + 300 FROM employees; … 1-12 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
13.
Operator Precedence
SELECT last_name, salary, 12*salary+100 12* FROM employees; 1 … SELECT last_name, salary, 12*(salary+100) 12* FROM employees; 2 … 1-13 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
14.
Defining a Null
Value • A null is a value that is unavailable, unassigned, unknown, or inapplicable. • A null is not the same as a zero or a blank space. SELECT last_name, job_id, salary, commission_pct FROM employees; … … 1-14 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
15.
Null Values
in Arithmetic Expressions Arithmetic expressions containing a null value evaluate to null. SELECT last_name, 12*salary,12*salary*(1+commission_pct) 12* 12* salary* FROM employees; … … 1-15 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
16.
Defining a Column
Alias A column alias: • Renames a column heading • Is useful with calculations • Immediately follows the column name (There can also be the optional AS keyword between the column name and alias.) • Requires double quotation marks if it contains spaces or special characters or if it is case- sensitive • Can not be used in Where clause 1-16 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
17.
Using Column Aliases
SELECT last_name AS name, commission_pct comm FROM employees; … SELECT last_name "Name" , salary*12 "Annual Salary" salary* FROM employees; … 1-17 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
18.
Concatenation Operator
A concatenation operator: • Links columns or character strings to other columns • Is represented by two vertical bars (||) • Creates a resultant column that is a character expression SELECT last_name||job_id AS "Employees" FROM employees; … 1-18 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
19.
Concatenation Operator
SELECT last_name||'''s'||salary FROM employees; SELECT last_name||chr(39)||'s'||salary FROM employees; SELECT ASCII('''') FROM dual; SELECT ASCII('?') FROM dual; 1-19 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
20.
Literal Character Strings
• A literal is a character, a number, or a date that is included in the SELECT statement. • Date and character literal values must be enclosed by single quotation marks. • Each character string is output once for each row returned. 1-20 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
21.
Using Literal Character
Strings SELECT last_name ||' is a ' ||job_id AS "Employee Details" FROM employees; … 1-21 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
22.
Duplicate Rows
The default display of queries is all rows, including duplicate rows. SELECT department_id FROM employees; 1 … SELECT DISTINCT department_id FROM employees; 2 … 1-22 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
23.
SQL and iSQL*Plus
Interaction SQL* SQL statements Oracle server Internet browser iSQL*Plus SQL* Query results commands Formatted report Client 1-23 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
24.
SQL Statements Versus
iSQL*Plus Commands SQL* SQL iSQL*Plus SQL* • A language • An environment • ANSI standard • Oracle-proprietary • Keyword cannot be • Keywords can be abbreviated abbreviated • Statements manipulate • Commands do not allow data and table definitions manipulation of values in in the database the database • Runs on a browser • Centrally loaded; does not have to be implemented on each machine SQL iSQL*Plus SQL* statements commands 1-24 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
25.
Overview of iSQL*Plus
SQL* After you log in to iSQL*Plus, you can: SQL* • Describe table structures • Enter, execute, and edit SQL statements • Save or append SQL statements to files • Execute or edit statements that are stored in saved script files 1-25 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
26.
Logging In to
iSQL*Plus SQL* From your browser environment: 1-26 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
27.
iSQL*Plus Environment
SQL* 8 9 7 1 6 2 3 4 5 1-27 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
28.
Displaying Table Structure
Use the iSQL*Plus DESCRIBE command to display the SQL* structure of a table: DESC[RIBE] tablename 1-28 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
29.
Displaying Table Structure
DESCRIBE employees 1-29 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
30.
Interacting with Script
Files SELECT last_name, hire_date, salary FROM employees; 1 2 1-30 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
31.
Interacting with Script
Files 1-31 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
32.
Interacting with Script
Files 1 1-32 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
33.
Interacting with Script
Files D:TEMPemp_data.sql 2 3 1-33 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
34.
iSQL*Plus History Page
SQL* 3 2 1 1-34 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
35.
iSQL*Plus History Page
SQL* 3 4 1-35 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
36.
Setting iSQL*Plus Preferences
SQL* 1 2 3 1-36 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
37.
Setting the Output
Location Preference 2 1 1-37 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
38.
Summary
In this lesson, you should have learned how to: • Write a SELECT statement that: – Returns all rows and columns from a table – Returns specified columns from a table – Uses column aliases to display more descriptive column headings • Use the iSQL*Plus environment to write, save, and SQL* execute SQL statements and iSQL*Plus SQL* commands SELECT *|{[DISTINCT] column|expression [alias],...} FROM table; 1-38 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
39.
Practice 1: Overview
This practice covers the following topics: • Selecting all data from different tables • Describing the structure of tables • Performing arithmetic calculations and specifying column names • Using iSQL*Plus SQL* 1-39 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
40.
Practice 1
Q1: A SELECT statement can be used to perform these three functions: 1. Choose rows from a table. 2. Choose columns from a table. 3. Bring together data that is stored in different tables by creating a link between them. Which set of keywords describes these capabilities? A. difference, projection, join B. selection, projection, join C. selection, intersection, join D. intersection, projection, join E. difference, projection, product 1-40 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
41.
Practice 1
Q2: Evaluate this SQL statement: SELECT e.EMPLOYEE_ID,e.LAST_NAME, e.DEPARTMENT_ID, d.DEPARTMENT_NAME FROM EMPLOYEES e, DEPARTMENTS d WHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID; In the statement, which capabilities of a SELECT statement are performed? A. selection, projection, join B. difference, projection, join C. selection, intersection, join D. intersection, projection, join E. difference, projection, product 1-41 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
42.
Practice 1
Q3: Evaluate this SQL statement: SELECT ename, sal, 12 *sal+100 12* FROM emp; The SAL column stores the monthly salary of the employee. Which change must be made to the above syntax to calculate the annual compensation as "monthly salary plus a monthly bonus of $100, multiplied by 12"? A. No change is required to achieve the desired results. B. SELECT ename, sal, 12 *(sal+100) FROM emp; 12* C. SELECT ename, sal, (12 *sal)+100 FROM emp; (12* D. SELECT ename, sal+100, *12 FROM emp; sal+100,* 1-42 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
43.
Practice 1
Q4: Which SQL statement generates the alias Annual Salary for the calculated column SALARY *12? SALARY* A. SELECT ename, salary *12 'Annual Salary' salary* FROM employees; B. SELECT ename, salary *12 "Annual Salary" salary* FROM employees; C. SELECT ename, salary *12 AS Annual Salary salary* FROM employees; D. SELECT ename, salary *12 AS INITCAP("ANNUAL salary* SALARY") FROM employees 1-43 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
44.
Practice 1
Q5: The CUSTOMERS table has these columns: CUSTOMER_ID NUMBER(4) NOT NULL CUSTOMER_NAME VARCHAR2(100) NOT NULL CUSTOMER_ADDRESS VARCHAR2(150) CUSTOMER_PHONE VARCHAR2(20) You need to produce output that states "Dear Customer customer_name, ". The customer_name data values come from the CUSTOMER_NAME column in the CUSTOMERS table. Which statement produces this output? 1-44 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
45.
Practice 1
A. SELECT dear customer, customer_name, FROM customers; B. SELECT "Dear Customer", customer_name || ',' FROM customers; C. SELECT 'Dear Customer ' || customer_name ',' FROM customers; D. SELECT 'Dear Customer ' || customer_name || ',' FROM customers; E. SELECT "Dear Customer " || customer_name || "," FROM customers; F. SELECT 'Dear Customer ' || customer_name || ',' || FROM customers; 1-45 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
46.
Practice 1
Q6: Which two are attributes of iSQL *Plus? (Choose two.) iSQL* A. iSQL*Plus commands cannot be abbreviated. iSQL* B. iSQL*Plus commands are accessed from a browser. iSQL* C. iSQL*Plus commands are used to manipulate data in iSQL* tables. D. iSQL*Plus commands manipulate table definitions in iSQL* the database. E. iSQL*Plus is the Oracle proprietary interface for iSQL* executing SQL statements. 1-46 Copyright © 2011, www.OracleOnLinux.cn . Part rights reserved.
Baixar agora