SlideShare a Scribd company logo
SQL Database Development
Overview
ď‚— Define a database using SQL data definition language
ď‚— Work with Views
ď‚— Write single table queries
ď‚— Establish referential integrity
SQL Overview
ď‚— Structured Query Language
ď‚— The standard for relational database management
systems (RDBMS)
 SQL-92 and SQL-99 Standards – Purpose:
ď‚— Specify syntax/semantics for data definition and

manipulation
ď‚— Define data structures
ď‚— Enable portability
ď‚— Specify minimal (level 1) and complete (level 2)
standards
What Is SQL Developer?
ď‚— SQL Developer is a graphical tool that enhances

productivity and simplifies database development tasks.
ď‚— You can connect to any target database schema by using
standard database authentication.

SQL Developer
Specifications of SQL Developer
ď‚— Developed in Java

ď‚— Supports Windows, Linux, and Mac OS X platforms
ď‚— Default connectivity by using the JDBC Thin driver
ď‚— Does not require an installer
ď‚— Unzip the downloaded SQL Developer kit and double-click
sqldeveloper.exe to start SQL Developer.

ď‚— Connects to Oracle Database version 9.2.0.1 and later
ď‚— Freely downloadable from the following link:
ď‚— http://www.oracle.com/technology/products/database/sql_develop
er/index.html
ď‚— Needs JDK 1.5 installed on your system that can be

downloaded from the following link:
ď‚—

http://java.sun.com/javase/downloads/index_jdk5.jsp
Installing SQL Developer
ď‚— Download the Oracle SQL Developer kit and unzip it

into any directory on your machine.
SQL Developer 1.2 Interface
Creating a Database Connection
ď‚— You must have at least one database connection to use

SQL Developer.
ď‚— You can create and test connections for:
ď‚—
ď‚—

Multiple databases
Multiple schemas

ď‚— SQL Developer automatically imports any connections

defined in the tnsnames.ora file on your system.
ď‚— You can export connections to an Extensible Markup
Language (XML) file.
ď‚— Each additional database connection created is listed in
the Connections Navigator hierarchy.
Creating a Database Connection
1
2

3
SQL Environment
SQL Environment
ď‚— Catalog
ď‚— A set of schemas that constitute the description of a database

ď‚— Schema
ď‚— The structure that contains descriptions of objects created by

a user (base tables, views, constraints)

ď‚— Data Definition Language (DDL)
ď‚— Commands that define a database, including creating,

altering, and dropping tables and establishing constraints

ď‚— Data Manipulation Language (DML)
ď‚— Commands that maintain and query a database

ď‚— Data Control Language (DCL)
ď‚— Commands that control a database, including administering

privileges and committing data
SQL Data types
ď‚— String types
 CHAR(n) – fixed-length character data, n characters long Maximum

length = 2000 bytes
 VARCHAR2(n) – variable length character data, maximum 4000 bytes
 LONG – variable-length character data, up to 4GB. Maximum 1 per
table

ď‚— Numeric types
 NUMBER(p,q) – general purpose numeric data type
 INTEGER(p) – signed integer, p digits wide
 FLOAT(p) – floating point in scientific notation with p binary digits

precision

ď‚— Date/time type
 DATE – fixed-length date/time in dd-mm-yy form
Design components
ď‚— Tables

ď‚— Indexes
ď‚— Views
ď‚— Transactions

ď‚— Access Authorities
ď‚— Stored Procedures
ď‚— Functions
Sql database development part 1
SQL Database Definition
ď‚— Data Definition Language (DDL)
ď‚— Major CREATE statements:
 CREATE SCHEMA – defines a portion of the database

owned by a particular user
 CREATE TABLE – defines a table and its columns
 CREATE VIEW – defines a logical table from one or
more views

ď‚— Other CREATE statements: CHARACTER SET,

COLLATION, TRANSLATION, ASSERTION,
DOMAIN
Relational Data Model
Sample CREATE VIEW
CREATE VIEW EXPENSIVE_STUFF_V AS
SELECT PRODUCT_ID, PRODUCT_NAME, UNIT_PRICE
FROM PRODUCT_T
WHERE UNIT_PRICE >300
WITH CHECK_OPTION;

ď‚—View has a name
ď‚—View is based on a SELECT statement
ď‚—CHECK_OPTION works only for updateable views and
prevents updates that would create rows not included in
the view
Changing and Removing Tables
ď‚— ALTER TABLE statement allows you to change column

specifications:
ď‚— ALTER TABLE CUSTOMER_T ADD (TYPE

VARCHAR(2))

ď‚— DROP TABLE statement allows you to remove tables

from your schema:
ď‚— DROP TABLE CUSTOMER_T
Schema Definition
ď‚— Control processing/storage efficiency:
ď‚—
ď‚—
ď‚—
ď‚—
ď‚—

Choice of indexes
File organizations for base tables
File organizations for indexes
Data clustering
Statistics maintenance

ď‚— Creating indexes
ď‚— Speed up random/sequential access to base table data
ď‚— Example
ď‚— CREATE INDEX NAME_IDX ON
CUSTOMER_T(CUSTOMER_NAME)
ď‚— This makes an index for the CUSTOMER_NAME field of the
CUSTOMER_T table
Thank You
ď‚— http://www.sql-programmers.com/new-sql-database-development.aspx

More Related Content

PDF
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
PDF
Introduction to the Structured Query Language SQL
Harmony Kwawu
 
PPTX
What is SQL Server?
CPD INDIA
 
PPTX
Structured Query Language (SQL)
Syed Hassan Ali
 
PPT
Sql server T-sql basics ppt-3
Vibrant Technologies & Computers
 
DOC
DBMS Practical File
Dushmanta Nath
 
PDF
Database Fundamental
Gong Haibing
 
PPT
Sql intro & ddl 1
Dr. C.V. Suresh Babu
 
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
Introduction to the Structured Query Language SQL
Harmony Kwawu
 
What is SQL Server?
CPD INDIA
 
Structured Query Language (SQL)
Syed Hassan Ali
 
Sql server T-sql basics ppt-3
Vibrant Technologies & Computers
 
DBMS Practical File
Dushmanta Nath
 
Database Fundamental
Gong Haibing
 
Sql intro & ddl 1
Dr. C.V. Suresh Babu
 

What's hot (20)

PPT
MySQL and its basic commands
Bwsrang Basumatary
 
PPT
Presentation1
ahsan-1252
 
PPTX
Sql - Structured Query Language
Wan Hussain Wan Ishak
 
DOCX
Types of sql commands by naveen kumar veligeti
Naveen Kumar Veligeti
 
PDF
Web app development_my_sql_08
Hassen Poreya
 
PDF
Sql tutorial
Rumman Ansari
 
PDF
Sql 2009
Cathie101
 
PDF
Sql commands
Prof. Dr. K. Adisesha
 
PPTX
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
PPTX
Intro to T-SQL - 1st session
Medhat Dawoud
 
PPTX
Structured query language
Rashid Ansari
 
PPTX
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
PDF
Dbms
Sachin Yadav
 
PPT
Internet Environment
guest8fdbdd
 
PPTX
Introduction to (sql)
Dattatray Ghorpade
 
DOCX
Database Management Lab -SQL Queries
shamim hossain
 
DOC
Adbms
jass12345
 
PPTX
Introduction to mysql part 1
baabtra.com - No. 1 supplier of quality freshers
 
PDF
Sql tutorial-Structured query language
Mayank Bansal
 
PDF
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Beat Signer
 
MySQL and its basic commands
Bwsrang Basumatary
 
Presentation1
ahsan-1252
 
Sql - Structured Query Language
Wan Hussain Wan Ishak
 
Types of sql commands by naveen kumar veligeti
Naveen Kumar Veligeti
 
Web app development_my_sql_08
Hassen Poreya
 
Sql tutorial
Rumman Ansari
 
Sql 2009
Cathie101
 
Sql commands
Prof. Dr. K. Adisesha
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Intro to T-SQL - 1st session
Medhat Dawoud
 
Structured query language
Rashid Ansari
 
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Dbms
Sachin Yadav
 
Internet Environment
guest8fdbdd
 
Introduction to (sql)
Dattatray Ghorpade
 
Database Management Lab -SQL Queries
shamim hossain
 
Adbms
jass12345
 
Introduction to mysql part 1
baabtra.com - No. 1 supplier of quality freshers
 
Sql tutorial-Structured query language
Mayank Bansal
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Beat Signer
 
Ad

Similar to Sql database development part 1 (20)

PPT
Sql server basics
Dilfaroz Khan
 
PPTX
Introduction to Database SQL & PL/SQL
Collaboration Technologies
 
DOC
Sql server
Puja Gupta
 
PPTX
Bank mangement system
FaisalGhffar
 
PPT
Sql Summit Clr, Service Broker And Xml
David Truxall
 
PPT
a presenation on various dtabase languages
nidhi5172
 
PPTX
Sql
snegacmr
 
PPT
Module02
Sridhar P
 
PPT
Review of SQL
Information Technology
 
PPTX
introduction to SQL query language beginner.ppt
PatriceRochon1
 
PPT
SQL Server 2008 for .NET Developers
llangit
 
PPT
Tech Days09 Sqldev
llangit
 
PPT
SQL Server 2008 for Developers
llangit
 
PPTX
Sql azure dec_2010 Lynn & Ike
Ike Ellis
 
PPTX
SQL2.pptx
RareDeath
 
PPT
SQL Server 2008 for Developers
ukdpe
 
PDF
SQL Complete Tutorial. All Topics Covered
Danish Mehraj
 
PPT
Saying goodbye to SQL Server 2000
ukdpe
 
PPTX
Using Basic Structured Query Language lo1.pptx
TsedaleBayabil
 
PPT
MySQL intro
David Rajah Selvaraj
 
Sql server basics
Dilfaroz Khan
 
Introduction to Database SQL & PL/SQL
Collaboration Technologies
 
Sql server
Puja Gupta
 
Bank mangement system
FaisalGhffar
 
Sql Summit Clr, Service Broker And Xml
David Truxall
 
a presenation on various dtabase languages
nidhi5172
 
Sql
snegacmr
 
Module02
Sridhar P
 
Review of SQL
Information Technology
 
introduction to SQL query language beginner.ppt
PatriceRochon1
 
SQL Server 2008 for .NET Developers
llangit
 
Tech Days09 Sqldev
llangit
 
SQL Server 2008 for Developers
llangit
 
Sql azure dec_2010 Lynn & Ike
Ike Ellis
 
SQL2.pptx
RareDeath
 
SQL Server 2008 for Developers
ukdpe
 
SQL Complete Tutorial. All Topics Covered
Danish Mehraj
 
Saying goodbye to SQL Server 2000
ukdpe
 
Using Basic Structured Query Language lo1.pptx
TsedaleBayabil
 
MySQL intro
David Rajah Selvaraj
 
Ad

Recently uploaded (20)

PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
This slide provides an overview Technology
mineshkharadi333
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Coupa-Overview _Assumptions presentation
annapureddyn
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 

Sql database development part 1

  • 2. Overview ď‚— Define a database using SQL data definition language ď‚— Work with Views ď‚— Write single table queries ď‚— Establish referential integrity
  • 3. SQL Overview ď‚— Structured Query Language ď‚— The standard for relational database management systems (RDBMS) ď‚— SQL-92 and SQL-99 Standards – Purpose: ď‚— Specify syntax/semantics for data definition and manipulation ď‚— Define data structures ď‚— Enable portability ď‚— Specify minimal (level 1) and complete (level 2) standards
  • 4. What Is SQL Developer? ď‚— SQL Developer is a graphical tool that enhances productivity and simplifies database development tasks. ď‚— You can connect to any target database schema by using standard database authentication. SQL Developer
  • 5. Specifications of SQL Developer ď‚— Developed in Java ď‚— Supports Windows, Linux, and Mac OS X platforms ď‚— Default connectivity by using the JDBC Thin driver ď‚— Does not require an installer ď‚— Unzip the downloaded SQL Developer kit and double-click sqldeveloper.exe to start SQL Developer. ď‚— Connects to Oracle Database version 9.2.0.1 and later ď‚— Freely downloadable from the following link: ď‚— http://www.oracle.com/technology/products/database/sql_develop er/index.html ď‚— Needs JDK 1.5 installed on your system that can be downloaded from the following link: ď‚— http://java.sun.com/javase/downloads/index_jdk5.jsp
  • 6. Installing SQL Developer ď‚— Download the Oracle SQL Developer kit and unzip it into any directory on your machine.
  • 7. SQL Developer 1.2 Interface
  • 8. Creating a Database Connection ď‚— You must have at least one database connection to use SQL Developer. ď‚— You can create and test connections for: ď‚— ď‚— Multiple databases Multiple schemas ď‚— SQL Developer automatically imports any connections defined in the tnsnames.ora file on your system. ď‚— You can export connections to an Extensible Markup Language (XML) file. ď‚— Each additional database connection created is listed in the Connections Navigator hierarchy.
  • 9. Creating a Database Connection 1 2 3
  • 11. SQL Environment ď‚— Catalog ď‚— A set of schemas that constitute the description of a database ď‚— Schema ď‚— The structure that contains descriptions of objects created by a user (base tables, views, constraints) ď‚— Data Definition Language (DDL) ď‚— Commands that define a database, including creating, altering, and dropping tables and establishing constraints ď‚— Data Manipulation Language (DML) ď‚— Commands that maintain and query a database ď‚— Data Control Language (DCL) ď‚— Commands that control a database, including administering privileges and committing data
  • 12. SQL Data types ď‚— String types ď‚— CHAR(n) – fixed-length character data, n characters long Maximum length = 2000 bytes ď‚— VARCHAR2(n) – variable length character data, maximum 4000 bytes ď‚— LONG – variable-length character data, up to 4GB. Maximum 1 per table ď‚— Numeric types ď‚— NUMBER(p,q) – general purpose numeric data type ď‚— INTEGER(p) – signed integer, p digits wide ď‚— FLOAT(p) – floating point in scientific notation with p binary digits precision ď‚— Date/time type ď‚— DATE – fixed-length date/time in dd-mm-yy form
  • 13. Design components ď‚— Tables ď‚— Indexes ď‚— Views ď‚— Transactions ď‚— Access Authorities ď‚— Stored Procedures ď‚— Functions
  • 15. SQL Database Definition ď‚— Data Definition Language (DDL) ď‚— Major CREATE statements: ď‚— CREATE SCHEMA – defines a portion of the database owned by a particular user ď‚— CREATE TABLE – defines a table and its columns ď‚— CREATE VIEW – defines a logical table from one or more views ď‚— Other CREATE statements: CHARACTER SET, COLLATION, TRANSLATION, ASSERTION, DOMAIN
  • 17. Sample CREATE VIEW CREATE VIEW EXPENSIVE_STUFF_V AS SELECT PRODUCT_ID, PRODUCT_NAME, UNIT_PRICE FROM PRODUCT_T WHERE UNIT_PRICE >300 WITH CHECK_OPTION; ď‚—View has a name ď‚—View is based on a SELECT statement ď‚—CHECK_OPTION works only for updateable views and prevents updates that would create rows not included in the view
  • 18. Changing and Removing Tables ď‚— ALTER TABLE statement allows you to change column specifications: ď‚— ALTER TABLE CUSTOMER_T ADD (TYPE VARCHAR(2)) ď‚— DROP TABLE statement allows you to remove tables from your schema: ď‚— DROP TABLE CUSTOMER_T
  • 19. Schema Definition ď‚— Control processing/storage efficiency: ď‚— ď‚— ď‚— ď‚— ď‚— Choice of indexes File organizations for base tables File organizations for indexes Data clustering Statistics maintenance ď‚— Creating indexes ď‚— Speed up random/sequential access to base table data ď‚— Example ď‚— CREATE INDEX NAME_IDX ON CUSTOMER_T(CUSTOMER_NAME) ď‚— This makes an index for the CUSTOMER_NAME field of the CUSTOMER_T table