In: Computer Science
What are CRUD method types and why are they important? Identify CRUD method types and discuss their applications in a real-life scenario. Be sure to include at least one example for each method type.
ANSWER:
CRUD is an acronym that comes from the world of computer programming and refers to four methods that are considered necessary to implement a persistent storage application: create, read, update, and delete.
The CRUD defines all the basic functionality inherent in relational databases and the applications used to manage them, including Oracle Database, Microsoft SQL Server, MySQL and others.
CRUD method types-
1) Create
The create function allows users to create a new record in the
database. In a relational SQL database application, the
Create function is called INSERT. In Oracle HCM Cloud, this is
called create. Remember that a record is a row and columns
are called attributes. The user can create a new row and populate
it with data corresponding to each attribute, but only the
administrator can add new attributes to the table itself.
2) Read
The read function is similar to the search
function. This allows users to search and retrieve
specific records in a table and read their values. Users can find
the records they want using keywords or by filtering data based on
customized criteria. For example, a car database might
allow users to enter "1996 Toyota Corolla" or it might provide
options to filter search results by make, model, and
year.
3) Update
The update function is used to modify existing records in the database. To completely change a record, users may need to change information in several fields. For example, a restaurant that stores recipes for menu items in a database might have a table whose attributes are dish, cooking time, cost, and price. One day the chef decides to replace an ingredient in a dish with something else. As a result, you need to modify the existing record in the database and change all the attribute values to reflect the characteristics of the new dish. In both SQL and Oracle HCM Cloud, the update function is simply referred to as Update.
4) Delete
The delete function allows users to delete records from the database that are no longer needed. Both SQL and Oracle HCM Cloud have a delete feature that allows users to delete one or more records from the database. Some relational database applications may allow users to perform hard or soft deletes. A hard delete will permanently delete records from the database, while a soft delete can simply update the status of a row to indicate that it has been deleted, leaving the data unchanged.
Real life example:
When a new employee is hired, someone new is added to the payroll, or the company acquires a new location, the HR department creates a record to reflect the change. If a business needs to send an email to one or more employees, you can use the Read function to find the correct mailing address for the employee. If an employee's salary or contact information changes, HR may need to update the existing record to reflect the change.
If an employee leaves the company, the company can choose to softly or hard delete their information in the database. In this case, soft deletion may be appropriate because the organization wishes to preserve the person's data without cluttering up future searches or filtered results.
If you are satisfied by my answer please give a thumbs up. THANK YOU.