SQL & My SQL Tutorial
- What is SQL?
- SQL Microsoft
- SQL Management Tools
- SQL Developer
- Docker Commands
- Composite Key in SQL
- SQL Constraints
- Transactions in SQL Server
- SQL Server Data Types
- SQL Update Join
- SQL Operators
- SQL Clauses
- SQL Commands
- SQL Alter Command
- Distinct Keyword in SQL
- SQL Statements
- SQL Index
- SQL Injections
- Wildcards in SQL
- Alter and Truncate Command in SQL
- SQL Null Functions – ISNULL, IFNULL, Combine, & NULLIF
- SQL Sequence
- How to Find Duplicate Records in SQL
- Primary and Foreign Key in SQL with Examples
- COUNT Function
- SUM Function in SQL
- Dynamic SQL
- Database Tuning
- Pseudocolumn in Oracle SQL
- Triggers in SQL
- Embedded SQL in DBMS
SQL Developer, usually known as an Integrated Development Environment or IDE, it provides a workspace for developing databases using SQL programming. It is an Oracle open-source utility with a user-friendly Graphical User Interface (GUI) that supports all of Oracle’s other tools. SQL is the most extensively used application software because it allows users to perform a variety of tasks in one place, such as DBA processes, query creation and execution, and report production.SQl Developer Downloadform Oracle Website.
Steps to Install SQL Developer
- You can download SQL developerfrom the Oracle website, but you’ll need to create an account first.
- Download and install the Oracle SQL Developer version that you need.
- Download and install Oracle Database 10g and the Sample Schema.
- Log in as the SYS user and type command: modify user hrrecognised by hr account unlock to unlock the HR user.
- Save the files to your computer and unzip them.
To a local folder on your PC that contains all essential files.
Steps to Create Database Connection
Following are the steps to create a database connection.
- Open Oracle SQL Developer.
- Now, under Connections, right-click on the Connections, and the Connection menu appears. Click on New Connection.
- The New/Select Database Connection Dialog Box will appear.
- Enter the following details in the fields of the above-appeared dialog box.
Name of Cloud Connection
Your choice (then check the checkbox Save Password)
Your local hostname
Your own SID
- Then click on Test
After creating a connection, you can use existing objects of Oracle SQL Developer or can create new also. Now let us see how to browse already existing objects.
Browsing Objects in Oracle SQL Developer
Expand the newly added connection.
You can use any object like tables, views, indexes, packages, triggers, sequences, synonyms, directories, types, materialized views, functions, and many more. But we will see in brief how we can use tables.
- You can select any table from the list to view the table definition and click the Data tab.
In the figure below, we have selected the DEPARTMENTS table. You can then see the data present in the table.
You can apply various operations on a table like sorting, filtering data, applying various constraints, and many more. For example, you can apply to sort by clicking the arrow icon next to the name of the column you want to sort.
Creating Objects in Oracle SQL Developer
You can create dialogs for each supported object type. Oracle SQL Developer also supports Temporary tables, External tables, lists, Partitioned tables, Index Organised tables, and many more object types.
- Right-click on.
- Select a New Table.
- Enter the Table Name and check the Advanced.
- Enter information for the first column as mentioned below:
The Not Null and Primary Key is the integrity constraint which states what type of data can be inserted in each column. There are more integrity constraints that can be applied to restrict the type of data that is valid for a respective column.
Let us briefly see what these integrity constraints do.
There are basically five integrity constraints:
This constraint ensures that data must be present in that column. A null value cannot be inserted in that column.
This constraint ensures that each value in the column must be unique, i.e., no repetition of values. This constraint can be applied on multiple columns together as a group called as Composite Unique. It does not say anything about Null value.
This constraint ensures the properties of both NOT NULL and UNIQUE constraints, i.e. multiple rows cannot have the same value and prevent null value simultaneously.
This constraint states that for each value in the column on which the constraint is applied, there must be the same or matching values in other specified tables and columns. It is basically called referencing other tables.
This constraint is not used frequently, but it ensures that values must satisfy the specified condition. The condition can be the logical expression or comparison expression depending upon the need for the restrictions to be applied.