Structured Query Language is known as SQL. You can use SQL to access and modify databases. In 1986, the American National Standards Institute (ANSI) and the International Organization for Standardization (ISO) recognized SQL as a standard.
Because of the growing reliance on data and information, SQL developers are the most in-demand professionals. It's a career path that offers high pay, in-demand work, exposure to cutting-edge technology, and promising career opportunities.
This Pie chart it is depicting that in the coming years SQL will be taking 100% as a programming language.
SQL helps developers, product managers, and business analysts advance their careers. According to job boards, SQL is the most in-demand skill because it is a powerful and simple-to-learn programming language.
Learning SQL does not require any algorithm or programming knowledge; simply understanding the relational database concept will help you identify the logic of the SQL query. SQL is founded on SET Theory.
An average learner should be able to acquire the fundamentals of SQL and begin using SQL databases in roughly two to three weeks.
SQL requires no prerequisites and is simple to learn. It is a query language that is similar to English. As a result, anyone who understands basic English can easily learn and write SQL queries. The good news is that most database engines are SQL code compatible.
Now let us learn a few basic topics of SQL
Data:- A data can be defined as a collection of facts or figures or information which is stored in or used by a computer.
a) Database:- In simple words Data base can be termed as it acts as a storage unit where we store the data, retrieve data, bring data or update the data. Example:- Nowadays we use various e-commerce websites to purchase goods. These websites store the customers' information like name, address, frequent search, preferences, email address, etc
b) Data Base Management System (DBMS):- It is a software system which that helps the user to define the database, create the database, and maintain and control access to the database. In general terms, it is used to manage and organize data in a structured form.
Examples:- MySQL, PostgreSQL, Microsoft Access, SQL Server, FileMaker, Oracle.
c) Data Model:- The term "data model" can be referred to as two distinct but related ideas. Data models are composed of entities, which are the objects or concepts about which we want to collect data, and they become the tables in a database. Example for data model:- Products, vendors, and customers There are 4 types of Data models:-
1. Hierarchical Model:- A hierarchical database model is a data model that organizes data into a tree-like structure. The information is stored as records that are linked to one another. Example:-
2. Network Model:- A network model is a database model that is designed to represent objects and their relationships in a flexible manner.
3. Entity Relational Model:- The Entity-Relationship (ER) model is a graphical representation of the structure of a table as well as the relationships between logically related tables.
4. Relational Model:- The relational model is a logical data structure (data tables, views, and indexes) that is distinct from physical storage structures. Because of this separation, database administrators can manage physical data storage without affecting logical data access. Example:- Excel
5. Relational Database Management System (RDBMS):- A relational database management system is software that is used to store, manage, query, and retrieve data from a relational database (RDBMS). The RDBMS acts as a bridge between users, applications, and the database, as well as providing administrative functions for managing data storage, access, and performance. Looking into the different databases now lets us try to understand and relate how the database is connected with the data.
By looking into the picture let us try to understand how DBMS and RDMS are connected to data to retrieve, modify and store data.
Data is nothing but a collection of information that is stored in one place.DBMS is software that stores data, modify, and retrieve data. DBMS acts as an interlink between the end user and the data where we use languages such as Oracle, Microsoft SQL, etc to get the desired data. In the same way, RDBMS is also software but it stores the data in the form of tables(consisting of rows and columns) in a systematic form which can be easily stored on the end user's desktop.
While writing SQL language we use commands to get the desired data
These commands can be classified under different categories.
1) DDL (Data Definition Language ):- DDL is a collection of SQL commands that are used to create, modify, and delete database structures but not data. A user should access the database through an application, not through these commands. List to commands which come under DDL:-
a)Create:- This command is used to create databases like creating tables, indexes, functions, etc
b)Drop:- This command is used to delete information from the database as well as a database.
c)Alter:- This is used to change the database's structure.
d)Truncate:- This command is used to delete all records permanently even if the auto-commit is 0.
e)Comment:- This command is used to add comments to the data dictionary.
f)Rename:- This command is used to rename the column.
2) DQL(Data Query Language):- This command allows you to extract data from the database in order to perform operations on it. The DQL Command's purpose is to obtain some schema relation based on the query.
a)Select:- This command is used to get all the data from a particular database.
3) DML(Data Manipulation Language):- The SQL commands that deal with the manipulation of data in the database are classified as DML, which includes the majority of SQL statements.
a)Insert:- This command is used to add data inside the table.
b)Update:- This command is used to update the existing data within a database.
c)Delete:- This command is used to delete records from a database.
d)Lock:- This command is used to control table concurrency.
4) DCL (Data Control Language):- DCL includes commands like GRANT and REVOKE that deal with the database system's rights, permissions, and other controls.
a)Grant:- This command is used to give users database access privileges.
b)Revoke:- This command is used to withdraw the access which is given to the users which are given by the grant command.
5) TCL (Transaction Control Language ):- This command deals with the transaction within the database.
a)Commit:- This command can be used to commit the transaction.
b)Rollback:- This command is used to roll back the transaction when we commit any errors.
c)Savepoints:- This command is used to set the savepoint within the transaction.
d)Set Transaction:- This command specifies the transaction's characteristics.
Conclusion:- So at the end of this blog I hope all the readers have got some of the info about SQL.