Anda di halaman 1dari 21

Performing DML and DDL Operations Using the SQL Developer GUI

Copyright 2007, Oracle. All rights reserved.

Objectives
After completing this appendix, you should be able to do the following: Perform data definition language (DDL) operations using the SQL Developer menu options Perform data manipulation language (DML) operations using the SQL Developer menu options

E-2

Copyright 2007, Oracle. All rights reserved.

Browsing Database Objects


Create a database connection object. Use the Connections Navigator to:
Browse through many objects in a database schema Review the definitions of objects at a glance

E-3

Copyright 2007, Oracle. All rights reserved.

Creating a Schema Object


SQL Developer supports the creation of any schema object by using the context menu. Edit the objects by using an edit dialog or one of the many context-sensitive menus. View the DDL for adjustments such as creating a new object or editing an existing schema object.

Expand Connections. Right-click Tables and select New Table.

E-4

Copyright 2007, Oracle. All rights reserved.

Creating a New Table: Example


Select the Advanced check box to get all the options for defining tables.

Click + to add column. Click x to remove column.

Specify the column name, data type, DEFAULT value, and NULL constraint here.

E-5

Copyright 2007, Oracle. All rights reserved.

Defining Constraints

From the Primary Key, Unique Constraints, Foreign Keys, and Check Constraints, select the appropriate option to define a constraint on your table.

E-6

Copyright 2007, Oracle. All rights reserved.

Modifying a Table
1 2

E-7

Copyright 2007, Oracle. All rights reserved.

Adding Data to a Table


1

E-8

Copyright 2007, Oracle. All rights reserved.

Updating and Deleting Rows

E-9

Copyright 2007, Oracle. All rights reserved.

Commit and Rollback

Click the Commit Changes icon to save the transaction.

Click the Rollback Changes icon to undo the transaction.

E - 10

Copyright 2007, Oracle. All rights reserved.

Creating a View

1 2

E - 11

Copyright 2007, Oracle. All rights reserved.

Retrieving Data from a View

E - 12

Copyright 2007, Oracle. All rights reserved.

Creating a Sequence
2

E - 13

Copyright 2007, Oracle. All rights reserved.

Creating Indexes
2 1 3

E - 14

Copyright 2007, Oracle. All rights reserved.

Creating a Synonym
2 3

E - 15

Copyright 2007, Oracle. All rights reserved.

Using Snippets
Snippets are code fragments that may be just syntax or examples.
When you place your mouse pointer here, it shows the Snippets window. From the dropdown list you can select the functions category you want.

E - 16

Copyright 2007, Oracle. All rights reserved.

Using Snippets: Example

Inserting a snippet

Editing the snippet

E - 17

Copyright 2007, Oracle. All rights reserved.

Search Engines and External Tools


Shortcuts to frequently used tools

Links to popular search engines and discussion forums

E - 18

Copyright 2007, Oracle. All rights reserved.

Setting Preferences
Customize the SQL Developer interface and environment. In the Tools menu, select Preferences.

E - 19

Copyright 2007, Oracle. All rights reserved.

SQL Developer Tutorial


To learn how to use Oracle SQL Developer to perform common database development tasks, take the Oracle SQL Developer tutorial. Available at:
http://st-curriculum.oracle.com/tutorial/SQLDeveloper/index.htm

E - 20

Copyright 2007, Oracle. All rights reserved.

Summary
In this appendix, you should have learned how to use SQL Developer to do the following: Browse, create, and edit database objects using the SQL Developer GUI interface Insert, update, delete rows from a table using the SQL Developer GUI interface

E - 21

Copyright 2007, Oracle. All rights reserved.

Anda mungkin juga menyukai