0% found this document useful (0 votes)
7 views

Dbms 2023

Uploaded by

xalamo5494
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Dbms 2023

Uploaded by

xalamo5494
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Explain Overall Architecture of DBMS in detail. Component Entity-Relationship (ER) Model.

*Presentation Layer: The presentation layer, also known as the user interface layer, is the -it is a high-level conceptual data.
part of the DBMS that is visible to end-users and application programs. It provides a -it specify desired component & relationship among those component.
graphical user interface (GUI) or command line interface (CLI) for users to interact with -it based on data perception in real world that consist set of entity & relationship among
the system. The presentation layer includes forms, screens, reports, and other user those entity.
interface elements that allow users to view and manipulate data. *Entity
*Business Layer: The business layer, also known as the application layer, provides the -they have physical or logical existence.
business logic and rules for processing data in the DBMS. It includes the application -is anything in real world with its physical existence.
programs that access and manipulate data in the database. The business layer also -it may be an object with a physical or logical existence.
includes the middleware that connects the presentation layer to the database layer, -it has its own properties which describes that they known as attributes.
enabling communication and data transfer between the layers. *attributes
*Database Layer: The database layer, also known as the data storage layer, is the lowest -it has own properties which describes that they known as attributes.
layer of the DBMS architecture and deals with the actual storage and retrieval of data. It -attribute value major part of data stored in database .
includes the physical storage devices and database management software that manage -Employee entity may be described by attributes name, age, phone etc.
the data stored in the database. The database layer provides the data persistence and *Relationships
integrity needed to ensure that data is stored and retrieved accurately and reliably. -it is an association among one or more entities.
-Use diamond shape to show relationship.
Database Administrator . -It is recommended to arrange relationship to be read it from left to right or up to down.
*Database Design: -The DBA is responsible for designing the database structure, which
includes defining tables, columns, relationships, constraints, and indexes. Relational Algebra Operation.
*Selection Operation (σ): This operation is used to select a subset of tuples from relation
*Installation and Configuration: -The DBA installs and configures the DBMS software on that meet a specified condition.
servers and client machines. This includes configuring security settings, storage settings, *Projection Operation (π): This operation is used to select specific columns from a
and other system parameters. relation.
*Union Operation (⋃): This operation is used to combine two or more relations into a
*Performance Tuning: -The DBA monitors the system to optimize performance. This single relation. The resulting relation contains all tuples that are present in either of the
includes analyzing performance metrics, identifying performance bottlenecks, and input relations, excluding duplicates.
making changes to the system to improve performance. *Intersection Operator (∩): -The intersection operator returns the tuples that are
common to both input relations.
*Backup and Recovery: -The DBA is responsible for creating backup and recovery plans to *Cartesian Product Operator (×): -The Cartesian product operator combines all possible
ensure that data is not lost due to system failures or disasters. This includes creating pairs of tuples from two or more relations. The resulting relation contains tuples that
backup schedules, testing backup and recovery procedures, and verifying data integrity. have all possible combinations of the attributes from the input relations.
*Join Operation (⨝): This operation is used to combine two or more relations based on a
*Security Management: -The DBA ensure that data is protected from unauthorize access. common attribute or set of attributes. The resulting relation contains tuples that have
This include creating user accounts, assigning roles & permissions, auditing user activity. matching values for the specified attributes in the input relations.
*Difference Operator (-): -difference operator returns the tuples that are present in the
*Maintenance and Upgrades: -The DBA performs routine maintenance tasks, such as first input relation but not in the second input relation.
database defragmentation, index rebuilding, and data archiving. The DBA is also *Rename operation(ρ): -Rename is a unary operation used for renaming attributes of a
responsible for upgrading the DBMS software to new versions or patches. relation. Is is denoted by rho.
Data Definition Language. Explain SQL Arthmetic Function.
-To create database schema and database objects like table Data Definition Language can SQL arithmetic functions are used to perform mathematical operations on numerical data
be used. types such as integers, decimals, and floats. These functions can be used in conjunction
-DDL statements are used to build and modify the structure of your tables and other with SQL queries to calculate values based on data stored in a database.
objects in the databased. *Addition : The addition function is used to add two or more values.
-1. CREATE Statement, 2. ALTER Statement, 3. DROP Statement, 4. RENAME Statement, *Subtraction : The subtraction function is used to subtract two or more values.
5.TRUNCATE Statement. *Multiplication (*): The multiplication function is used to multiply two or more values.
-When you execute DDL statement, it takes effect immediately, it is Auto-committed into *Division (/): The division function is used to divide two or more values.
database. Hence no rollback operation can be performed with these set of commands. *Modulo (%): The modulo function returns the remainder of a division operation.
-Database objects are any data structure created in database. *Power function (POWER): The power function is used to raise a value to a certain power.

Data Manipulation Language. triggered.


-DML statements are used for manipulating or managing data in database. -it is procedure that automatically invoked by the DBMS in response to specific alteration
-DML commands are not auto-committed like DDL statements . to the database or a table in database.
-It means changes done. by DML command can be rolled back. Or in other words the -Triggers are stored in database as a simple database object.
DML statements do not implicitly commit the current transaction. -A database that has a set of associated triggers is called an active database.
-database trigger enables DBA to create additional relationships betn separate databases.
Data Control Language.
-Data Control Language is used to control various user actions (or privileges) in Database. *Components of Trigger (E-C-A Model).
-To perform any operation in the database user needs privileges like creating tables, -Event (E) - SQL statement that causes the trigger to fire. This event may be insert, update
sequences or views. Or delete operation database table.
-commands. -Condition (C) - A condition that must be satisfied for execution of trigger.
Grant: Gives some privilege to user for performing task on database. -Action (A) - This is code or statement that execute when triggering condition is satisfied
Revoke : Take back permissions given from user. and trigger is activated on database table.
-Privileges.
System Privileges : creating a table is types of system privilege. *Trigger syntax.
Object Privileges : To execute query on tables object privilege can be used. CREATE [OR REPLACE] TRIGGER <Trigger_Name>
Ownership Privileges : To execute query on tables created by same user. ]<ENABLE [ DISABLE>]
<BEFORE ] AFTER>
Explain string function. <INSERT ] UPDATE ] DELETE>
In database management systems, there are several string functions that can be used to ON <Table_Name>
manipulate and analyze text data stored in a database. [FOR EACH ROW]
*SUBSTRING(): -function is use to extract substring from a string. It takes three argument. DECLARE
the string to extract from, the starting position of the substring, and the length of the <Vanable_Definitions>;
substring. BEGIN
*CONCAT(): -function is used to concatenate two or more strings together. It takes two or END;
more arguments, each representing a string.
*UPPER(): -function is used to convert all characters in a to uppercase.
*LENGTH(): The LENGTH() function is used to return the length of a string.
Normalization. Users of databased.
-Normalization is a step by step decomposition of complex records into simple records. *Naive users
-it is process of organizing data in database in more efficient form. -interact with the system using application program.
-This process is also called as canonical synthesis. -typical graphical user interface they can fill proper form
-designers may not normalize relation to the highest possible normal form. -read reports generated from the database .
-The relations may be left in a lower form, which may cause some penalties. *Application programmers
-responsible for writing application.
Various Normal Form. -They are developers or computer professional.
*First Normal Form (1NF): -They develop user interfaces using any preferred language.
-this is simple form of normalization. -Rapid Application Development tools construct application without writing code.
-relation is in 1NF is every row contains exactly one value. *Sophisticated users
-A column in a table should contain only indivisible data. -interact with application without writing programs by using a database query language.
*Second Normal Form (2NF) -This query will be solved by query processor.
-tries to remove problem of redundant data introduce by 1NF. -Online Analytical Processing tool used to view data in different ways which help
-relation in 2NF, is in 1NF & all non-key attributes are fully functional dependent on analysts.
primary key. *Specialized users
-there should not be any partial dependency on primary key attribute. -Creates the actual database and implement.
*third normal form -they develop database applications.
-This normal form introduced to minimize the transitive redundancy.
-To remove the data anomalies left in schema after apply 2NF. Compare Various Aggregate function.
*Boyce-Codd Normal Form *COUNT(): -This function returns the number of rows in a table that match a specified
-BCNF is more rigorous form of 3NF. condition. It can be used to count all rows, or only those that meet certain criteria.
-The intention of BCNF is that 3NF does not satisfactorily handle the case of overlapping *SUM(): -This function calculates the sum of a column of numeric values. It can be used
candidate keys. to calculate the total of all values, or only those that meet certain criteria.
-transitivity present in prime attributes of relation may not be removed by 3NF. *AVG(): -This function calculates the average of a column of numeric values. It can be
used to calculate the average of all values, or only those that meet certain criteria.
ACID properties of transaction. *MAX(): -This function returns the highest value in a column. It can be used to find the
*Atomicity: -When one transaction takes place, many operations occur under one maximum value in a table, or only the maximum value that meets certain criteria.
transaction. Atomicity means either all operations will take place property and reflect in *MIN(): -This function returns the lowest value in a column. It can be used to find the
the database or none of them will be reflected. minimum value in a table, or only the minimum value that meets certain criteria.
*Consistency: - Consistency keeps the database consistent. Execution of a transaction *GROUP_CONCAT(): -This function concatenates values from multiple rows into a single
needs to take place in isolation. It helps in reducing complications of executing multiple string, separated by a specified delimiter. It can be used to combine values from multiple
transactions at a time and preserves the consistency of the database. rows into a single column.
*Isolation: -It is necessary to maintain isolation for the transactions. This means one *STDDEV(): -This function calculates the standard deviation of a column of numeric
transaction should not be aware of another transaction getting executed. Also their values. It can be used to measure the spread or variation of a set of values.
intermediate result should be kept hidden. *VARIANCE(): -This function calculates the variance of a column of numeric values. It can
*Durability: -When a transaction gets completed successfully, it is important that the be used to measure how much a set of values varies from the average.
changes made by the transaction should be preserved in database in spite of system
failures.
Log-Based Recovery. Write Short notes on Constraints in sql .
-problem in accessing database due to any reason causes system failure. *NOT NULL Constraint: This constraint ensures that a column in a table cannot have a
-most widely used structure for recording modifications in Transaction log. NULL value. It is used to ensure that a certain column must always have a value.
-Transaction log maintained record during processing. *UNIQUE Constraint: This constraint ensures that the values in a column or set of
-Transaction performs a write operation to record data changes. columns are unique, meaning that no two rows can have the same value.
-Log records useful for recovery from system and disk failures. *PRIMARY KEY Constraint: This constraint ensures that each row in a table is uniquely
* Initial log record identified by a specific column or set of columns. This constraint is used to create a
-To start a transaction initial transaction log is recorded. unique identifier for each row in the table.
-This log indicates that recording log file is started. *FOREIGN KEY Constraint: This constraint ensures that the values in a column or set of
-ex: <T1 start>. columns in one table match the values in a column or set of columns in another table. It
*update log record is used to enforce referential integrity between two tables.
-described single databased write. *CHECK Constraint: This constraint ensures that the values in a column or set of columns
-include value of bytes before and after page change. meet a specific condition. For example, a check constraint can be used to ensure that the
-it modify value v1 to update v2. values in a column are positive numbers.
-Ex: <T1,A,500>.
*completion log record Deadlock.
-transaction completer successfully then commit. In a database management system (DBMS), a deadlock occurs when two or more
-any problem while executing it will abort & rollback. transactions are waiting for each other to release resources, such as locks on database
-it commit or rollback operation. objects, that they need to complete their operations. As a result, none of the transactions
-ex: <T1, commit> <T2, rollback> can proceed, leading to a situation where they are stuck or “deadlocked.”
*checkpoint record *Wait – Die
-record point when checkpoint been made. -It is based on a non-preemptive technique.
-used to speed up recovery. -In this, older transactions must wait for the younger one to release its data items.
-it mark transaction status. -The number of aborts and rollbacks is higher in these techniques.
-ex: <T, checkpoint A> *Wound –Wait
-It is based on a preemptive technique.
functional dependency. -In this, older transactions never wait for younger transactions.
In simple terms, it is a way of describing how one attribute determines or depends on -In this, the number of aborts and rollback is lesser.
another attribute in a table.
-In a functional dependency, the value of one attribute.
-uniquely determines the value of another attribute.
-Functional dependency is often represented using arrow notation.
-Functional dependencies are important in the process of database normalization.
-which is a way of organizing tables to minimize redundancy and improve data integrity.
-there are types including trivial and non-trivial dependencies, full and partial
dependencies, and transitive dependencies.
-By properly identifying and managing functional dependencies, we can ensure that our
databases are well-structured and able to meet the needs of our business or
organization.

You might also like