
For an instructor lead, in-depth look at learning SQL click below.
Welcome fellow data enthusiasts! If you’re here, you’re likely excited about steeping yourself into the world of SQL, a standard language for managing data held in relational database management systems. So, let’s get your journey started!
What is SQL?
The Structured Query Language (SQL) is a standard language for storing, manipulating, and retrieving data in databases. SQL works with different database systems like MySQL, SQL Server, and Oracle. It does a fantastic job in linking data from assorted tables and it’s highly sought-after in the tech industry, hence understanding SQL equates to having a valuable skillset.
Write Your First SQL Statement
Have you installed a working SQL environment? If so, let’s create your first SQL query! SQL statements are used to perform tasks like retrieving data from a database.
1 2 3 4 |
SELECT * FROM Employees |
This SQL statement selects all records from the ‘Employees’ table. ‘SELECT’ is used to select data from a database, and ‘*’ is used to select all columns in a table.
Data Manipulation Language (DML) Statements
DML includes commands like INSERT, UPDATE, DELETE, which help in managing data.
The INSERT Statement
INSERT is used to insert data into a table.
1 2 3 4 |
INSERT INTO Employees VALUES('John', 'Doe', 'Software Engineer') |
This inserts John Doe, a software engineer, into the ‘Employees’ table.
The UPDATE Statement
UPDATE is used to modify existing records in a table.
1 2 3 4 5 |
UPDATE Employees SET designation = 'Senior Software Engineer' WHERE employee_name = 'John Doe' |
This updates the designation of John Doe to ‘Senior Software Engineer’.
The DELETE Statement
DELETE is used to delete existing records in a table.
1 2 3 4 |
DELETE FROM Employees WHERE employee_name = 'John Doe' |
This removes John Doe from the ‘Employees’ table.
Wrap Up
SQL is immensely exciting and loaded with numerous capabilities. At its core, SQL is about asking the right questions and manipulating data to your requirements. You’ve learned the very basics, and we hope these become stepping-stones to master SQL. Happy coding!