SQL is an abbreviation for Standard Query Language. It is a programming language that is used to manage and work with data in databases.
Sql is a very important tool as it is used in all types of industries be it Banks, Hospitals, Schools, Mpesa. All these have databases that work behind the scenes
DBMS stands for a Database Management System which is a software used to create, manage and interact with database e.g Postgresql which i use in my class projects. We also have others like Mysql, IBM DB2,Mongo db e.t.c, There are two types of DBMS
Relational Database Management Systems
They store data in structured tables(rows&columns connected using
relationships(Dimension,fact tables).
-Non-Relational Database Management Systems
They store data in files like .json,.xml,.They are in flexible formats instead of fixed formatsKey Concepts in SQL
Data Query Language
It is used to retrieve data from database. Most common is select, where(filter),Order by(sort),Group by(group data).The main essence of DQL is that it does not change data but it gives information about data.Data Manipulation Language
It is used to change data inside a database. It includes
Insert Statement for inputting data. e.g code snippet below shows how to inserts students data in the students table.
- Update Statement It changes existing data into a database e.g The pic shows an update statement that enters correct marks for result_id=5
- Delete Statement It is used to remove or drop data from database e.g you can be told that exam result with result_id 9 has been cancelled by the school. Write a DELETE statement to remove it from the exam_results table. This is how you shall implement the delete statement
- Data Definition Language It is used to change the structure of a table. We have create statement to create table, alter is used to modify structure of database/Rename column/table, drop is used to delete database. A code snippet of how to delete a column is shown below. It drops the column city in the customers table.
- Data Control language It is used to control access to database. It focuses mainly on Security and access control where we have the grant which gives permission and revoke which removes permission.
Key point to note is that Data Query Language is used mainly by Data Analysts. Data Manipulation Language and Data definition Language are used by Data Engineers while Data Administrators use
Data Control Language.




Top comments (0)