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 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

What's hot

MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
Bwsrang Basumatary
 
Presentation1
Presentation1Presentation1
Presentation1
ahsan-1252
 
Sql - Structured Query Language
Sql - Structured Query LanguageSql - Structured Query Language
Sql - Structured Query Language
Wan Hussain Wan Ishak
 
Types of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiTypes of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligeti
Naveen Kumar Veligeti
 
Web app development_my_sql_08
Web app development_my_sql_08Web app development_my_sql_08
Web app development_my_sql_08
Hassen Poreya
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
Rumman Ansari
 
Sql 2009
Sql 2009Sql 2009
Sql 2009
Cathie101
 
Sql commands
Sql commandsSql commands
Sql commands
Prof. Dr. K. Adisesha
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
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
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st session
Medhat Dawoud
 
Structured query language
Structured query languageStructured query language
Structured query language
Rashid Ansari
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Dbms
DbmsDbms
Internet Environment
Internet  EnvironmentInternet  Environment
Internet Environment
guest8fdbdd
 
Introduction to (sql)
Introduction to (sql)Introduction to (sql)
Introduction to (sql)
Dattatray Ghorpade
 
Database Management Lab -SQL Queries
Database Management Lab -SQL Queries Database Management Lab -SQL Queries
Database Management Lab -SQL Queries
shamim hossain
 
Adbms
AdbmsAdbms
Adbms
jass12345
 
Introduction to mysql part 1
Introduction to mysql part 1Introduction to mysql part 1
Sql tutorial-Structured query language
Sql tutorial-Structured query languageSql tutorial-Structured query language
Sql tutorial-Structured query language
Mayank Bansal
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Beat Signer
 

What's hot (20)

MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
Presentation1
Presentation1Presentation1
Presentation1
 
Sql - Structured Query Language
Sql - Structured Query LanguageSql - Structured Query Language
Sql - Structured Query Language
 
Types of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiTypes of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligeti
 
Web app development_my_sql_08
Web app development_my_sql_08Web app development_my_sql_08
Web app development_my_sql_08
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sql 2009
Sql 2009Sql 2009
Sql 2009
 
Sql commands
Sql commandsSql commands
Sql commands
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st session
 
Structured query language
Structured query languageStructured query language
Structured query language
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Dbms
DbmsDbms
Dbms
 
Internet Environment
Internet  EnvironmentInternet  Environment
Internet Environment
 
Introduction to (sql)
Introduction to (sql)Introduction to (sql)
Introduction to (sql)
 
Database Management Lab -SQL Queries
Database Management Lab -SQL Queries Database Management Lab -SQL Queries
Database Management Lab -SQL Queries
 
Adbms
AdbmsAdbms
Adbms
 
Introduction to mysql part 1
Introduction to mysql part 1Introduction to mysql part 1
Introduction to mysql part 1
 
Sql tutorial-Structured query language
Sql tutorial-Structured query languageSql tutorial-Structured query language
Sql tutorial-Structured query language
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
 

Similar to Sql database development part 1

Sql server basics
Sql server basicsSql server basics
Sql server basics
Dilfaroz Khan
 
Introduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQLIntroduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQL
Collaboration Technologies
 
Sql server
Sql serverSql server
Sql server
Puja Gupta
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
FaisalGhffar
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
David Truxall
 
Sql
SqlSql
Module02
Module02Module02
Module02
Sridhar P
 
Review of SQL
Review of SQLReview of SQL
Review of SQL
Information Technology
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
llangit
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
llangit
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
llangit
 
Sql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & IkeSql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & Ike
Ike Ellis
 
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
RareDeath
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
ukdpe
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
Danish Mehraj
 
Saying goodbye to SQL Server 2000
Saying goodbye to SQL Server 2000Saying goodbye to SQL Server 2000
Saying goodbye to SQL Server 2000
ukdpe
 
MySQL intro
MySQL introMySQL intro
MySQL intro
MySQL introMySQL intro
Database Management System (DBMS).pptx
Database Management System (DBMS).pptxDatabase Management System (DBMS).pptx
Database Management System (DBMS).pptx
GevitaChinnaiah
 
Ch 9 S Q L
Ch 9  S Q LCh 9  S Q L
Ch 9 S Q L
guest8fdbdd
 

Similar to Sql database development part 1 (20)

Sql server basics
Sql server basicsSql server basics
Sql server basics
 
Introduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQLIntroduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQL
 
Sql server
Sql serverSql server
Sql server
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
 
Sql
SqlSql
Sql
 
Module02
Module02Module02
Module02
 
Review of SQL
Review of SQLReview of SQL
Review of SQL
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
Sql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & IkeSql azure dec_2010 Lynn & Ike
Sql azure dec_2010 Lynn & Ike
 
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
Saying goodbye to SQL Server 2000
Saying goodbye to SQL Server 2000Saying goodbye to SQL Server 2000
Saying goodbye to SQL Server 2000
 
MySQL intro
MySQL introMySQL intro
MySQL intro
 
MySQL intro
MySQL introMySQL intro
MySQL intro
 
Database Management System (DBMS).pptx
Database Management System (DBMS).pptxDatabase Management System (DBMS).pptx
Database Management System (DBMS).pptx
 
Ch 9 S Q L
Ch 9  S Q LCh 9  S Q L
Ch 9 S Q L
 

Recently uploaded

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

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
  • 14.
  • 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