Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Introduction to SQL


May 16, 2021 SQL


Table of contents


Introduction to SQL


SQL (Structured Query Language) is the standard database programming language for accessing and operating data in a database.

SQL is the standard language for a relationship database system. A ll relationship database management systems (RDMS), such as MySQL, MS Access, Oracle, Sybase, Informix, Postgres, and SQL Server, use SQL as their standard database language.

In order to handle database and database-related programming, programmers need some media, or interfaces, to detail a set of commands or code to process the database or access the database's data. I n this chapter, you'll briefly describe the terminology you'll learn as you learn SQL.


What do you learn from SQL?


SQL provides unique learning and database processing techniques for structured query languages and will help you better control SQL queries and handle this code effectively. Because SQL helps you include database creation, database or table deletion, access to row data, modification of this data, etc., parallel SQL makes things automatic and smooth, making it easy for end users to access and process the application's data.


What is SQL?


  • SQL is pronounced "sequel".
  • SQL refers to a structured query language, full name being Structured Query Language (originally developed by IBM).
  • SQL is the standard language for a relationship database system.
  • SQL is an ANSI standard computer language.


What can SQL do?


  • SQL can create new databases and their objects (tables, indexes, views, stored procedures, functions, and triggers).
  • SQL can modify the structure of an existing database.
  • SQL can remove (delete) objects from the database.
  • SQL can truNCATE (delete) all records in the table.
  • SQL can comMENT the data dictionary.
  • SQL can be a REME object.
  • SQL can select (retrieve) data from the database.
  • SQL can insert data into a table.
  • SQL can update existing data in a table.
  • SQL can delete records from the database table.
  • SQL can set the user's GRANT and REVOKE permissions in the database.


SQL's history


  • In 1970, SQL was developed by IBM's Donald D. Chamberlin and Raymond F. Boyce.
  • In 1974, the development version was originally called SEQUEL (Structured English Query Language).
  • In 1979, Relationship Software released its first commercial product called System/R.
  • The SEQUEL acronym was later changed to SQL due to trademark conflicts.
  • Later, IBM's System/R-based prototype began developing commercial products on SQL.
  • The first relationship database was released by Real Software and later called Oracle.


SQL is a standard - but...


Although SQL is an ANSI standard computer language, there are still several different versions of SQL languages.

However, in order to be compatible with ANSI standards, they must work together in a similar manner to support some of the major commands (e.g. SELECT, UPDATE, DELETE, INSERT, WHERE, etc.).

Introduction to SQL Note: In addition to SQL standards, most SQL database programs have their own proprietary extensions!

Use SQL in your website


To create a Web site that displays data from the database, you need to:

  • An RDBMS database program (i.e. MS Access, SQL Server, MySQL).
  • Use server-side scripting languages, such as PHP or ASP.
  • Use SQL to get the data you need.
  • Use HTML /CSS to style the page


Rdbms


RDBMS refers to a relational database management system, full named Relational Database Management System.

RDBMS is the foundation of SQL, as well as of all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.

The data in the RDBMS is stored in a database object called a table.

A table is a collection of related data items that consist of columns and rows.

Code example:

SELECT * FROM Customers;

Each table is broken down into smaller entities called fields. T he fields in the Customers table consist of Customer ID, CustomerName, ContactName, Address, City, PostalCode, and County. A field is a column in a table that maintains specific information for each record in the table.

A record, also known as a row, is each individual entry that exists in the table. F or example, there are 91 records in the Customers table above. A record is a horizontal entity in a table.

A column is a vertical entity in a table that contains all the information associated with a specific field in the table.


SQL process


When you execute sql commands on any RDBMS, the system determines the best way to execute the request and the SQL engine determines how to interpret the task.

Various components are included in this process.

Query scheduler optimization engine classic query engine SQL query engine

A typical query engine handles all non-SQL queries, but the SQL query engine does not handle logical files.


SQL standard commands


The standard SQL commands for interacting with a relationship database are create, select, insert, update, delete, and delete, simply divided into the following groups:

DDL (Data Definition Language)

The data definition language is used to change the structure of the database, including creating, changing, and deleting database objects. The data definition language commands used to manipulate the table structure are:

  • CREATE TABLE -- Create (create a new table, table view, or other object in the database)
  • ALTER TABLE -- Change (modify existing database objects, such as tables)
  • DROP TABLE -- Delete (delete views of entire tables, tables, or other objects in the database)

DML (Data Manipulation Language)

Data manipulation languages are used to retrieve, insert, and modify data, and data manipulation languages are the most common SQL commands.

Data manipulation language commands include:

  • INSERT -- Insert (Create a record)
  • DELETE -- Delete (Delete Record)
  • UPDATE -- Modify (modify records)
  • SELECT -- Retrieval (retrieving certain records from one or more tables)

DCL (Data Control Language)

The data control language provides the user with permission control commands.

The commands for permission control are:

  • GRANT -- Grant permissions
  • REVOKE -- Revoke the permissions that have been granted


SQL formatting


Use sql formatting tools to see what you want more intuitively

Introduction to SQL


Chapter test


Now that you know the basics of SQL, take a test!

SQL Microseedle - Database Introduction: Click here to test

For more questions, please refer to: SQL Quiz Library