DBMS QP2
DBMS QP2
explain an
example ? in DBMS
COUNT()
SUM()
AVG()
MAX()
MIN()
Example:
It does not store data physically; it just shows data from one or more underlying
tables.
Views are used to simplify complex queries, improve security, and hide specific
data from user
FROM table_name
WHERE condition;
Example:
Employee Table:
FROM Employee
OUTPUT :-
Emp Na Salar
ID me y
2 Bob 60000
Dav
4 70000
e
Q3. Write a sql query to retive the sales_id and total_price from
sales tables from the sales made on Jan 3 2024
Realtion(sales_id,product_in,quantity_Sold,sale_date,total_price)
FROM sales
FROM sales
FROM sales
Result Example:
total_sale
s
125000
FROM sales
GROUP BY sales_id;
Result Example :-
sales_i total_sale
d s
101 30000
102 95000
A transaction is a single logical unit of work that may involve one or more database
operations (like insert, update, delete).
Example: Transferring money from Account A to Account B involves debiting A and
crediting B — both must succeed together.
A stands for Atomicity, which means a transaction must be treated as a single unit.
Either all its operations are completed successfully, or none are applied at all. If any
step fails, the whole transaction is rolled back.
C stands for Consistency, which ensures that the database remains in a valid state
before and after the transaction. All integrity constraints must be preserved.
I stands for Isolation, meaning that concurrent transactions are executed
independently without interfering with each other. The intermediate state of a
transaction must not be visible to others.
D stands for Durability, which guarantees that once a transaction is committed, its
changes are permanently saved in the database, even in case of system failures.
Together, ACID properties maintain the accuracy, safety, and integrity of database
operations.
Q5. Describe Conflict serliazability with an example in DBMS
Conflicting Operations
Example:
T1: Read(A)
T2: Read(A)
T1: Write(A)
T2: Write(A)