Hot Posts

Introduction to SQL - What is SQL?

Structured Query Language (SQL) is a powerful and standardized language used to manage and manipulate relational databases. Oracle, a leading relational database management system (RDBMS), heavily relies on SQL for performing various operations such as data retrieval, insertion, updating, and deletion. In this comprehensive guide, we will explore what SQL is in the context of Oracle.


Introduction to SQL:


  • It stands for Structured Query Language.
  • It was developed was developed by IBM in 1970.
  • It is composed of DML & DDL. I.e. It provides 9 basic commands which are common to all DBMS.
  • CREATE, ALTER, DROP for tables
  • INSERT, UPDATE, DELETE for rows
  • GRANT, REVOKE for permissions
  • SELECT for query
  • It is the Language for communication with Server.
  • It is also pronounced as Sequel.
  • It is an ANSI (American National Standards Institute) standard but there are different versions of SQL language available in the market today. However, to be compliant with the ANSI standard, they all support 9 basic commands.

Features / Characteristics / Properties of SQL:


  • SQL is English like language.
  • SQL is a non-procedural language, which means that it requires only specifying what operations to be done to retrieve data, without specifying how to perform that operation.
  • Users those with little or no programming experience can use SQL.
  • SQL is a high-level language.
  • SQL is a free-format syntax, which gives users the ability to structure SQL statements on any part of the screen.
  • SQL is very flexible.
  • SQL can be embedded also in Front-end application code like VB, JAVA, VC++, etc.
  • SQL based application code is portable. i.e. code written on one system can run on any system even if the hardware or operating system changes.
  • SQL reduces the amount of time required for creating and maintaining the system.

Rules of SQL:


  • Every SQL statements end with the semicolon (;) to execute it immediately. Or to separate each SQL statements in DBMS that allows multiple SQL statements to be executed in the same call to the server.
  • SQL statements are not case sensitive. So, select is same as SELECT.
  • SQL statements may be split across lines but keywords cannot be split.
  • Numeric constants can be represented by simple values like 123.5, or in scientific notation like 1.255E2.
  • Character & Date constants must be enclosed within single quotes (‘’)
  • Single line comments are prefixed with a double hyphen symbol (--).
  • Multi-line comments are enclosed between /* and */.
  • When you enter a SQL statement at SQL*plus prompt, it is stored in a SQL buffer.
  • Only one statement can be current within the buffer at any time.

What can you do with SQL:


  • You can create new databases
  • You can create new tables
  • You can execute queries against a database
  • You can retrieve data from a database
  • You can insert records in a database
  • You can update records in a database
  • You can delete records from a database
  • You can create views in a database
  • You can grant permissions on tables, procedures, and views
  • You can revoke permissions on tables, procedures, and views
  • You can create sequences
  • You can create indexes
  • You can create different types of views based on the user’s requirements

Conclusion

SQL is a vital language for interacting with relational databases, and Oracle Database utilizes it extensively for various operations. Whether you are retrieving data, modifying existing records, creating tables, or implementing advanced features like indexes and stored procedures, SQL provides a standardized and powerful means to interact with Oracle databases. Understanding SQL is essential for anyone involved in database development, administration, or data analysis within the Oracle ecosystem.




Post a Comment

0 Comments