90 likes | 238 Vues
This chapter provides an introduction to the SQL execution environment, focusing on how Oracle runs on various operating systems and the tools available for database interaction, including SQL Developer and SQL*Plus. It covers setting up the STUDENT schema, creating database connections, and exploring table objects. You will learn about the components of a SELECT statement, including selecting columns, eliminating duplicates, and executing SQL commands in both SQL Developer and SQL*Plus. Understanding data types and formatting SQL queries will be emphasized to ensure effective data management.
E N D
Chapter 2: SQL – The Basics Objectives: The SQL execution environment SELECT statement SQL Developer & SQL*Plus
Overview: SQL execution environment • Oracle can run on many different OS • Oracle databases server is where the Oracle DB software resides • Oracle provides SQL Developer & SQL*Plus tools/interfaces for connecting with the DB & executing your SQL queries • Other third party tools are available that are mentioned on Appendix H of the textbook
Let’s get started… • Execution environment & setting up STUDENT schema • Accessing Oracle database server • Getting started with SQL Developer • SQL and the Oracle database server • Creating a database connection for SQL Developer • Exploring database table objects • Columns tab • Data tab • Grants tab • Statistics tab • Triggers, dependencies, indexes, flashbacks, and SQL tabs • Details tab • SQL Developer worksheet • Results tab
Data types A data type determines the type of data that can be stored in a column. You must keep data types in mind especially when using comparison operators, in other words, comparing the values in two columns. • DATE • NUMBER • CHAR • VARCHAR2
SQL SELECT statement • Components of a SELECT statement • Selecting one, multiple or all columns • Eliminating duplicates with DISTINCT or UNIQUE
SQL Worksheet Icons • Constructing & formatting SQL SELECT statement in SQL Developer • Execute Statement • Run Script • Commit • Rollback • Cancel • Execute Explain Plan • Auto Trace • Clear
Formatting SQL statement in SQL Developer • Syntax formatting • Code completion • Syntax highlighting • Writing multiple statements in the SQL Developer • SQL statement history in SQL Developer
SQL*Plus • Starting SQL*Plus • Executing SQL commands in SQL*Plus • Formatting SQL*Plus results