0% found this document useful (0 votes)
12 views10 pages

Open DB

The document discusses various concepts related to database management, including serial schedules, concurrency control, and the importance of patents. It outlines the need for data integrity through different types of integrity constraints and explains the benefits of stored procedures in MySQL. Additionally, it covers the purpose and types of indexes and constraints to ensure data accuracy and performance in relational databases.

Uploaded by

vishalg220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views10 pages

Open DB

The document discusses various concepts related to database management, including serial schedules, concurrency control, and the importance of patents. It outlines the need for data integrity through different types of integrity constraints and explains the benefits of stored procedures in MySQL. Additionally, it covers the purpose and types of indexes and constraints to ensure data accuracy and performance in relational databases.

Uploaded by

vishalg220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

NAME ASHEESH SUNAR

ROLL NO. 2314503637

SUBJECT 8142 OPEN SOURCE


DB

SEMSTER III

COURSE DCA

Answer of Question 1

Serial Schedule: In a Serial Schedule, exchanges are executed consistently,


guaranteeing that no two exchanges cross-over. This ensures rightness yet
can prompt lacklustre showing, particularly with numerous clients getting to
the data set all the while.

Concurrency Control: This control is a bunch of methods that permit


different exchanges to execute simultaneously while guaranteeing that the
last condition of the data set is comparable to that of a sequential timetable.
This implies the outcomes are reliable and liberated from oddities like lost
refreshes, filthy peruses, and uncertain reliance.

Advantages:

• Expanded Throughput: By permitting various exchanges to


execute simultaneously, simultaneousness control essentially further
develops data set execution and throughput.

• Further developed Reaction Time: Clients experience quicker


reaction times as their exchanges are not obstructed by others.

• Better Asset Usage: Simultaneousness control permits


productive use of data set assets, like computer processor and plate I/O.

Method to manage Concurrency:

• Locking: Locking is a typical strategy to guarantee


information respectability and forestall clashes. Locks are put on
information things (e.g., lines, pages) to confine access by different
exchanges.

a) Shared Lock: Permits different exchanges to peruse yet not


change the information.
b) Exclusive Lock: Permits just a single exchange to change
the information.
• Time stamping: Every exchange is relegated a timestamp.
Simultaneousness control choices depend on the timestamps
of exchanges.

• Optimistic Concurrency Control: Exchanges execute with


practically no locking. At commit time, the framework checks for clashes.
On the off chance that clashes are identified, the exchange is cut short and
restarted.

Answer of Question2

Need of Patent:

• Safeguarding Advancement: Patents give lawful assurance to


creations, empowering advancement and interest in innovative work.

• Restrictive Freedoms: Patent holders have the select right to make,


use, sell, or import their creation for a restricted period.

• Commercialization: Patents empower designers to market their


creations and receive monetary benefits.

• Innovation Move: Patents work with the exchange of innovation


from designers to producers and people in general.

Distinction among Patents and Copyrights:

Feature Patents Copyrights

Subject Inventions Original


Matter (processes, works of
machines, creation
organization (scholarly,
s of issue, melodic,
designs) sensational,
imaginative
works)

Requirement Novelty, Originally


s Non- and fixation
obviousness in a
, usefulness tangible
medium

Protection Legal Protection


Monopoly for the life
to exclude of the
others from author plus
making, 70 year.
using selling
or importing
the
invention
for a limited
time
(usually 20
years.)

Enforcement Though Though


lawsuits for lawsuits for
infringemen infringeme
t. nt or
copyright
notices.

Answer of Question 3:

With regards to Relational Database management system (RDBMS),


honesty alludes to the precision, consistency, and legitimacy of the
information put away inside the data set. It guarantees that the information is
liberated from blunders, irregularities, and infringement of predefined rules.
This is significant for keeping up with the dependability and reliability of
the data set.

Arrangement of Honesty Limitations:

Honesty limitations are decides that authorize explicit information approval


and consistency prerequisites inside the data set. They are fundamental for
keeping up with information honesty and forestalling information
defilement. Here are the essential sorts of respectability imperatives:

1. Domain Honesty:

Definition: This requirement confines the qualities that can be put


away in a specific segment to a particular arrangement of values or
information types.

For Instance:

 A section putting away ages ought to just acknowledge


positive number qualities.
 A segment putting away orientation ought to just
acknowledge values like 'Male', 'Female', or 'Other'.

2. Entity Uprightness:

Definition: This requirement guarantees that each column in a table


has a one of a kind essential key worth. The essential key is a special
identifier for each column in the table.

 Purpose: Forestalls copy columns inside a table, it is


unmistakable to guarantee that each record.
3. Referential Respectability:

Definition: This imperative keeps up with consistency between


related tables. It guarantees that unfamiliar key qualities in a single table
match essential key qualities in another table.

For Instance:

 In the event that a table 'Requests' has an unfamiliar key


referring to the 'Clients' table, the client ID in the 'Orders'
table should exist as an essential key in the 'Clients' table.
 Purpose: Forestalls irregularities and guarantees that
information in related tables is precise and reliable.

4. User-Defined Integrity (UDIs):

Definition: These are custom limitations characterized by the data


set director or clients to uphold explicit business rules or information
approval necessities that go past the standard requirements.

For Instance:

 A standard that guarantees that the amount of an item in


stock is dependably more noteworthy than or equivalent to
nothing.
 A standard that approves the organization of email addresses.

Set 2

Answer of Question 4

PHP Building Blocks: PHP building blocks allude to the principal


components and develops that structure the groundwork of PHP
programming. These include:

• Factors: Used to store information for a brief time, similar to


numbers, text, or clusters.

• Information Types: Various sorts of information upheld by


PHP, like whole numbers, floats, strings, booleans, exhibits, and items.

• Administrators: Images that perform procedure on factors,


like number-crunching administrators (+, - , *,/), examination administrators
(==, !=, >, <), and consistent administrators (AND, OR, NOT).

• Control Designs: Explanations that control the progression of


execution in a PHP script, for example,

a) Conditional Statements:if, else if, else - execute code in light


of specific circumstances.
b) Loops:for, while, do-while, foreach - rehash a block of code
on numerous occasions.
• Capabilities: Reusable blocks of code that play out a particular
undertaking.

• Exhibits: Requested assortments of values.

• Objects: Examples of classes, addressing genuine substances.

Illustration of PHP Prearranging Tackling an Issue:

Suppose we need to make a basic PHP content to work out the factorial of a
given number. This is the way we can make it happen:

PHP

<?php

function factorial($n) {

if ($n == 0) {

return 1;

} else {

return $n * factorial($n - 1);

$number = 5;

$result = factorial($number);

echo "The factorial of " . $number . " is " . $result;

?>

This content characterizes a capability factorial() that recursively works out


the factorial of a number. It then, at that point, takes an information number,
calls the factorial() capability, and presentations the outcome.

Answer of Question 5:

Put away strategies are incredible assets in MySQL that offer a large
number of advantages for data set directors and developers.1 Here's a
breakdown of their key purposes:
1. Modularity and Reusability:

 Encapsulation: Put away methodology exemplify a bunch of


SQL explanations into a solitary, named object.2This
measured quality improves code association and
maintainability.3
 Reusability: When a put away strategy is made, it very well
may be conjured over and over from different applications or
different systems, dispensing with the need to revamp a
similar SQL code various times.4 This recoveries
improvement time as well as diminishes the potential for
mistakes.

2. Performance Upgrade:

 Execution Plan Caching:The information base motor


commonly makes an execution plan for a put away technique
when it is first executed.5This plan, which frames the most
effective method for recovering the information, is then
cached.6 Ensuing calls to a similar strategy can reuse the
stored plan, prompting critical execution enhancements,
particularly for complex inquiries.
 Reduced Organization Traffic: By executing the system on
the server, just the technique call and the outcomes are
communicated over the organization, diminishing how much
information moved contrasted with sending individual SQL
statements.7

3. Data Integrity and Security:

 Enforcing Business Rules:Stored techniques can be utilized


to carry out and implement complex business rules inside the
database.8 For instance, a system may be utilized to approve
information prior to embedding it into a table or to guarantee
that specific requirements are met.
 Fine-grained Admittance Control: You can give explicit
honors to clients on individual put away techniques, taking
into consideration fine-grained command over admittance to
data set objects and data.9 This upgrades security by
confining admittance to delicate information or activities.

4. Data Autonomy:

 Abstraction: Put away methods give a degree of deliberation


between the application and the hidden information base
structure.10 Changes to the data set mapping can frequently
be taken care of inside the put away strategy without
expecting changes to the application code.

5. Improved Efficiency:
 Centralized Rationale: By bringing together business
rationale inside put away techniques, you can improve on
application advancement and decrease the intricacy of
utilization code.11
 Code Practicality: Changes to business rules or information
approval rationale can be effectively refreshed by adjusting
the put away strategy, as opposed to changing the code in
different applications.12

Interaction of Composing a Method with a Model Layout

Here is a bit by bit guide on the most proficient method to make a put away
system in MySQL, alongside a model format:

1. Make a Strategy:

SQL

CREATEPROCEDURE procedure_name(parameter_list)

BEGIN

-- SQL Statements

END;

•procedure_name: The name of the strategy.

•parameter_list: A discretionary rundown of boundaries that the


strategy acknowledges. Boundaries can be of various information types
(e.g., INT, VARCHAR, DATE) and can be characterized as IN
(contribution), OUT (yield), or INOUT (input/yield).

2. Model Layout:

SQL

CREATEPROCEDURE calculate_customer_balance(IN customer_id INT,


OUT balance DECIMAL(10,2))

BEGIN

SELECTSUM(amount) INTO balance

FROM installments

WHERE customer_id = in_customer_id;

END;

This model makes a put away strategy named calculate_customer_balance.


•It takes an IN boundary customer_id to determine the client for
which to work out the equilibrium.

•It likewise has an OUT boundary equilibrium to return the


determined equilibrium.

•The methodology computes the amount of installments for the


given client and stores the outcome yet to be determined result boundary.

3. Call the Strategy:

SQL

CALL calculate_customer_balance(123, @customer_balance);

SELECT@customer_balance;

This code calls the calculate_customer_balance methodology with the client


ID 123. The consequence of the estimation is put away in the client
characterized variable @customer_balance, which can then be gotten to and
utilized in ensuing tasks.

Extra Contemplations:

•Error Handling: It's fundamental to incorporate mistake taking


care of inside your put away systems utilizing IF articulations and the Sign
assertion to effortlessly deal with likely blunders.

•Debugging: MySQL gives instruments like the Investigate


proclamation and the SHOW System STATUS order to help investigate and
investigate put away methodology.

•Security: Consistently follow security best practices while making


and utilizing put away systems, for example, conceding just the essential
honors to clients and trying not to store delicate data inside the actual
methodology.

By really using put away systems, you can altogether improve the
exhibition, viability, and security of your MySQL information base
applications.

•One of a kind Requirement: Guarantees that a particular section or


set of segments has interesting qualities.

•Really take a look at Imperative: Confines the qualities that can be


put away in a section to a particular reach or set of values.

Answer of Question 6:

Indexes
Purpose:

• Accelerating Information Recovery: Indexes are critical for


working on the exhibition of information recovery inquiries. They are
particular information structures that permit the data set to rapidly find
explicit columns in a table without checking the whole table. This is
practically equivalent to the record in a book, which permits you to rapidly
track down unambiguous data.

• Further developing Inquiry Execution: When a question


incorporates a WHERE provision that channels information in view of a
particular segment, the data set can use Indexes to find the significant lines
productively. This altogether lessens the time expected to execute the
question, particularly for enormous tables.

Instance:

Consider a table named Clients with segments like customer_id,


customer_name, city, and so on. On the off chance that you as often as
possible question this table to track down clients in a particular city, making
a record on the city segment will fundamentally accelerate these questions.
The information base can rapidly find the lines with the predefined city
esteem utilizing the record, rather than examining the whole table.

Requirements

Reason:

• Keeping up with Information Respectability: Imperatives are decides


that implement explicit information approval and consistency prerequisites
inside the data set. They assume an imperative part in guaranteeing the
exactness, unwavering quality, and consistency of the information.

• Forestalling Information Defilement: By authorizing requirements,


you can keep invalid information from being embedded or refreshed in the
data set, in this way keeping up with information trustworthiness and
forestalling likely mistakes or irregularities.

Sorts of Requirements and Models:

1. Primary Key Requirement:

Purpose: Guarantees that each line in a table has a special identifier.

Example: In a Clients table, the customer_id segment could be


characterized as the essential key, ensuring that every client has a
remarkable ID.

2. Foreign Key Requirement:


Purpose: Keeps up with consistency between related tables. It
guarantees that unfamiliar key qualities in a single table match essential key
qualities in another table.

Example: In the event that you have an Orders table with a


customer_id section, an unfamiliar key limitation can be characterized to
guarantee that the customer_id in the Orders table exists as an essential key
in the Clients table.

3. Unique Requirement:

Purpose: Guarantees that a particular section or set of segments has


novel qualities.

Example: In a Representatives table, you can characterize an


extraordinary imperative on the employee_id section or on a mix of
first_name and last_name to forestall copy worker Indexes.

4. Check Limitation:

Purpose: Confines the qualities that can be put away in a section to a


particular reach or set of values.

Example: You can characterize a check requirement on the age


segment in a People table to guarantee that the age is somewhere in the
range of 0 and 150.

You might also like