Skip to main content

Posts

Showing posts from May, 2023

Concurrency Control

What is Concurrency Control? Concurrency Control in Database Management System is a procedure of managing simultaneous operations without conflicting with each other. It ensures that Database transactions are performed concurrently and accurately to produce correct results without violating data integrity of the respective Database. Concurrent access is quite easy if all users are just reading data. There is no way they can interfere with one another. Though for any practical Database, it would have a mix of READ and WRITE operations and hence the concurrency is a challenge. DBMS Concurrency Control is used to address such conflicts, which mostly occur with a multi-user system. Therefore, Concurrency Control is the most important element for proper functioning of a Database Management System where two or more database transactions are executed simultaneously, which require access to the same data. Potential problems of Concurrency Here, are some issues which you will likely to face wh

Web database

Web database The Web-based database management system is one of the essential parts of DBMS and is used to store web application data. A web-based Database management system is used to handle those databases that are having data regarding E-commerce, E-business, blogs, e-mail, and other online applications. While many DBMS sellers are working for providing a proprietary database for connectivity solutions with the Web, the majority of the organizations necessitate a more general way out to prevent them from being tied into a single technology. Here are the lists of some of the most significant necessities for the database integration applications within the Web. These requirements are standards and not fully attainable at present. There is no ranking of orders, and so the requirements are as follows: The ability and right to use valuable corporate data in a fully secured manner. Provides data and vendor's autonomous connectivity that allows freedom of choice in selecting the DBMS f

SQL Injection

SQL Injection The SQL Injection is a code penetration technique that might cause loss to our database. It is one of the most practiced web hacking techniques to place malicious code in SQL statements, via webpage input. SQL injection can be used to manipulate the application's web server by malicious users. SQL injection generally occurs when we ask a user to input their username/userID. Instead of a name or ID, the user gives us an SQL statement that we will unknowingly run on our database. For Example - we create a SELECT statement by adding a variable "demoUserID" to select a string. The variable will be fetched from user input (getRequestString). demoUserI = getrequestString("UserId"); demoSQL = "SELECT * FROM users WHERE UserId =" +demoUserId; Types of SQL injection attacks SQL injections can do more harm other than passing the login algorithms. Some of the SQL injection attacks include: Updating, deleting, and inserting the data: An attack can mo

Schema and Instance in DBMS

Schema and Instance in DBMS 1. Instances : Instances are the collection of information stored at a particular moment. The instances can be changed by certain operations as like addition, deletion of data. It may be noted that any search query will not make any kind of changes in the instances. Example – Let’s say a table teacher in our database whose name is School, suppose the table has 50 records so the instance of the database has 50 records for now and tomorrow we are going to add another fifty records so tomorrow the instance have total 100 records. This is called an instance. 2. Schema : Schema is the overall description of the database. The basic structure of how the data will be stored in the database is called schema. Schema is of three types: Logical Schema, Physical Schema and view Schema. Logical Schema – It describes the database designed at logical level. Physical Schema – It describes the database designed at physical level. View Schema – It defines the design of the

Schedule in DBMS

Schedule A series of operation from one transaction to another transaction is known as schedule. It is used to preserve the order of the operation in each of the individual transaction. 1. Serial Schedule The serial schedule is a type of schedule where one transaction is executed completely before starting another transaction. In the serial schedule, when the first transaction completes its cycle, then the next transaction is executed. For example: Suppose there are two transactions T1 and T2 which have some operations. If it has no interleaving of operations, then there are the following two possible outcomes: Execute all the operations of T1 which was followed by all the operations of T2.  Execute all the operations of T1 which was followed by all the operations of T2.  In the given (a) figure, Schedule A shows the serial schedule where T1 followed by T2. In the given (b) figure, Schedule B shows the serial schedule where T2 followed by T1. 2. Non-serial Schedule If interleaving of

Relational Decomposition

Relational Decomposition When a relation in the relational model is not in appropriate normal form then the decomposition of a relation is required. In a database, it breaks the table into multiple tables. If the relation has no proper decomposition, then it may lead to problems like loss of information. Decomposition is used to eliminate some of the problems of bad design like anomalies, inconsistencies, and redundancy. Types of Decomposition Lossless Decomposition If the information is not lost from the relation that is decomposed, then the decomposition will be lossless.  The lossless decomposition guarantees that the join of relations will result in the same relation as it was decomposed. The relation is said to be lossless decomposition if natural joins of all the decomposition give the original relation. Example: EMPLOYEE_DEPARTMENT table: EMP_ID EMP_NAME EMP_AGE EMP_CITY DEPT_ID DEPT_NAME 22 Denim 28 Mumbai 827 Sales 33 Alina 25 Delhi 438 Marketing 46 Stephan 30 Bangalore 869 Fi

Relational Calculus

Relational Calculus There is an alternate way of formulating queries known as Relational Calculus. Relational calculus is a non-procedural query language. In the non-procedural query language, the user is concerned with the details of how to obtain the end results. The relational calculus tells what to do but never explains how to do. Most commercial relational languages are based on aspects of relational calculus including SQL-QBE and QUEL. Why it is called Relational Calculus? It is based on Predicate calculus, a name derived from branch of symbolic language. A predicate is a truth-valued function with arguments. On substituting values for the arguments, the function result in an expression called a proposition. It can be either true or false. It is a tailored version of a subset of the Predicate Calculus to communicate with the relational database. Many of the calculus expressions involves the use of Quantifiers. There are two types of quantifiers: Universal Quantifiers: The univer