In the world of technology, databases are used everyday to store and access data. SQL stands for Structured Query Language. SQL is the fundamental language used to communicate with databases and is the standard language for relational database management systems. Through SQL queries, data is “created”, “read”, “updated” and “deleted” (CRUD).
CRUD in SQL are the four basic functions used for data storage. SQL methods are used to ‘create’ tables of data for future access. Tables are broken down into columns (vertical) and rows (horizontal). Columns will hold the specific column-name and the rows will consist of values of the specific columns. In this article, we will review the basics on how to ‘CRUD’ in SQL language by retrieving/changing/manipulating data in any database table.
Follow these four SQL methods in order to access and manipulate data in database tables:
Create:
Read:
‘SELECT’ is used when querying a database to ‘read’ specific data.
Update:
The first type of update we will review is the option to update a table with a new row of data by using the ‘INSERT INTO’ method.
The second type of update is updating an already existing row of data in the table.
Delete:
Deleting Records
In order to delete records(rows) from a table, run the “DELETE” method. This will delete the entire row of data where the condition meets true.
Another option of delete is to “DROP”. Running a “DROP” with a specified table_name will delete the entire table.
Now you are ready to create, change and access database tables! The methods reviewed are few of the many fascinating functions of the SQL language and are used in everyday database queries. There are more advanced query methods; with the knowledge and understanding of the listed CRUD methods above, challenge yourself to learn more!
Sources: