Explain ACID properties with examples.

 ACID and Relational Databases

Four crucial properties define relational database transactions: atomicity, consistency, isolation, and durability-typically referred to as ACID. 

  • Atomicity defines all the elements that make up a complete database transaction or none.
  • Consistency defines the rules for maintaining data points in a correct state after a transaction. Isolation keeps the effect of a transaction invisible to others until it is committed, to avoid confusion. 
  • Durability ensures that data changes become permanent once the transaction is committed.

A Relational Database Example

Here is a simple example of two tables that a small firm may use to process product orders. The first table is a customer information table, which means that each entry contains a customer's name, address, shipping and payment information, phone number, and other contact information. Each piece of information (each attribute) is in its column, and each row is assigned a unique ID (a key) in the database. Each entry in the second table-a customer order table-includes the ID of the customer who made the purchase, the product ordered, the quantity, the size, and color are chosen, and so on-but not the client's name or contact information.

The only thing these two tables have in common is the ID column (the key). However, because of the shared field, the relational database may establish a link between the two tables. When the company's order processing application submits an order to the database, the database can go to the customer order table, pull the correct product order information, and use the customer ID from that table to look up the customer's billing and shipping information in the customer info table. The database system can then fetch the proper product, the client will receive the order on schedule, and the firm will be compensated.



Comments

Popular posts from this blog

Suppose that a data warehouse for Big-University consists of the following four dimensions: student, course, semester, and instructor, and two measures count and avg_grade. When at the lowest conceptual level (e.g., for a given student, course, semester, and instructor combination), the avg_grade measure stores the actual course grade of the student. At higher conceptual levels, avg_grade stores the average grade for the given combination. a) Draw a snowflake schema diagram for the data warehouse. b) Starting with the base cuboid [student, course, semester, instructor], what specific OLAP operations (e.g., roll-up from semester to year) should one perform in order to list the average grade of CS courses for each BigUniversity student. c) If each dimension has five levels (including all), such as “student < major < status < university < all”, how many cuboids will this cube contain (including the base and apex cuboids)?

Suppose that a data warehouse consists of the three dimensions time, doctor, and patient, and the two measures count and charge, where a charge is the fee that a doctor charges a patient for a visit. a) Draw a schema diagram for the above data warehouse using one of the schemas. [star, snowflake, fact constellation] b) Starting with the base cuboid [day, doctor, patient], what specific OLAP operations should be performed in order to list the total fee collected by each doctor in 2004? c) To obtain the same list, write an SQL query assuming the data are stored in a relational database with the schema fee (day, month, year, doctor, hospital, patient, count, charge)

Discuss classification or taxonomy of virtualization at different levels.