Introduction To SQL
Introduction To SQL
Topperworld.in
INTRODUCTION
• Big enterprises like Facebook, Instagram, and LinkedIn, use SQL for storing
the data in the back-end.
©Topperworld
SQL
❖ Characteristics of SQL
➢ SQL may be utilized by quite a number of users, which include people
with very little programming experience.
➢ SQL is a non-procedural language.
➢ We can without difficulty create and replace databases in SQL. It isn’t a
time-consuming process.
➢ SQL is primarily based totally on ANSI standards.
➢ SQL does now no longer have a continuation individual.
➢ SQL is entered into the SQL buffer on one or more lines.
➢ SQL makes use of a termination individual to execute instructions
immediately. It makes use of features to carry out a few formatting.
➢ It uses functions to perform some formatting.
❖ History of SQL
⚫ "A Relational Model of Data for Large Shared Data Banks" was a paper
which was published by the great computer scientist "E.F. Codd" in 1970.
⚫ The IBM researchers Raymond Boyce and Donald Chamberlin originally
developed the SEQUEL (Structured English Query Language) after
learning from the paper given by E.F. Codd. They both developed the SQL
at the San Jose Research laboratory of IBM Corporation in 1970.
⚫ At the end of the 1970s, relational software Inc. developed their own first
SQL using the concepts of E.F. Codd, Raymond Boyce, and Donald
Chamberlin. This SQL was totally based on RDBMS.
©Topperworld
SQL
❖ Uses of SQL
• Data definition: It is used to define the structure and organization of
the stored data and the relationships among the stored data items.
• Data retrieval: SQL can also be used for data retrieval.
• Data manipulation: If the user wants to add new data, remove data,
or modifying in existing data then SQL provides this facility also.
• Access control: SQL can be used to restrict a user’s ability to retrieve,
add, and modify data, protecting stored data against unauthorized
access.
• Data sharing: SQL is used to coordinate data sharing by concurrent
users, ensuring that changes made by one user do not inadvertently
wipe out changes made at nearly the same time by another user.
❖ SQL Rules
A ‘;’ is used to end SQL statements.
Statements may be split across lines, but keywords may not.
Identifiers, operator names, and literals are separated by one or more
spaces or other delimiters.
A comma (,) separates parameters without a clause.
A space separates a clause.
Reserved words cannot be used as identifiers unless enclosed with
double quotes.
Identifiers can contain up to 30 characters.
Identifiers must start with an alphabetic character.
Characters and date literals must be enclosed within single quotes.
Numeric literals can be represented by simple values.
©Topperworld
SQL
❖ Process of SQL
) Query Dispatcher
) Optimization Engines
©Topperworld
SQL
❖ SQL commands
Developers use structured query language (SQL) commands, which are
specific keywords or SQL statements, to work with data stored in relational
databases. The following are categories for SQL commands.
Command
1. CREATE
Creates a new table, a view of a table, or other object in the database.
2. ALTER
Modifies an existing database object, such as a table
DROP
Deletes an entire table, a view of a table, or other objects in the database.
©Topperworld
SQL
Command
1. SELECT
Retrieves certain records from one or more tables.
2. INSERT
Creates a record.
3. UPDATE
Modifies records.
4. DELETE
Deletes records.
©Topperworld
SQL
Command
1. GRANT
Gives a privilege to the user.
2. REVOKE
Takes back privileges granted by the user.
©Topperworld
SQL
SQL vs No-SQL
SQL No-SQL
2. The query language used in this 2. The query language used in the No-
database system is a structured SQL database systems is a non-
query language. declarative query language.
©Topperworld
SQL
10. Gauges, CircleCI, Hootsuite, 10. Airbnb, Uber, and Kickstarter are the
etc., are the top enterprises that top enterprises that are using this query
are using this query language. language.
❖ Advantages of SQL
SQL provides various advantages which make it more popular in the field of data
science. It is a perfect query language which allows data professionals and users
to communicate with the database.
1. No programming needed
SQL does not require a large number of coding lines for managing the database
systems. We can easily access and maintain the database by using simple SQL
syntactical rules. These simple rules make the SQL user-friendly.
©Topperworld
SQL
A large amount of data is accessed quickly and efficiently from the database by
using SQL queries. Insertion, deletion, and updation operations on data are also
performed in less time.
3. Standardized Language
SQL follows the long-established standards of ISO and ANSI, which offer a
uniform platform across the globe to all its users.
4. Portability
The structured query language can be easily used in desktop computers, laptops,
tablets, and even smartphones. It can also be used with other applications
according to the user's requirements.
5. Interactive language
We can easily learn and understand the SQL language. We can also use this
language for communicating with the database because it is a simple query
language. This language is also used for receiving the answers to complex
queries in a few seconds.
The SQL language also helps in making the multiple views of the database
structure for the different database users.
©Topperworld
SQL
❖ Disadvantages of SQL
With the advantages of SQL, it also has some disadvantages, which are as
follows:
1. Cost
The operation cost of some SQL versions is high. That's why some programmers
cannot use the Structured Query Language.
2. Interface is Complex
The business rules are hidden. So, the data professionals and users who are
using this query language cannot have full database control.
©Topperworld