SQL, initially called SEQUEL, is a standard language for storing, manipulating, and retrieving data in databases based on the English language.
SQL is a standard language for accessing and manipulating databases and it is the core of relational database which is used for accessing and managing databases.
SQL stands for Structured Query Language and is used to communicate with a database. With SQL, you can access or manipulate data stored in the database.
Keep in Mind That…
A query is a statement asking for the retrieval of information from the database.
SQL is a declarative language, not a procedural language. You write a single SQL declaration and hand it to the DBMS. The DBMS then executes internal code, which is hidden from us.
- Declarative paradigm is where you say what you want without having to say how to do it. With the procedural paradigm (used in JAVA, C), you have to define exact steps to get the outcome. SQL is declarative than procedural since the queries don’t define steps to produce the outcome.
- SQL in its purest form is not a programming language, but a query language. Because it needs to be able to perform loops and control structures. Nevertheless, with some extensions, SQL can have looping and control structures but they exist outside or rather as an appendage to the original SQL spec. In this manner, some claim that SQL is a programming language.
What is SQL?
SQL stands for Structured Query Language
SQL lets you access and manipulates databases
SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987
What Can SQL do?
The uses of SQL cover modifying database table and index structures; adding, updating, and deleting rows of data; and retrieving subsets of information from within a database for transaction processing and analytics applications.
*SQL can execute queries against a database
*SQL can retrieve data from a database
*SQL can insert records in a database
*SQL can update records in a database
*SQL can delete records from a database
*SQL can create new databases
*SQL can create new tables in a database
*SQL can create stored procedures in a database
*SQL can create views in a database
*SQL can set permissions on tables, procedures, and views
SQL is a Standard – BUT….
Although SQL is an ANSI/ISO standard, there are various versions of the SQL language.
However, to be compliant with the ANSI standard, they all support at least the major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner.
RDBMS stands for Relational Database Management System.
RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
The data in RDBMS is stored in database objects called tables. A table is a collection of related data entries and consists of columns and rows.
Every table is broken up into smaller entities called fields. The fields in the Customers table consist of CustomerID, CustomerName, ContactName, Address, City, PostalCode, and Country. A field is a column in a table that is designed to maintain specific information about every record in the table.
A record, also called a row, is each individual entry that exists in a table. A record is a horizontal entity in a table.
A column is a vertical entity in a table that contains all information associated with a specific field in a table.
A database most often contains one or more tables. Each table is identified by a name (e.g. “Customers” or “Orders”). Tables contain records (rows) with data.
Keep in Mind That…
SQL keywords are NOT case sensitive: select is the same as SELECT
The semicolon after SQL Statements?
Some database systems need a semicolon at the end of each SQL statement.
The semicolon is the standard way to separate each SQL statement in database systems that allow more than one SQL statement to be executed in the same call to the server.