SQL is a database language. It stands for Structured Query Language. Database lang is used to control the behavior of database software or in other words, it is medium of storing data in the DB (Database) software.
We can store, update, manipulate, and retrieve data from the database with the help of SQL (universal database language).
It is used by integrating with PHP to dynamically work with it. If you want to learn PHP then it is important that you first learn SQL with any RDBMS program.
Instructions of code are known statements in JavaScript but in SQL these are considered Query.
This DB language only controls the type of software that belongs to the RDBMS program.
Types of Database Management Software
There are two types of database software which are:-
- RDBMS program
- Non-RDBMS program
Relational database management system (RDBMS program)
let's know about the RDBMS program. Basically, RDBMS stands for Relational Database Management System. SQL is a universal language to control the RDBMS program.
This type of programs stores the data into software as a table (rows and columns) format. Example-
S.N. | S_Name | Fathers_name | Mothers_name | Class | Roll_no | Fee |
---|---|---|---|---|---|---|
1. | Anuj | Mr. ABC | Ms. XYZ | IV | 5 | 20,000 |
2. | Ravina | Mr. XYZ | Ms. ABC | III | 9 | 15,000 |
3. | Ravi | Mr. ABC | Ms. XYZ | V | 3 | 25,000 |
4. | Ram | Mr. XYZ | Ms. ABC | III | 21 | 15,000 |
We can retrieve table data by writing a SQL query. For example:- SELECT * FROM table;
Where asterisk (*) indicates all columns and the table name in the place of 'table'. You will learn more about the SQL select query here.
Some RDBMS programs list are as following~
- MySQL
- Oracle
- Microsoft SQL Server
- DB2
- MS Access
- PostgreSQL
- Teradata
- MariaDB
- IBM DB2
MySQL is what we will use to learn SQL.
Means, we learn SQL for the purpose of controlling and storing data in these above-listed RDBMS programs.
None relational database management system
Opposite of this, None RDBMS programs stores the data as key-value pair (stores only one data) or JSON format (stores multiple data). Some of the N-RDBMS programs are listed below:
- IndexedDB
- MongoDB
- MemCacheDB
- Redis
There is no use of SQL to work on these.
We can divide RDBMS solutions into two parts on the basis of their characteristics ~
- light-weight and
- centralized
Light-weight databases
Light-weight database solutions are easy to manage and these are suitable for one user or a small number of users. You don't need a server to install them. If multiple users make edits simultaneously then they may break down.
SQLite and MS Access are good examples of it. These databases can be found in car systems, smartphones, satellites, etc.
Centralized databases
Centralized databases are used in a multi-user environment. They can handle hundreds and thousands of users at the same time. You need a server to work on a centralized database.
MySQL, MS SQL server, Oracle, PostgreSQL, Teradata, etc. are examples of centralized database.
Rules for creating database name, table name or column name
- Name can only contain
_
(underscore) or written in a single word. - Hyphens, spaces, etc. are not allowed to give a name for a database or table.
Database Name | Right-Wrong |
---|---|
jaischool | ✔️ |
jai-school | ❌ |
jai_school | ✔️ |
jai school | ❌ |
Basically, the code of the SQL is written in capital letters so that it can be uniquely identified by you. You are also free to code in small letters. Every query must be terminated by a semicolon.
MySQL Database Management System
However, we will learn SQL here with MySql so it is necessary to know about this database. MySQL is free to use and open source. It is a widely used database.
You need to install and set up it on the server. It is used by some big companies like Google, Facebook, Twitter, eBay, etc.
Now, you may be confused about the term "PhpMyAdmin". Because you may see this after installing MySql.
PhpMyAdmin only takes the MySQL database and wraps a user interface (UI) around it. It is not directly related to MySQL.
Conclusion»
Firstly, We knew that SQL is used to perform tasks with data like storing, updating, and retrieving it from the database. And then, we discussed RDBMS and N-RDBMS. In concise words, RDBMS stores data in table format and N-RDBMS stores in key-value pair or JSON format. SQL will control only those databases who are RDBMS. The light-weight databases are suitable for single or a few users but centralized databases can are efficient enough to handle thousands of users at the same time.
Publish A Comment