SQL is used in all relational databases such as MySQL, Oracle, MSSQL, PostgreSQL etc. Learn the basics of SQL, the standard language for managing relational databases.
A database is an organized collection of data.
In general, there are two common types of databases:
In a non-relational database, data is stored in key-value pairs. For example:
Example: Data stored in non-relational database
Here, customers' data are stored in key-value pairs.
Commonly used non-relational database management systems (Non-RDBMS) are MongoDB, Amazon DynamoDB, Redis, etc.
In a relational database, data is stored in tabular format. For example,
Example: Relational Database
Here, customers is a table inside the database.
The first row is the attributes of the table. Each row after that contains the data of a customer.
In a relational database, two or more tables may be related to each other. Hence the term "Relational". For example,
Example: Relational Database
Here, orders and customers are related through customer_id
.
Commonly used relational database management systems (RDBMS) are MySQL, PostgreSQL, MSSQL, Oracle etc.
Note: To access data from these relational databases, SQL (Structured Query Language) is used.
Structured Query Language (SQL) is a standard query language that is used to work with relational databases.
We use SQL to
Let's take a look at an example,
SELECT first_name, last_name FROM Customers;
Here, this SQL command selects the first name and last name of all customers from the customers table.
Example: SQL SELECT Statement
SQL is used in all relational databases such as MySQL, Oracle, MSSQL, PostgreSQL etc.
Note: The major SQL commands are similar in all relational databases. However, in some cases, SQL commands may differ.
#sql #database