100% found this document useful (1 vote)
19 views22 pages

Control Unit and RISC Architecture Overview

The document discusses various components of computer architecture, including the Control Unit, Arithmetic Logic Unit (ALU), and different types of registers. It also explains the concept of Reduced Instruction Set Architecture (RISC) and details the instruction cycle of the 8086 microprocessor, including data movement and arithmetic instructions. Additionally, it covers logic gates, encoders, decoders, and multiplexers, highlighting their functions and applications in digital electronics.

Uploaded by

be nitesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
19 views22 pages

Control Unit and RISC Architecture Overview

The document discusses various components of computer architecture, including the Control Unit, Arithmetic Logic Unit (ALU), and different types of registers. It also explains the concept of Reduced Instruction Set Architecture (RISC) and details the instruction cycle of the 8086 microprocessor, including data movement and arithmetic instructions. Additionally, it covers logic gates, encoders, decoders, and multiplexers, highlighting their functions and applications in digital electronics.

Uploaded by

be nitesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Control Unit – Von Neumann architecture.

John von Neumann Reduced Instruction Set Architecture (RISC)


A control unit (CU) handles all processor control invented the processor architecture which stores a The main idea behind this is to simplify hardware
signals. It directs all input and output flow, fetches program in memory as instructions and executes by using an instruction set composed of a few basic
code for instructions, and controls how data moves them sequentially using the ALU, control unit and steps for loading, evaluating, and storing
around the system. registers. This is known as the stored program operations just like a load command will load data,
Arithmetic and Logic Unit (ALU) – concept. is the design upon which many general a store command will store the data.
The arithmetic logic unit is that part of the CPU purpose computers. are based Characteristics of RISC
that handles all the calculations the CPU may need, Simpler instruction, hence simple instruction
e.g. Addition, Subtraction, Comparisons. It A half adder is a digital logic circuit that performs decoding.
performs Logical Operations, Bit Shifting binary addition of two single-bit binary numbers. It Instruction comes undersize of one word.
Operations, and Arithmetic operations. has two inputs, A and B, and two outputs, SUM Instruction takes a single clock cycle to get
Registers – Registers refer to high-speed storage and CARRY. The SUM output is the least significant executed.
areas in the CPU. The data processed by the CPU bit (LSB) of the result, while the CARRY output is More general-purpose registers.
are fetched from the registers. There are different the most significant bit (MSB) of the result, Simple Addressing Modes.
types of registers used in architecture :- indicating whether there was a carry-over from the Fewer Data types.
Accumulator: Stores the results of calculations addition of the two inputs. The half adder can be A pipeline can be achieved.
made by ALU. It holds the intermediate of implemented using basic gates such as XOR and
arithmetic and logical [Link] act as a AND gates Buses – Data is transmitted from one part of a
temporary storage location or device. computer to another, connecting all major internal
Program Counter (PC): Keeps track of the memory Full Adder is the adder that adds three inputs and components to the CPU and memory, by the
location of the next instructions to be dealt with. produces two outputs. The first two inputs are A means of Buses. Types:
The PC then passes this next address to the and B and the third input is an input carry as C-IN. Data Bus: It carries data among the memory unit,
Memory Address Register (MAR). The output carry is designated as C-OUT and the the I/O devices, and the processor.
Memory Address Register (MAR): It stores the normal output is designated as S which is SUM. The Address Bus: It carries the address of data (not the
memory locations of instructions that need to be C-OUT is also known as the majority 1’s detector, actual data) between memory and processor.
fetched from memory or stored in memory. whose output goes high when more than one input Control Bus: It carries control commands from the
Memory Data Register (MDR): It stores is high. A full adder logic is designed in such a CPU (and status signals from other devices) in
instructions fetched from memory or any data that manner that can take eight inputs together to order to control and coordinate all the activities
is to be transferred to, and stored in, memory. create a byte-wide adder and cascade the carry bit within the computer
Current Instruction Register (CIR): It stores the from one adder to another. we use a full adder
most recently fetched instructions while it is because when a carry-in bit is available, another 1-
waiting to be coded and executed. bit adder must be used since a 1-bit half-adder
Instruction Buffer Register (IBR): The instruction does not take a carry-in bit. A 1-bit full adder adds
that is not to be executed immediately is placed in three operands and generates 2-bit results.
the instruction buffer register IBR.
.

D flip-flop is a slight modification of clocked It is one kind of sequential logic circuit which Pipeline processing can occur not only in the data
SR flip-flop. D flip flop is an electronic devices that stores binary information in bitwise manner. It stream but in the instruction stream as well.
is known as “delay flip flop” or “data flip flop” consists of two inputs and two outputs. Inputs are Most of the digital computers with complex
which is used to store single bit of data.D flip flops Set(J) & Reset(K) and their corresponding outputs instructions require instruction pipeline to carry
are synchronous or asynchronous. The clock single are Q and Q’. JK flipflop has two modes of out operations like fetch, decode and execute
required for the synchronous version of D flip flops operation which are synchronous mode and instructions.
but not for the asynchronous [Link] D flip flop asynchronous mode. In synchronous mode, the In general, the computer needs to process each
has two inputs, data and clock input which state will be changed with the clock(clk) signal, and instruction with the following sequence of steps.
controls the flip flop. when clock input is high, the in asynchronous mode, the change of state is Fetch instruction from memory.
data is transferred to the output of the flip flop and independent from its clock signal. Let’s see its Decode the instruction.
when the clock input is low, the output of the flip diagram structure. Calculate the effective address.
flop is held in its previous state. Fetch the operands from memory.
Execute the instruction.
Store the result in the proper place.

The term Pipelining refers to a technique of An encoder is a combinational circuit that


decomposing a sequential process into sub- converts binary information in the form of a
operations, with each sub-operation being 2N input lines into N output lines, which represent
executed in a dedicated segment that operates N bit code for the input. For simple encoders, it is
assumed that only one input line is active at a time.
concurrently with all other segments.
As an example, let’s consider Octal to
The most important characteristic of a pipeline
Binary encoder. As shown in the following figure,
technique is that several computations can be an octal-to-binary encoder takes 8 input lines and
in progress in distinct segments at the same generates 3 output lines.
time. The overlapping of computation is made
possible by associating a register with each A decoder does the opposite job of an encoder. It
segment in the pipeline. The registers provide is a combinational circuit that converts n lines of
isolation between each segment so that each input into 2n lines of output.
can operate on distinct data simultaneously
c) Write simple near procedure in 8086 assembly Write a program in 8086 assembly language to The 8086 microprocessor has a rich instruction
language that receives one parameter value in AL convert a two digit unpacked BCD number into set, but here are some of the main instructions:
registerfrom the main module and returns sign bit equivalent ASCII digits and a packed BCD number.
of the input parameter. Make suitable The packed BCD number is to be stored in BH 1. Data Transfer Instructions:
assumptions, if any. register. Your program should print the two ASCII - MOV: Move data from source to
Ans: digits. You may assume that the unpacked BCD destination.
; parameter is passed in register AL numbers are in the AL and BL registers - XCHG: Exchange the contents of two
registers or a register and a memory location.
.model small ;1 DS & 1 CS Ans:
- PUSH and POP: Push data onto the stack
.data ;Data Segment ;Unpacked BCD to ASCII & Packed BCD
or pop data from the stack.
msg db 'Sign bit returned is :$' .model small - LEA: Load effective address.
.code .data
start: msg db 10,13,'Two ASCII Digits are ' 2. Arithmetic Instructions:
mov ax, @data asci1 db 30h,' and ' - ADD, SUB, INC, DEC: Addition,
mov ds, ax ;initialize DS with Data Segment Base asci2 db 30h, '$' subtraction, increment, and decrement.
mov al,80h ;Parameter to be passed to subroutine .code segment - MUL and DIV: Multiply and divide
call checks ;call subroutine start: (unsigned).
lea dx, msg mov ax, @data ;Initializing data Segment register - IMUL and IDIV: Multiply and divide
mov ah, 9 mov ds, ax (signed).
int 21h ;display message mov al, 2 ;1st Unpacked BCD numbeber
mov dl, bl ;sign bit to ascii 3. Logical Instructions:
add dl, 30h - AND, OR, XOR: Bitwise logical AND, OR,
mov ah, 2 and XOR.
int 21h ;display sign - NOT: Bitwise logical NOT.
- TEST: Bitwise logical AND without
mov ah, 4ch ;exit to operating system.
changing operands.
int 21h
proc checks 4. Control Transfer Instructions:
rcl al, 1 ;sign bit to carry - JMP: Unconditional jump.
jc ngtv ; if carry negative - Jxx: Conditional jump based on flags (JE,
mov bl, 0 ;positive return 0 JZ, JNE, JNZ, etc.).
ret - CALL: Subroutine call.
ngtv: - RET: Return from subroutine.
mov bl, 1 ;negative return 1 - INT: Software interrupt.
ret - NOP: No operation.
endp checkp ;end of procedure
end start ;stop the assembler. 5. String Instructions:
Output: - MOVS: Move string.
Sign bit returned is :1 - CMPS: Compare strings.
- LODS: Load string.
- STOS: Store string.

6. Flag Control Instructions:


- CLC, STC: Clear and set carry flag.
- CLI, STI: Clear and set interrupt flag.
- CLD, STD: Clear and set direction flag.

7. Input/Output Instructions:
- IN: Input from port.
- OUT: Output to port.

8. Miscellaneous Instructions:
- HLT: Halt processor.
- WAIT: Wait for external signal.
- ESC: Escape to external coprocessor

A logic gate is an electronic circuit designed by NOT Gate In digital electronics, the NAND gate is another
using electronic components like diodes, In digital electronics, the NOT gate is another basic type of universal logic gate used to perform logical
transistors, resistors, and more. As the name logic gate used to perform compliment of an operations. The NAND gate performs the inverted
implies, a logic gate is designed to perform logical input signal applied to it. It takes only one input operation of the AND gate. Similar to NOR gate,
operations in digital systems like computers, and one output. The output of the NOT gate is the NAND gate can also have two or more input
communication systems, etcIn digital electronics, complement of the input applied to it. Therefore, if lines but only one output line.
we apply a low or logic 0 output to the NOT gate is The NAND gate is also represented as a
the AND gate is one of the basic logic gate that gives a high or logic 1 output and vice-versa. The combination of two basic logic gates namely, AND
performs the logical multiplication of inputs NOT gate is also known as inverter, as it performs gate and NOT gate. Hence, it can be expressed as
applied to it. It generates a high or logic 1 output, the inversion operation. NAND Gate = AND Gate + NOT Gate
only when all the inputs applied to it are high or
logic 1. Otherwise, the output of the AND gate is The NOR gate is a type of universal logic gate that
low or logic 0. can take two or more inputs but one output. It is
basically a combination of two basic logic gates i.e.,
In digital electronics, there is a type of basic logic OR gate and NOT gate. Thus, it can be expressed
gate which produces a low or logic 0 output only as,
when its all inputs are low or logic 0. For all other NOR Gate = OR Gate + NOT Gate
input combinations, the output of the OR gate is
high or logic 1. This logic gate is termed as OR gate.
An OR gate can be designed to have two or more
inputs but only one output. The primary function
of the OR gate is to perform the logical sum
operation.
XOR Gate A half adder is a digital logic circuit that performs
In digital electronics, there is a specially designed binary addition of two single-bit binary numbers. It
logic gate named, XOR gate, which is used in digital has two inputs, A and B, and two outputs, SUM
circuits to perform modulo sum. It is also and CARRY. The SUM output is the least significant
referred to as Exclusive OR gate or Ex-OR bit (LSB) of the result, while the CARRY output is
gate. The XOR gate can take only two inputs at a the most significant bit (MSB) of the result,
time and give an output. The output of the XOR indicating whether there was a carry-over from the
gate is high or logic 1 only when its two inputs are addition of the two inputs. The half adder can be
dissimilar. implemented using basic gates such as XOR and
AND [Link], here’s a more in-depthexplanation
of the half adder circuit:The half adder is a basic
building block for more complex adder circuits
such as full adders and multiple-bit adders. It
performs binary addition of two single-bit inputs, A
and B, and provides two outputs, SUM and CARRY.

A Decoder can be described as a An encoder can also be described as a A Multiplexer (MUX) can be described as a
combinational circuit that converts binary combinational circuit that performs the inverse combinational circuit that receives binary
information from the 'n' coded inputs to a operation of a decoder. An encoder has a information from one of the 2^n input data
maximum of 2^n different outputs. The most maximum of 2^n (or less) input lines and n lines and directs it to a single output line.
preferred or commonly used decoders are n- output lines. The selection of a particular input data line for
to-m decoders, where m<= 2^n. In an Encoder, the output lines generate the the output is decided on the basis of selection
An n-to-m decoder has n inputs and m outputs binary code corresponding to the input value. lines.
and is also referred to as an n * m decoder. The following image shows the block diagram The multiplexer is often called as data selector
The following image shows a 3-to-8 line of a 4 * 2 encoder with four input and two since it selects only one of many data inputs.
decoder with three input variables which are output lines. Out of these four input data lines, a particular
decoded into eight output, each output The most common application of an encoder is input data line will be connected to the output
representing one of the combinations of the the Octal-to-Binary encoder. Octal to binary based on the combination of inputs present at
three binary input variables. encoder takes eight input lines and generates these two selection lines.
three output lines.
Certainly! The 8086 microprocessor boasts a The instruction cycle, also known as the fetch-
versatile instruction set that covers various decode-execute cycle, is a fundamental process
operations. Let’s explore some key instructions: performed by a central processing unit (CPU) to
Data Movement Instructions: execute instructions. Let’s break it down into its
MOV: Transfers data from a source to a main stages:
destination. Fetch: The CPU retrieves the next instruction from
XCHG: Swaps the contents of two registers or a memory. Typically, the instruction resides at the
register and a memory location. address specified by the program counter (PC).
PUSH: Pushes data onto the stack. After fetching, the PC is incremented to point to
POP: Pops data from the stack. the next instruction.
LEA: Loads the effective address (memory operand Decode: During this stage, the CPU interprets the
address) into a register. fetched instruction. It identifies
Arithmetic Instructions: the opcode (operation code) and any necessary
ADD, SUB, ADC, SBB: Perform addition, operands.
subtraction, and carry/borrow operations. Execute: The CPU performs the actual operation
INC, DEC: Increment and decrement. specified by the instruction. This may involve
MUL, IMUL, DIV, IDIV: Handle multiplication and reading/writing data from/to memory,
division (both unsigned and signed). arithmetic/logic operations, or control flow
Logic Instructions: manipulation.
AND, OR, XOR, NOT: Perform bitwise logical Additional steps may include:
operations. Fetch operands: Some CPUs fetch operands
TEST: Computes a bitwise AND, modifying flags separately before execution.
without changing operands. Store results: In certain CPUs, results are stored
SHL, SHR, SAL, SAR: Shift left/right (logical and after execution.
arithmetic). Interrupt handling: When an external event
ROL, ROR, RCL, RCR: Rotate left/right (with carry). occurs, the CPU suspends the current instruction
Control Transfer Instructions: to handle the interrupt.
JMP: Absolute jump to a specified address.
JC, JNC, JZ, JNZ, JS, JNS, JO, JNO: Conditional
branching based on flags.
CALL: Calls a subroutine.
RET: Returns from a subroutine.
INT: Triggers a software interrupt.
IRET: Handles interrupt return.
String Instructions:
MOVSB, MOVSW: Transfer bytes or words during
string manipulation.
CMPSB, CMPSW: Compare byte or word string
operands.
SCASB, SCASW: Scan byte or word string operands.
LODSB, LODSW: Retrieve a byte or word from
memory into the accumulator.
Web 2.0 refers to a second generation of the Web 1.0 refers to the first generation of the XHTML stands for EXtensible HyperText Markup
World Wide Web that emphasizes user- World Wide Web that was characterized Language. It is a stricter, more XML-based version of
generated content, ease of use, participatory by static web pages with limited interactivity HTML123. XHTML is almost identical to HTML but it is
culture, and interoperability for end users1. The and user participation123. It was designed to help stricter than HTML4. XHTML is HTML defined as an
XML application1. It is supported by all major
term was coined by Darcy DiNucci in 1999 and people better find information and was
browsers1. The transition from HTML to XHTML was
later popularized by Tim O’Reilly and Dale dedicated to users searching for data1. This web
made to make HTML more extensible and flexible to
Dougherty at the first Web 2.0 Conference in version is sometimes called the "read-only Web" work with other data formats (such as XML)1. In
20041. Web 2.0 websites allow users to interact because it lacks the necessary forms, visuals, addition, XHTML comes with a much stricter error
and collaborate with each other through social controls, and interactivity we enjoy on today’s handling1. Here are some of the differences between
media dialogue as creators of user-generated Interne XHTML and HTML:
content in a virtual community1. Examples of <!DOCTYPE> is mandatory
Web 2.0 features include social networking sites To load a database driver in JSP, you need to add The xmlns attribute in <html> is mandatory
or social media sites (e.g., Facebook), blogs, the driver to your project’s classpath. You can <html>, <head>, <title>, and <body> are mandatory
wikis, folksonomies ("tagging" keywords on place the driver jar file inside the WEB-INF/lib Elements must always be properly nested
websites and links), video sharing sites (e.g., folder of your project or under Elements must always be closed
CATALINA_HOME/lib to make it available for all Elements must always be in lowercase
YouTube), image sharing sites (e.g., Flickr),
Attribute names must always be in lowercase
hosted services, Web applications ("apps"), your applications where CATALINA_HOME is an
Attribute values must always be quoted
collaborative consumption platforms, and environment variable pointing to the root of
Attribute minimization is forbidden
mashup applications1. The transition from static your Tomcat installation1. Once the driver is
HTML Web pages to a more dynamic Web that added to the classpath, you can use
is more organized and is based on serving Web the [Link]() method to load the
applications to users is the hallmark of Web 2.02. driver class.
The HTML tag is the root element of an HTML HTML5 provides a variety of input types that can be HTML forms are used to collect data from users.
document and is used to define the document used to collect data from users. Here are five of the Here are five of the most commonly used form
type and language1. It is the container for all most commonly used input types: elements in HTML:
other HTML elements (except for the Text input: This is the most common input type <input>: This is the most common form element
<!DOCTYPE> tag) and represents the root of an and is used to collect text data from users. It can be and is used to collect text data from users. It can be
used for things like names, addresses, and used for things like names, addresses, and
HTML document1. The <html> tag is mandatory
comments. comments.
and should be the first tag in any HTML
Radio buttons: Radio buttons are used when you <label>: Labels are used to provide a description
document1. Here is an example of a simple HTML
want the user to select one option from a list of for form elements. They are often used for things
document:
options. They are often used for things like gender like radio buttons or checkboxes.
HTML is a markup language that is used to create
selection or yes/no questions. <select>: Selects are used when you want the user
web pages. The basic structure of an HTML
Checkboxes: Checkboxes are used when you want to select one option from a list of options. They are
document consists of the following tags:
the user to select one or more options from a list of often used for things like selecting a country or
<!DOCTYPE html>: This tag specifies the document
options. They are often used for things like selecting state.
type and version of HTML being used.
<html>: This tag is the container for all other HTML
multiple items from a list. <textarea>: Textareas are used when you want the
elements. Dropdown menus: Dropdown menus are used user to enter a large amount of text. They are often
<head>: This tag contains meta information about when you want the user to select one option from a used for things like comments or messages.
the document, such as the title of the page. list of options. They are often used for things like <button>: Buttons are used to submit a form or to
<title>: This tag specifies the title of the document, selecting a country or state. trigger an action. They are often used for things like
which is displayed in the browser’s title bar or tab. Date picker: The date picker is used when you submitting a form or resetting a form.
<body>: This tag contains the visible content of the want the user to select a date. It provides a calendar
document, such as text, images, and links. interface that makes it easy for users to select a
date.

Session tracking is the process of remembering and The POST method is one of the HTTP request
documenting customer conversions over time. It is In JSP, a scriptlet is a block of Java code enclosed by methods used by the World Wide Web. It is used to
important for tracking conversions in online the pair <% and %>. It is used to contain any code send data to a server to create/update a resource.
shopping, mailing applications, and E-Commerce fragment that is valid for the scripting language used The data sent to the server with POST is stored in
applications1. in a page 123. The syntax for a scriptlet is as follows: the request body of the HTTP request. POST
<% scripting-language-statements %> requests are never cached, do not remain in the
Cookies: Cookies are small pieces of data delivered
Unlike expressions, scriptlets have a set of browser history, and cannot be bookmarked. POST
by the web server in the response header and kept
statements in Java language. It allows writing java requests have no restrictions on data length. The
by the browser. Each web client can be assigned a
code in it. Scriptlets can be used to execute Java POST method is often used when uploading a
unique session ID by a web server. Cookies are used
source code in JSP
to keep the session going. Cookies can be turned file or when submitting a completed web form
off by the client12.
Hidden Form Field: The information is inserted
into the web pages via the hidden form field,
which is then transferred to the server1.
URL Rewriting: URL rewriting is a technique that
involves appending a unique identifier to the URL of
each page visited by the user. This identifier is then
used to track the user’s session1.
HttpSession: HttpSession is an interface that
provides a way to identify a user across more
than one page request or visit to a website
The page directive is a JSP directive that is used to The life cycle of a Java Server Page (JSP) is a process The div tag is an HTML tag that is used to
define attributes that apply to an entire JSP page 12. that starts with its creation, which is later translated define a division or a section in an HTML
The basic syntax of the page directive is: to a servlet. The servlet lifecycle comes into play document 12. It is used as a container for HTML
<%@ page attribute="value" %> after the translation. The following steps are elements, which can then be styled with CSS or
Here are some of the attributes that can be used involved in the JSP life cycle 1: manipulated with JavaScript 1. The div tag is
with the page directive: Translation of JSP page to Servlet: This is the
import: This attribute is used to import classes, easily styled by using the class or id
first step of the JSP life cycle. This translation phase attribute 1. Any sort of content can be put inside
interfaces, or all the members of a package. It is deals with the syntactic correctness of JSP. Here, the
similar to the import keyword in Java. the div tag 1. By default, browsers always place a
JSP file is translated to a servlet.
contentType: This attribute defines the MIME line break before and after the div element 1.
Compilation of JSP page: Here, the generated
(Multipurpose Internet Mail Extension) type of the Here is an example of a div tag that contains a
Java servlet file is compiled to a class file.
HTTP response. heading and a paragraph:
Classloading: The classloader loads the Java class
extends: This attribute defines the parent class that
file into memory. The loaded Java class can then be
will be inherited by the generated servlet. CSS stands for Cascading Style Sheets. It is a
used to serve incoming requests for the JSP page.
info: This attribute sets the information of the JSP style sheet language used to describe the
Instantiation: Here, an instance of the class is
page which is retrieved later by using presentation of a document written in HTML or
the getServletInfo() method of the Servlet generated. The container manages one or more
instances by providing responses to requests. XML (including XML dialects such as SVG,
interface. MathML or XHTML) 12. CSS describes how
buffer: This attribute sets the buffer size in kilobytes Initialization: The jspInit() method is called
only once during the life cycle immediately after the elements should be rendered on screen, on
to handle output generated by the JSP page.
language: This attribute specifies the scripting generation of the Servlet instance from JSP. paper, in speech, or on other media 2. CSS is
language used in the JSP page. Request processing: used to style and layout web pages, for example,
isELIgnored: This attribute is used to ignore the The _jspService() method is used to serve the to alter the font, color, size, and spacing of your
Expression Language (EL) in JSP. raised requests by JSP. It takes request and response content, split it into multiple columns, or add
isThreadSafe: This attribute is used to control the objects as parameters. This method cannot be animations and other decorative features 2. CSS
multithreaded behavior of the JSP page. overridden. is a cornerstone technology of the World Wide
JSP Cleanup: In order to remove the JSP from the Web, alongside HTML and JavaScript 1. CSS is
use by the container or to destroy the method for easy to learn and allows developers to separate
servlets, the jspDestroy() method is used. This the presentation of a document from its content
method is called once. If you need to perform any
cleanup task like closing open files or releasing
database connections, jspDestroy() can be
overridden.

WML stands for Wireless Markup Language. It is an The JDBC-ODBC bridge driver is a JDBC driver A cookie is a small piece of data that is sent from a
XML-based markup language used to create content that uses ODBC driver to connect to the website and stored on the user’s computer by the
for wireless devices such as mobile phones and database. The JDBC-ODBC bridge driver converts user’s web browser while the user is browsing.
PDAs 12. WML is defined by a set of elements that JDBC method calls into the ODBC function Cookies are used to remember stateful information,
specify all markup and structural information for a calls 12. This driver is now discouraged because of such as items in a shopping cart, or to record the
WML deck 1. Elements are identified by tags, which the thin driver. In Java 8, the JDBC-ODBC Bridge has user’s browsing activity, such as which pages they
are each enclosed in a pair of angle brackets. Unlike been removed. Oracle does not support the JDBC- visited or what they searched for. Cookies can also
HTML, WML strictly adheres to the XML hierarchical be used to authenticate users and to keep them
ODBC Bridge from Java 8. Oracle recommends that
structure, and thus, elements must contain a start logged in to a website. There are two types of
tag; any content such as text and/or other elements; you use JDBC drivers provided by the vendor of
cookies: session cookies and persistent cookies.
and an end tag 1. Here are some of the elements that your database instead of the JDBC-ODBC
Session cookies are temporary and are deleted when
can be used in WML: Bridge 13. Advantages of the JDBC-ODBC bridge the user closes their web browser, while persistent
<wml>: Defines a WML deck (WML root). driver include easy to use and can be easily cookies remain on the user’s computer until they
<head>: Defines head information. connected to any database. Disadvantages include expire or are deleted by the user. Cookies can be
<card>: Defines a card in a deck. performance degradation because JDBC method disabled by the user in their web browser
<access>: Defines information about the access call is converted into the ODBC function calls settings
control of a deck. and the ODBC driver needs to be installed on
<template>: Defines a code template for all the the client machine Technologies of Web 2.0 – Pages 6 & 7
cards in a deck. Client Side Technologies in web 2.0 include
<br>: Defines a line break. - Ajax (Asynchronous Javascript And XML)
<p>: Defines a paragraph. - Javascript
<table>: Defines a table. - XML (eXtensible Markup Language)
<td>: Defines a table cell (table data). - SOAP (Simple Object Access Protocol)
<tr>: Defines a table row. - JSON (JavaScript Object Notation)
<pre>: Defines preformatted text. Server Side Technologies:
<b>: Defines bold text. - PHP
<big>: Defines big text. - Ruby
<em>: Defines emphasized text. - [Link]
<i>: Defines italic text. - Java Server Pages
<small>: Defines small text.
<strong>: Defines strong text.
<u>: Defines underlined text.
<img>: Defines an image.
Blogging – Page 8 Social Networking - Page 8 Web Services – Page 9
- A blog is an informational website maintained by its - A social networking site is an online platform that - In Web 2.0, there is a lot of user interaction.
blogger (or author). focuses on building social networks or social - When these interactions are between 2 or more
- It contains discrete entries or posts which are relations among its users who share their profiles, people and other resources on the Web, then
displayed in reverse chronological order (most interests, etc the role of web services comes.
recent post appears first) - Examples – Facebook, Twitter, Orkut, LinkedIn, - Web services improve the interactions or
- Types of blogs MySpace interconnections that may exist between 2 or more
o Textual (most common) - Facebook is the largest social networking site different web resources and hence between those
o Art (art blogs) - Social Networking sites can have certain themes. organizations that deliver them.
o Music (mp3 blogs) E.g. LinkedIn is a business oriented site which - E.g., if an organization wants to include a feature of
allows users to stay in touch with their professional credit card payments online, it can either set
contacts. up its own payment gateway or can integrate the
- These sites are also being used by teachers and web service of a Payment Service Provider (e.g.
students as communication tools PayPal) into the website. The user will make their
- Some sites have features that allow users to create purchase from company’s website, but for the
groups, upload photographs, add friends, payment the control is automatically transferred to
comment on profiles, etc. the service provider’s site. All this will
- Social networking sites allow two way interactions happen automatically between two organizations
Data Streaming – Page 12 CSS Rules format with an example – Page 32 Class selector with an example – Page 43
- Data streaming is a technique for transferring data - Each CSS rule contains two parts: selector and - Class selector is used to apply same style
at high speed rate so that it can be processed declaration specifications to the content of more than one kind
as a steady and continuous stream. - The selector indicates element or elements for of
- The client side computers do not always have fast which the declaration applies. In the selector element with HTML class attribute.
internet access to download heavy media files part, the elements can be separated by commas. - In style specification definition, the class attribute is
quickly. - The declaration specifies formatting properties for defined with a name which is preceded with
- With data streaming, the client browser can start the element. a period.
displaying the data before the entire file has - Then in the body of pages, you refer to this class
been transmitted. name to activate the element tag.
- Syntax and Example on Page 43
The Box Model of HTML – Page 45 & CYP 3 Div and span tags with example – Page 48 Need for XML – Page 57
- In a HTML document, each element is represented - The div elements define logical divisions in a web - HTML is designed to display documents in a web
as a rectangular box. page. browser. It becomes cumbersome if you want
- Each of these boxes is described using the box - This tag is used as a container for a group of to display the documents in some other language or
model. Diagram on Page 45 elements. upgrade the document for dynamic display.
- Each box has four edges: margin, border, padding, - It is used to define the style of whole sections of - XML is just suited for this purpose.
and content HTML page. - It is used to store data in plain text format using
- Innermost area is the content area where text and - It is a block-level element which works a lot like various unicode formats.
images appear. This area is measured by <p>. A div element is displayed from new line. - XML data can be used by various other
height and width. - The span tag is used to style the part of text it programming languages. This makes it easy to carry
- The padding is the space between the content area encloses. data
and its border. - Span tag is an inline element. irrespective of any platform.
- The outermost area is the margin which is - Without any style attributes, the span element will - It is also used as a base language for
completely invisible. not change the enclosed items at all. communication protocols such as XMPP (eXtensible
- Each element has the following properties: border- Messaging and Presence Protocol).
style, margin, padding, height, width. - XML provides users the flexibility to define their
XML Schema – Page 67-68 own tags which makes it easier to transport and
- It is possible to set style for a specific side of the - XML Schema is described as successor to DTD. allows users to define their document structure.
element using border-style-left, border-style- - It also describes the structure of an XML document,
right, ... , padding-bottom. and so is also referred to as XML schema
definition (XSD). Definition of an Event – Page 93
- XSDs are more powerful than DTDs in describing - Events are generated by the browser when “things
WML Difference from HTML – Pages 106 & 109 XML language. happen” to HTML elements.
- WML is the markup language defined in the WAP - They use a rich data typing system and allow for - E.g., clicking of the mouse, loading of the web page
specification. WML is an application of XML, more detailed constraints on an XML / image, moving the mouse over an element,
which is defined in a document-type definition. document’s logical structure. submission of a HTML form, etc.
- WAP sites are written in WML, while web sites are - The great strength about schemas is that they are - When events happen to an HTML element in a web
written in HTML. Both of them use tags and written in XML. So, someone with only XML page, it checks to see if any event handlers
are written in plain text format. are attached to it.
- The basic unit of navigation in HTML is a page, - If the answer is yes, it calls them in respective
while that in WML is a card. WML select Element – Page 114 order, while sending along references and further
- Unlike HTML, WML strictly adheres to the XML - The <select>...</select> WML elements are used to information for each event that occurred. The event
hierarchical structure and hence elements must define a selection list and the <option>... handlers then act upon the event.
contain a start tag and an end tag. </option> tags are used to define an item in the - DOM elements can be inside each
- WML is a case sensitive language unlike HTML selection list.
- Items are presented as radio buttons in some WAP
browsers.
- The <option>...</option> tag pair should be
enclosed within the <select>...</select> tags.
- Example on page 115
HTTP Post Method with an example – Page 17 Purpose of Directives – Page 27 Web Container – page 18
- POST is another important method used for passing - Directives are used to guide the JSP container for - A web container is a part of Java Enterprise
data to the server. translation and compilation of the JSP page Architecture
- However in POST method, data is passed inside a - They appear on top of the page - It is a part of the web server
message and not as part of the URL being sent. - Using directives, the container translates the page - It relates a client request to a servlet that is to be
- Example on page 17 into a servlet executed in order to give a response to the
- GET has an advantage that it is simple and safe - They do not directly produce any output request
however, the maximum length of the string that - Have the following syntax - A servlet is a Java Class that is executed on the
can be passed through a URL is fixed. o <%@ directive attribute=”value” %> server
- POST on the other hand has an advantage that it - Or in XML: - Diagram on page 19
hides information as it is not displayed. o <jsp:directive directivename attribute=”value” />
- 3 types of directives: page, include, and taglib
The HTML DOM (Document Object Model) is Static Web Pages 2 Tier and N Tier Architecture – Page 9-10
an API (Programming Interface) for JavaScript - If a server stores a web page as seen by users - 2 Tiers: Client tier or frontend and Server tier or
that defines HTML elements as objects with exactly as HTML and CSS, it is a static web page. backend
properties, methods, and events 1. The HTML - Every user will see the same information on the - A developer needs to design the basic interactivity
web site. for the application, rules of data access, and
DOM is a tree-like structure that represents the
- Sites designed in early stages of WWW were static. business rules in the client tier.
HTML document and allows you to manipulate it
These were useful in showing brochure like - Web pages of a web application accessed by the
with JavaScript 2. The HTML DOM is created fixed content about an organization. user using their computer and browser are part
when a web page is loaded, and it consists of a - For editing, the web administrator would manually of the client tier of the web application.
hierarchy of objects that represent the elements, edit the static HTML pages or change images - Client tier is used to submit the request for a web
attributes, and text content of the document 1. and their links on the HTML pages and reload them page. If a user has appropriate permissions,
The HTML DOM provides a way to access and on the server. the request information is passed on to the server,
manipulate the content of a web page using - Main tools used for this editing were text editors where the server-tier program services the
JavaScript. It allows you to add, delete, and like notepad. sent request. Once the requested data is available, it
modify HTML elements and attributes, change Dynamic Web Pages is sent back to the client.
the style and layout of a page, and respond to - It was felt static websites were not flexible and - 2-tier client-server applications require complex
user events such as mouse clicks and keyboard lacked user interaction. implementations and number of
- User wanted that a web page be catered communications between the clients and servers.
input 2. The HTML DOM is an essential part of
specifically to their requirements. - A step up from 2 tier architecture is the 3 tier
web development, and it is used to create
- This would require more user interaction. architecture. It consists of Presentation layer,
dynamic and interactive web pages - Therefore, websites now consist of JavaScript or application logic layer, and data layer.
Applets at the client side, as well as they may be - An n-tier architecture in addition to the above
created at the server as per user interaction using a three layers may have many more application
rich set of server side languages and layers such as client presentation layer, entity class
database tools. layer, persistence layer, etc.
- The more are the number of layers, the more
complex the system gets but it increases the
application flexibility.
MVC Architecture with a Diagram – Page 11 Request and Response – Page 15 Safe Methods – Page 16
- Model View Controller (MVC) architecture is used - HTTP uses a request-response method of - The methods that are only meant to retrieve
by Java for web application development. communication. information and not make any change in the server
- Following are the basic components of the MVC - As a client, a user types in the URL of a website, of any kind are considered as safe methods.
architecture: [Link] A - GET and HEAD methods are safe methods.
- Model: request for the web server is initiated.
o A model defines the data model and its access - The client’s ISP uses DNS servers to find the IP
controls. address of the web server hosting Purpose of Directives – Page 27
o The main responsibility of this component is to [Link]. - Directives are used to guide the JSP container for
accept user requests and the data - Once that is found, a request using a HTTP method translation and compilation of the JSP page
entered by the user and perform necessary data such as GET is sent to the web server. - They appear on top of the page
related functions. Request may look like the following - Using directives, the container translates the page
o GET /school/[Link] HTTP/1.1 into a servlet
- View: - Once the web server receives the request, it - They do not directly produce any output
o The function of the view is to accept the data from processes the sent data and sends a response. - Have the following syntax
the model and convert it to a form that can be o <%@ directive attribute=”value” %>
seen to a user in a user friendly way. JSP Compilation Time Error – Page 53 - Or in XML:
o Thus, view is responsible for displaying the web - This error comes at translation or compilation time o <jsp:directive directivename attribute=”value” />
pages for the user. when JSP page is translated from JSP source - 3 types of directives: page, include, and taglib
o Any change in model should also change the view to Java Servlet Class
- Controller: - Usually result of compilation failures due to some Need of Session Management – Page 60
o A user may be allowed to interact with the web syntax error or spelling mistakes - HTTP is the protocol used by web server and client
pages. - Known as translation time errors and are reported machine to communicate with each other
o This interaction may be in the form of checking to the client browser with error status code - HTTP is a stateless protocol i.e., it cannot persist
boxes, filling up input fields, etc. 500 data or it doesn’t remember a thing
o It is the controller which accepts this data from the - Compilation Time errors are handled by JSP engine - Each request is treated as a new request originating
user and initiates suitable actions that should - Example on page 53 from a new user
be carried out by the model. - This is not reliable when users want to perform
doing a business transaction or something else
where data persistence is necessary
- To remove this obstacle, session management is
needed
JDBC-ODBC Bridge – Page 83 . URL rewriting is a technique used to modify the The DriverManager Class – Page 79
- Also called TYPE-1 driver URL of a web page in a dynamic way. It is used to - The task of this class is to maintain a list of JDBC
- Freely distributed with JDK create user-friendly URLs that are easy to remember drivers which contains information about the
- This bridge driver works with Microsoft vendors and understand. URL rewriting is often used to object reference of each driver and subprotocols it
such as MS Access, MS-SQL, etc. make URLs more search engine friendly and to supports.
- It translates JDBC method calls to ODBC function improve the usability of a website 1. URL - When a program requests a database connection
calls which are then passed on to ODBC driver with getConnection() method, the
rewriting can be done using server-side scripting
- ODBC driver must be configured on the client DriverManager goes through the list and matches a
machine languages such as PHP, ASP, and JSP 2. The suitable driver
- This driver is used for prototyping when there is no process of URL rewriting involves intercepting an - Each JDBC driver must be registered with
alternative option for JDBC driver incoming request and modifying the URL before DriverManager
- It does not support multiple concurrent open it is processed by the server 1. - The most important method of DriverManger class
statements per connection is getConnection(). It returns a

Uses of JSP and Advantages over Servlet – Page 23 Life Cycle of a JSP Page with a diagram – Page 24 JSP Request Time Error – Page 54
- Java Server Pages (JSP) is a web technology that - When the JSP page is first accessed, it is translated - This error occurs during run time or request time
helps software developers to create dynamic into corresponding servlet and compiled, - These result in form of an exception
content based web pages. then, the page services the received request as a - These exceptions can be caught and handled by the
- A JSP page contains HTML tags as well as JSP servlet. calling JSP
elements which are the basic building blocks of the - The life cycle of a JSP page is controlled by three - Exceptions occur in the body of the JSP page
page. methods: - For exception handling, a JSP error page needs to
- A JSP page also consists of directives, scripting - jspInit(): be created and defined
elements, scriptlets, and action elements. o Called only once during the life cycle - This can be done in 2 ways:
- JSP has certain advantages over servlets. These are: o Synonymous to init() method of servlets - page level
o Allows programmers to insert Java code directly o Used to initialize objects and variables which are o exception handling code is defined on each page
into the JSP file which makes the used throughout the life cycle of the o if there is unhandled exception, corresponding
development process easier. JSP page error page will be displayed
o Supports element based dynamic content which o Is invoked when the page is initialized o page wise error page is defined using page
allows programmers to develop custom o Has no parameters, returns no value, throws no directive
tags libraries to satisfy application needs exceptions - application level:
o Content and display logic are separated - _jspService(): o an error page is defined for all pages by describing
o JSP pages can be used in conjunction with servlets o Called every time the JSP page is requested to it in deployment descriptor i.e.
that handle business logic serve a request [Link]
o Takes HttpServletRequest and
There are two types of include directives in HttpServletResponse as parameters
JSP: include directive and include o Returns no value Role of JDBC – Page 77
action 123. o Is defined automatically by the processor and - Most of the web applications use database.
The include directive is used to include the cannot be overridden Database accessing plays a significant role in web
contents of any resource, such as a JSP file, HTML - jspDestroy(): development.
file, or text file, into the current JSP page 12. The o Is invoked when the page is to be terminated - JDBC is a Java API that enables JSP program to
advantage of using an include directive is o Synonymous with destroy() method of servlets execute SQL statements
that it allows code reusability 1. The syntax of o Has no parameters, returns no value, throws no - The most widely used interface to access database
an include directive is as follows: exceptions is ODBC
<%@include file = "file location" o Developers can override jspDestroy() when they - It cannot be used directly with Java because it uses
%> need to perform any cleanup such as C interface and makes use of pointers which
The include action tag is used to include the releasing database connections or closing open files have been removed from Java
content of another resource, such as a JSP, HTML, or - This is why JDBC is required
servlet, at request time 23. The include
action tag can be used to include both static and
dynamic pages 3. The syntax of an include
action tag is as follows:
<jsp:include page="file location"
/>

2 Types of Include – Page 28 and Page 37 Scriptlets – Page 33 Hidden Fields for Session Management – Page 64
- Include Directive - In scriptlets, all scripting elements are grouped - User sessions are managed by passing a token as
- Important jsp directive together the value for a hidden HTML form field
- Used to insert text and code in the form of a file - Executed at request time, and makes use of - When the client submits a form, the additional field
such as HTML, JSP, etc. into the current JSP declarations, expressions, and JavaBeans values are also sent in the request
document at translation time - Can be written anywhere in the page - The hidden fields will either be sent in the URL or
- Enables you to import content of another static file - Contains valid java expressions within <% %> tag the request body depending on whether the
- Can appear anywhere in a JSP document which get inserted into _jspService() method of form uses GET method or POST method
- Syntax: generated servlet - The values of the fields can be retrieved using
o <%@ include file= “relative URL” %> - Syntax getParameter() method
- Example on page 29 o <% scriptlet code %> - Example:
- <jsp:include> - Or in XML: o <input type= “hidden” name= “userid” value=
- Dynamic include o <jsp:scriptlet> code fragment </jsp:scriptlet> “ignou” />
- Action Element
- In static include, content is included at compile
time hence if the content is changed during run
time the current JSP page will not change until
server restart
AJAX stands for Asynchronous JavaScript and The HTML DOM (Document Object Model) is The POST method is an HTTP request method used
XML. It is a technique used to create fast and an API (Programming Interface) for JavaScript to send data to a server to create/update a
dynamic web pages that allow web pages to be that defines HTML elements as objects with resource. The data sent to the server with POST is
updated asynchronously by exchanging small properties, methods, and events 1. The HTML stored in the request body of the HTTP
amounts of data with the server behind the DOM is a tree-like structure that represents the request 12. The POST method is used to submit
scenes 12. AJAX is not a programming language HTML document and allows you to manipulate it an entity to the specified resource, often causing
or technology, but it is a combination of multiple with JavaScript 2. The HTML DOM is created a change in state or side effects on the
web-related technologies like HTML, XHTML, when a web page is loaded, and it consists of a server 1. The POST method is often used when
CSS, JavaScript, DOM, XML, XSLT, and hierarchy of objects that represent the elements, uploading a file or when submitting a completed
XMLHttpRequest object 3. AJAX allows you to attributes, and text content of the document 1. web form 1. Here are some of the characteristics of
send and receive data asynchronously without The HTML DOM provides a way to access and the POST method:
reloading the web page 4. AJAX is an essential manipulate the content of a web page using
part of web development, and it is used to JavaScript. It allows you to add, delete, and The GET method is an HTTP request method used
create dynamic and interactive web pages 1. modify HTML elements and attributes, change to retrieve data from a specified resource. The GET
the style and layout of a page, and respond to method sends the encoded user information
user events such as mouse clicks and keyboard appended to the page request in the URL 1. The
input 2. The HTML DOM is an essential part of GET method is used to request data from a
web development, and it is used to create server, and it should only be used to request
dynamic and interactive web pages data, not to modify it 1. The query string
(name/value pairs) is sent in the URL of a GET
request 1. Here are some of the characteristics of
the GET method:
An HTTP server is a software application that In computer programming, an exception is an A ResultSet object is a table of data
understands URLs (web addresses) and HTTP (the event that occurs during the execution of a program representing a database result set, which is
protocol your browser uses to view webpages). An that disrupts the normal flow of usually generated by executing a statement that
HTTP server can be accessed through the instructions. Exceptions are used to handle errors queries the database 1. A ResultSet object
domain names of the websites it stores, and it and other exceptional events that occur during maintains a cursor pointing to its current row of
delivers the content of these hosted websites to the execution of a program 1. When an exception data. Initially, the cursor is positioned before the
the end user’s device 1. There are many HTTP occurs, the program stops executing and an error first row
servers available, including Apache HTTP Server, message is displayed. Exceptions can be caused by
Nginx, Microsoft IIS, and Google Web a variety of factors, such as invalid input,
Server 2. HTTP servers are used to host websites hardware failure, or network problems 1. In Java,
and web applications, and they are responsible exceptions are objects that are created when an
for serving web pages to clients that request error occurs. They can be caught and handled by
them 1. HTTP servers can be used to deliver the program using try-catch blocks 2. Exception
static content, such as HTML pages and images, handling is an important part of software
as well as dynamic content, such as web development, and it is used to ensure that
applications and APIs 2. programs continue to run even when errors occu
The DriverManager class is the component of JDBC The PreparedStatement interface is a subinterface The onclick event is a JavaScript event that
API and also a member of the [Link] package. The of Statement. It is used to execute parameterized occurs when the user clicks on an HTML element 1. It
DriverManager class acts as an interface between query. is used to execute a certain functionality when a
users and drivers. It keeps track of the drivers that button is clicked, such as submitting a form or
are available and handles establishing a connection Let's see the example of parameterized query: changing the content on a web page 2.
between a database and the appropriate driver. It To use the onclick event, you can add
contains all the appropriate methods to register and String sql="insert into emp values(?,?,?)"; the onclick attribute to the HTML element and
deregister the database driver class and to create a As you can see, we are passing parameter (?) for the set it equal to the name of the function you want to
connection between a Java application and the values. Its value will be set by calling the setter execute when the element is clicked 1. Here is an
database. The DriverManager class maintains a list methods of PreparedStatement. example of how to use the onclick event to call a
of Driver classes that have registered themselves by function when a button is clicked
calling the method [Link](). safe methods in Java, there are several concepts
that come to mind such as fail-
A JSP compilation error can occur due to various fast and fail- AJAX stands for Asynchronous JavaScript and XML
reasons, such as incorrect syntax, missing libraries, safe iterators 1, synchronized methods 2, and 123. It is a technique used in web development that
or incorrect configuration settings 1. One common allows web pages to be updated asynchronously by
the SafeVarargs annotation
cause of a JSP compilation error is a missing or exchanging small amounts of data with the server
corrupted JAR file 12. behind the scenes 4. This means that it is possible to
If you are encountering a JSP compilation error due update parts of a web page, without reloading the
to a missing or corrupted JAR file, you can try the whole page 14.
following steps to resolve the issue:
Check that the JAR file is present in the correct AJAX uses a combination of technologies such as
location and is not corrupted. HTML, CSS, JavaScript, DOM, XML, XSLT, and
Ensure that the JAR file is included in the classpath of XMLHttpRequest object 2. The XMLHttpRequest
your application. object is used to send and receive data
If the JAR file is included in the classpath, try asynchronously without reloading the web page
removing it and adding it back again.
If none of the above steps work, try cleaning and
rebuilding your project.
Database management system is software that is Database architecture refers to the overall design Database normalization is a process of
used to manage the database. and structure of a database. It determines how structuring a relational database in accordance
Our DBMS Tutorial includes all topics of DBMS data is organized, where it is stored, and how it is with a series of so-called normal forms in order
such as introduction, ER model, keys, relational accessed within the database1. It also governs the to reduce data redundancy and improve data
model, join operation, SQL, functional tools and technologies used to maintain your
integrity1. It was first proposed by British
dependency, transaction, concurrency control, etc. company’s database1. The architecture is largely
computer scientist Edgar F. Codd as part of his
Normalization is the process of organizing the defined by the system on which the database
runs1. relational model1. Normalization is used to
data in the database. minimize the redundancy from a relation or set
There are two main types of database architecture:
Normalization is used to minimize the of relations2. It is also used to eliminate
1-Tier Architecture: In this architecture, the
redundancy from a relation or set of relations. undesirable characteristics like Insertion,
database is directly available to the user. It means
It is also used to eliminate undesirable the user can directly sit on the DBMS and uses Update, and Deletion
characteristics like Insertion, Update, and it2. Any changes done here will directly be done on Anomalies2. Normalization divides the larger
Deletion Anomalies. the database itself2. It doesn’t provide a handy tool table into smaller tables and links them using
Normalization divides the larger table into for end users2. The 1-Tier architecture is used for relationships2.
smaller and links them using relationships. development of the local application, where Normalization works through a series of stages
The normal form is used to reduce redundancy programmers can directly communicate with the
called Normal forms2. The normal forms apply
from the database table. database for the quick response2.
to individual relations2. The relation is said to
2-Tier Architecture: The 2-Tier architecture is same
as basic client-server. In the two-tier architecture, be in a particular normal form if it satisfies
applications on the client end can directly constraints2. Here are the various types of
communicate with the database at the server Normal forms
side2. For this interaction, API’s like: ODBC, JDBC 1NF (First Normal Form): A relation is in 1NF
are used2. The user interfaces and application if it contains an atomic value2.
programs are run on the client-side2. The server 2NF (Second Normal Form): A relation will be
side is responsible to provide the functionalities in 2NF if it is in 1NF and all non-key attributes
like: query processing and transaction are fully functional dependent on the primary
management2. To communicate with the DBMS, key2.
client-side application establishes a connection
3NF (Third Normal Form): A relation will be in
with the server side2.
3NF if it is in 2NF and no transition
3-Tier Architecture: The 3-Tier architecture
contains another layer between the client and dependency exists2.
server2. In this architecture, client can’t directly BCNF (Boyce-Codd Normal Form): A
communicate with the server2. The application on stronger definition of 3NF is known as Boyce
the client-end interacts with an application server Codd’s normal form2.
which further communicates with the database 4NF (Fourth Normal Form): A relation will be
system2. End user has no idea about the existence in 4NF if it is in Boyce Codd’s normal form and
of the database beyond the application has no multi-valued dependency2.
server2. The database also has no idea about any 5NF (Fifth Normal Form): A relation is in
other user beyond the application2. The 3-Tier 5NF. If it is in 4NF and does not contain any
architecture is used in case of large web
join dependency, joining should be lossless2
application2

Disadvantages of Hash File Organization: Advantages of ISAM:


This method is inefficient for the large database In this method, each record has the address of its
because it takes time to search or modify the data block, searching a record in a huge database is
record1. quick and easy2.
If we want to search, update or delete the data in This method supports range retrieval and partial
hash file organization, then we need to traverse retrieval of records2.
the data from the start of the file till we get the Since the index is based on the primary key values,
requested record1. we can retrieve the data for the given range of
If the database is very large then searching, value2.
updating or deleting of record will be time- The partial value can also be easily searched, i.e.,
consuming because there is no sorting or ordering the student name starting with ‘JA’ can be easily
of records1 searched2.
Disadvantages of ISAM:
This method requires extra space in the disk to
store the index value2.
When the new records are inserted, then these
files have to be reconstructed to maintain the
sequence2.
When the record is deleted, then the space used
by it needs to be released. Otherwise, the
performance of the database will slow dow
An Entity Relationship (ER) Diagram is a type SQL commands are instructions used to The File is a collection of records. Using the
of flowchart that illustrates how “entities” such communicate with a database to perform tasks, primary key, we can access the records. The
as people, objects, or concepts relate to each functions, and queries with data1. Here are type and frequency of access can be
other within a system1. ER diagrams are some of the most common SQL commands: determined by the type of file organization
created based on three basic concepts: entities, Data Definition Language (DDL): These which was used for a given set of records.
attributes, and relationships2. commands are used to define or alter the File organization is a logical relationship
Here are the components of an ER Diagram: structure of the database2. among various records. This method defines
Entity: An entity may be any object, class, CREATE: Used to create a new table in the how file records are mapped onto disk blocks.
person, or place. In the ER diagram, an entity database2. File organization is used to describe the way in
can be represented as rectangles3. DROP: Used to delete both the structure and which the records are stored in terms of blocks,
Strong Entity: A Strong Entity is a type of record stored in the table2. and the blocks are placed on the storage
entity that has a key Attribute. It is represented ALTER: Used to alter the structure of the medium.
by a rectangle4. database2. The first approach to map the database to the
Weak Entity: An entity that depends on TRUNCATE: Used to delete all the rows from file is to use the several files and store only one
another entity is called a weak entity. The weak the table and free the space containing the fixed length record in any given file. An
entity is represented by a double rectangle3. table2. alternative approach is to structure our files so
Attribute: The attribute is used to describe the Data Manipulation Language (DML): These that we can contain multiple lengths for
property of an entity. Eclipse is used to commands are used to manipulate the data records
represent an attribute3. within the database2. Sequential File Organization: The easiest
Key Attribute: The key attribute is used to INSERT: Used to insert data into the row of a method for file organization is the Sequential
represent the main characteristics of an table2. method. In this method, the file is stored one
entity. It represents a primary key3. UPDATE: Used to update existing data within a after another in a sequential manner1. There
Composite Attribute: An attribute that table2. are two ways to implement this method:
composed of many other attributes is known DELETE: Used to delete existing data within a Pile File Method: In this method, we store the
as a composite attribute3. table2. records in a sequence i.e., one after the other
Multivalued Attribute: An attribute can have Data Control Language (DCL): These in the order in which they are inserted into the
more than one value. These attributes are commands deal with the rights, permissions tables1.
known as a multivalued attribute3. and other controls of the database system2. Sorted File Method: In this method, whenever
Derived Attribute: An attribute that can be GRANT: Gives user’s access privileges to the a new record has to be inserted, it is always
derived from other attribute is known as a database2. inserted in a sorted (ascending or descending)
derived attribute3. REVOKE: Withdraws user’s access privileges manner
Relationship: A relationship is used to given by using the GRANT command2. It is the simplest and most basic type of
describe the relation between Transaction Control Language (TCL): These organization. It works with data blocks. In heap
entities. Diamond or rhombus is used to commands deal with the transaction file organization, the records are inserted at the
represent the relationship3. operations within the database2. file's end. When the records are inserted, it
One-to-One Relationship: When only one COMMIT: Saves the work done in a transaction2. doesn't require the sorting and ordering of
instance of an entity is associated with the records.
ROLLBACK: Restores the database to the
relationship, then it is known as one to one When the data block is full, the new record is
original state since the last COMMIT command
relationship3. stored in some other block. This new data
in a transaction2.
One-to-many relationship: When only one block need not to be the very next data block,
SAVEPOINT: Sets a point in a transaction to
instance of the entity on the left, and more but it can select any data block in the memory
which you can later roll back2.
than one instance of an entity on the right to store new records. The heap file is also
Data Query Language (DQL): This command
associates with the relationship then this is known as an unordered file.
is used to fetch the data from the database
known as a one-to-many relationship In the file, every record has a unique id, and
which is then presented to the user in a table
every page in a file is of the same size. It is the
format2.
DBMS responsibility to store and manage the
SELECT: Retrieves data from a database
new records.

B+ tree file organization is the advanced Hash File Organization is a method of ISAM, an acronym for Indexed Sequential
method of an indexed sequential access arranging and storing records in a database Access Method, is a method for creating,
method. It uses a tree-like structure to store using a hash function12. It uses the value of an maintaining, and manipulating computer files
records in File. attribute or set of attributes as input and gives of data so that records can be retrieved
It uses the same concept of key-index where the location (page/block/bucket) where the sequentially or randomly by one or more
the primary key is used to sort the records. For record can be stored3. This technique allows for keys1. Indexes of key fields are maintained to
each primary key, the value of the index is fast access to specific records, making it an achieve fast retrieval of required file records in
generated and mapped with the record. efficient technique for managing large indexed files1.
The B+ tree is similar to a binary search tree datasets4. It is a very good method of file Here’s how it works:ISAM is an advanced
(BST), but it can have more than two children. organization for bulk insertion1. sequential file [Link] this method,
In this method, all the records are stored only If there is a large number of data which needs records are stored in the file using the primary
at the leaf node. Intermediate nodes act as a to load into the database at a time, then this [Link] index value is generated for each
pointer to the leaf nodes. They do not contain method is best suited1. primary key and mapped with the [Link]
any records. In case of a small database, fetching and index contains the address of the record in the
retrieving of records is faster than the [Link] any record has to be retrieved based on
sequential record its index value, then the address of the data
1
block is fetched and the record is retrieved
from the memory2.
An SQL query is a command used to retrieve Relational Algebra is a procedural query In the context of a Database Management
data from a database1. It is a flexible language used in Relational Database System (DBMS), a view is a virtual table that is
instrument for accessing the needed data1. You Management Systems (RDBMS). It provides a based on the result set of a query1234. It has
can think of an SQL query as a question you theoretical foundation for relational databases rows and columns just like a real table. The
send to the database, and you expect the and SQL1234. The main purpose of using fields in a view are fields from one or more real
database to respond to the question by Relational Algebra is to define operators that tables in the database1234.
sending back the data2. transform one or more input relations into an Here are some key points about views:
Here is an example of a basic SQL query: output relation1234. Virtual Table: A view is not a physical entity. It
SQL Here are some fundamental operators used in is a virtual table created as a result of a
SELECT * FROM Customers; Relational Algebra1: query. But it can be used like a real table1234.
AI-generated code. Review and use carefully. More
Selection (σ): It is used to select required Dynamic: A view is dynamic, meaning it is up-
info on FAQ.
tuples of the relations1. to-date. When the database is updated, the
In this example, SELECT * FROM
Projection (π): It is used to project required data in the view is also updated3.
Customers; is an SQL query that retrieves all
column data from a relation1. Uses: Views can be used for various purposes
data from the Customers table3.
Union (U): Union operation in relational such as restricting data access, hiding data
SQL queries can be much more complex and
algebra is the same as union operation in set complexity, ensuring data integrity, and more1.
can include various commands to perform
theory1. Creating Views: A view can be created from a
specific tasks such as accessing, managing,
Set Difference (-): Set Difference in relational single table or multiple tables using
modifying, updating, controlling, and
algebra is the same set difference operation as the CREATE VIEW statement12.
organizing your data stored in a database4.
in set theory1. Updating Views: There are certain conditions
For more detailed information
Set Intersection (∩): Set Intersection in that need to be satisfied to update a view1.
relational algebra is the same set intersection Deleting Views: An existing view can be
operation in set theory1. deleted using the DROP VIEW statement
Rename (ρ): Rename is a unary operation used
for renaming attributes of a relation1.
Cartesian Product (X): The Cartesian product
is used to combine each row in one table with
each row in the other table2.
These operators accept relations as input and
produce relations as output, they can be
combined and used to express potentially
complex queries that transform potentially
many input relations into a single output
relation1234.
Concurrency management, also known as ACID is an acronym that stands for Atomicity, In a database management system (DBMS), a
concurrency control, is a critical aspect of database Consistency, Isolation, and Durability. These are serializable schedule is a sequence of database
management systems (DBMS). It ensures efficient the four key properties that ensure reliable actions (read and write operations) that does not
and reliable software execution, especially in processing of database transactions12. violate the serializability property1. This property
the context of multiple users accessing and Atomicity: This property ensures that a ensures that each transaction appears to execute
modifying shared data concurrently1. transaction is treated as a single, indivisible unit, atomically and is isolated from other transactions’
Here are some key points about concurrency which either succeeds completely, or fails effects1.
A non-serial schedule is called a serializable
control: completely. If any part of the transaction fails,
schedule if it can be converted to its equivalent
Concurrent Execution: In a multi-user system, the entire transaction fails and the database is serial schedule2. In simple words, if a non-serial
multiple users can access and use the same left unchanged3. schedule and a serial schedule result in the same
database at one time, which is known as the Consistency: This property ensures that a then the non-serial schedule is called a serializable
concurrent execution of the database2. transaction brings the database from one valid schedule2.
Problems with Concurrent Execution: There state to another, maintaining database There are two types of serializability:
are several challenging problems that need to be invariants: any data written to the database Conflict Serializable: A schedule is called conflict
solved when executing database transactions must be valid according to all defined rules, serializable if it can be transformed into a serial
concurrently. These include lost update including constraints, cascades, triggers, and schedule by swapping non-conflicting operations3.
problems and dirty read problems2. any combination thereof3. Two operations are said to be conflicting if all
Lost Update Problems (W - W Conflict): This Isolation: This property ensures that
conditions satisfy:
problem occurs when two different database concurrent execution of transactions leaves the
They belong to different transactions
transactions perform the read/write operations They operate on the same data item
database in the same state that would have At least one of them is a write operation3
on the same database items in an interleaved been obtained if the transactions were View Serializable: A Schedule is called view
manner (i.e., concurrent execution) that makes executed sequentially3. serializable if it is view equal to a serial schedule
the values of the items incorrect hence making Durability: This property ensures that once a (no overlapping transactions)4.
the database inconsistent2. transaction has been committed, it will remain A serializable schedule helps in improving both
Dirty Read Problems (W-R Conflict): The committed even in the case of a system failure resource utilization and CPU throughput
dirty read problem occurs when one (e.g., power outage or crash). This is usually
transaction updates an item of the database, achieved by storing the transaction into a
and somehow the transaction fails, and before transaction log that can be replayed to
the data gets rollback, the updated database recreate the system state right before the
item is accessed by another transaction2. failure
Transaction: A set of logically related
operations is known as a transaction3. The main
operations of a transaction are: Read (A) and
Write (A)3.
Commit and Rollback: After all instructions of a
transaction are successfully executed, the changes
made by a transaction are made permanent in the
database. If a transaction is not able to execute
all operations successfully, all the changes
made by a transaction are undone

The Two Phase Locking Protocol (2PL) is a In the context of a Database Management System Database recovery is a critical aspect of
method of concurrency control in Database (DBMS), a log file is a critical component that database management systems (DBMS) that
Management Systems (DBMS) that ensures records all transactions and the database ensures the database can be restored to a
serializability by applying a lock to the modifications made by each transaction1. The log is consistent state after a failure or error123. The
a sequence of log records, recording all the
transaction data which blocks other main goal of recovery techniques is to ensure
updated activities in the database23.
transactions from accessing the same data data integrity and consistency, and prevent
Here are some key points about log files:
simultaneously12. The protocol is divided into Log Records: Any operation performed on the data loss1.
two phases2: database is recorded in the log. Prior to performing There are mainly two types of recovery
Growing Phase: In this phase, all the locks are any modification to the database, an updated log techniques used in DBMS1:
issued. No locks are released. After all changes record is created to reflect that modification2. An Rollback/Undo Recovery Technique: This
to data-items are committed, the second phase update log record represented as: <Ti, Xj, technique is based on undoing the effects of a
starts2. V1, V2> has these fields2: transaction that has not been completed
Shrinking Phase: In this phase, no locks are Transaction identifier: Unique Identifier of the successfully due to a system failure or error. This is
issued. All the changes to data-items are noted transaction that performed the write operation. accomplished by undoing the changes made
(stored) and then locks are released2 Data item: Unique identifier of the data item by the transaction using the log records stored
The “Wait and Wound” protocol, also known as written. in the transaction log1.
Old value: Value of data item prior to write. Commit/Redo Recovery Technique: This
the “Wound-Wait” scheme, is a deadlock
New value: Value of data item after write
prevention strategy used in Database technique is based on reapplying the changes
operation2.
Management Systems (DBMS)12345. It is based Types of Log Records: Other types of log records
made by a transaction that has been completed
on a preemptive technique12345. successfully to the database. This is accomplished
are: <Ti start>, <Ti commit>, and <Ti
Here’s how the “Wait and Wound” protocol by using the log records stored in the
abort>. They contain information about when a
works: transaction Ti starts, commits, and aborts transaction log to redo the changes made by
Each transaction has a timestamp that respectively2. the transaction that was in progress at the time
indicates its age3. Undo and Redo Operations: Because all database of the failure or error1.
When Transaction Ti requests a data item modifications must be preceded by the creation of In addition to these two techniques, there is also a
currently held by Tj, Ti is allowed to wait only if a log record, the system has available both the old third technique called checkpoint
it has a timestamp larger than that of Tj, value prior to the modification of the data item recovery. Checkpoint Recovery is a technique
otherwise Tj is killed (i.e., Tj is wounded by Ti) and new value that is to be written for data used to reduce the recovery time by
item. This allows system to perform redo and undo periodically saving the state of the database in
operations as appropriate2. a checkpoint file1.
A data dictionary in a Database Management A precedence graph, also known as a serialization Inverted file organization is a type of file
System (DBMS) is a component that stores graph or conflict graph, is used in Database organization used in Database Management
metadata, i.e., data about the database123. It is a Management Systems (DBMS) to test for conflict Systems (DBMS) and information retrieval
collection of names, definitions, and attributes for serializability1234. Conflict serializability is a systems123. It is a data structure that maps from
data elements that are being used in a property of a schedule that ensures that the content, such as words or numbers, to its locations
database123. These data elements are then used as transactions in the schedule can be executed in in a document or a set of documents1.
part of a database, research project, or serial order without any conflicts1234. Here are some key points about inverted file
information system123. Here’s how the precedence graph works: organization:
Here are some key points about a data dictionary: For each transaction in the schedule, a node is Inverted Index: In an inverted file organization,
Information Stored: A data dictionary generally created1. one index is maintained for each key attribute of
gives information about where and how data or For each pair of conflicting operations (i.e., the record. The index file contains the value of the
control items are used which may include an operations on the same data item by different key attribute followed by the addresses of all the
input/output to process1. It also provides transactions), draw an edge from the transaction records in the main file with the same value of the
information about entities, relationships, and that accessed the data item first to the transaction key attribute3.
attributes that are present in the system model1. that accessed the data item second1234. Efficiency: Inverted file organization is used to
Types of Data Dictionary: Data Dictionary is If the precedence graph contains a cycle, then the efficiently retrieve documents or web pages
basically of two types1: schedule is not conflict serializable1234. containing a specific term or set of terms1. They
Integrated Data Dictionary: Integrated Data If the precedence graph does not contain a cycle, are especially useful for large collections of
Dictionary can be seen as a catalog that can be then the schedule is conflict serializable documents, where searching through all the
maintained by the relational database1. documents would be prohibitively slow1.
Stand Alone Data Dictionary: Stand Alone Data Example: Consider the following
Dictionary is a type of flexible data dictionary as documents. Document 1: “The quick brown fox
Database Administrator has ease of managing data jumped over the lazy dog.” Document 2: “The lazy
dog slept in the sun.” To create an inverted index
for these documents, we first tokenize the
documents into terms, then we create an index of
the terms, where each term points to a list of
documents that contain that term1.
Types of Inverted Indexes: There are two types of
inverted indexes1:
Record-Level Inverted Index: Contains a list of
references to documents for each word1.
Word-Level Inverted Index: Additionally contains
the positions of each word within a docume

A weak entity in a Database Management B+ tree file organization is the advanced method of Query Processing is the activity performed in
System (DBMS) is an entity that cannot be an indexed sequential access method. It uses a extracting data from the database. In query
uniquely identified by its attributes tree-like structure to store records in [Link] uses processing, it takes various steps for fetching the
alone12. Therefore, it must use a foreign key in the same concept of key-index where the primary data from the database. The steps involved are:
key is used to sort the records. For each primary Parsing and translation,Optimization,Evaluation ER
conjunction with its attributes to create a
key, the value of the index is generated and model stands for an Entity-Relationship model. It is
primary key2. It depends on another entity,
mapped with the [Link] B+ tree is similar to a a high-level data model. This model is used to
known as the owner or parent entity, for its binary search tree (BST), but it can have more than define the data elements and relationship for a
identification3. two children. In this method, all the records are specified [Link] develops a conceptual design
Here are some key points about weak entities: stored only at the leaf node. Intermediate nodes for the database. It also develops a very simple and
Partial Key: A weak entity comprises a partial key act as a pointer to the leaf nodes. They do not easy to design view of [Link] ER modeling, the
(discriminator). However, it is not enough to contain any records. Structure of a B+ Tree Index. database structure is portrayed as a diagram called
uniquely identify the record in the enti The top level is known as the root node . The an entity-relationship diagram.
bottom level consists of leaf nodes that store index
Data replication is the process of storing data key values with pointers to the table rows that Normalization is the process of organizing data in a
in more than one site or node1234. It is useful in contain the corresponding data. Levels between database. This includes creating tables and
improving the availability of data1. It involves the root and leaf node levels are known as establishing relationships between those tables
intermediate nodes according to rules designed both to protect the
copying data from a database from one server
data and to make the database more flexible by
to another server so that all users can share the
eliminating redundancy and inconsistent
same data without any inconsistency1. The dependency Data abstraction is the procedure of
result is a distributed database in which users concealing irrelevant or unwanted data from the
can access data relevant to their tasks without end use
interfering with the work of others1. Data
replication encompasses the duplication of
transactions on an ongoing basis so that the
replicate is in a consistently updated state and
synchronized with the source
A “Wait-For” graph is a method used in Database In a Database Management System (DBMS), an Query optimization is a process in Database
Management Systems (DBMS) to detect potential index is a data structure that improves the Management Systems (DBMS) that aims to choose
deadlocks12345. Deadlocks are a fundamental speed of data retrieval operations on a the most efficient way to execute a given query by
problem in distributed systems where a set of database table1234. It works in a similar way to considering the possible query plans1234. The goal
processes are blocked as each process is holding of query optimization is to minimize the system
an index at the end of a book, providing a
some resources and that acquired resources are resources required to fulfill a query, and ultimately
quick way to find specific information Ordered
needed by some other processes1. provide the user with the correct result set
Index: The indices are usually sorted to make
Here’s how the “Wait-For” graph works: faster1234.
searching faster1.
For each transaction entering into the system, a Here are some key points about query
Primary Index: If the index is created on the basis
node is created4. optimization:
of the primary key of the table, then it is known as
When a transaction Ti requests for a lock on an Execution Plan: After parsing the query, the parsed
primary indexing1. The primary index can be
item, say X, which is held by some other query is passed to the query optimizer, which
further divided into two types12:
transaction Tj, a directed edge is created from Ti to generates different execution plans to evaluate the
Dense Index: The dense index contains an index
Tj parsed query and selects the plan with the least
record for every search key value in the data file12.
estimated cost134.
Sparse Index: In the data file, index record appears
The Boyce-Codd Normal Form (BCNF) and the Cost Estimation: The cost computation takes into
only for a few items12.
Third Normal Form (3NF) are both normalization account query execution factors such as I/O, CPU,
Secondary Index: The secondary index can be
forms used in database design to reduce and communication for a certain query in a given
generated by a field which has a unique value for
redundancy and dependency of data1234. context1.
each record, and it should be a candidate key2.
Third Normal Form (3NF): A relation is in 3NF if it is Optimizer Components: The optimizer is made up
Clustering Index: A clustered index can be defined
in 2NF and no non-key attribute is transitively of three parts: the transformer, the estimator, and
as an ordered data file. Sometimes the index is
dependent on the primary key1. In other words, the plan generator1.
created on non-primary key columns which may
there is no transitive dependency1. It is used to Types of Query Optimization: There are broadly
not be unique for each record1
reduce data duplication and to attain data two ways a query can be optimized2:
integrity1. Analyze and transform equivalent relational
Boyce-Codd Normal Form (BCNF): BCNF is an expressions: Try to minimize the tuple and column
extension of 3NF and has more strict rules1. A counts of the intermediate and final query
functional dependency is in BCNF if it is already in processes2.
3NF and for any functional dependency P->Q, P Using different algorithms for each operation:
must be a super key1. BCNF is considered to be These underlying algorithms determine how tuples
stronger than 3NF1. are accessed from the data structures they are
The main difference between 3NF and BCNF is that stored in, indexing, hashing, data retrieval and
BCNF is a stricter version of 3NF. All relations that hence influence the number of disk and block
follow the rules of BCNF will also be in 3NF, but not accesses
vice versa3. In other words, if a relation is in BCNF,
it is also in 3NF. However, a relation can be in 3NF
but not in BCNF

In a Database Management System (DBMS), A checkpoint in a Database Management System A Centralized Database Management System
keys are used to identify records in a table and (DBMS) is a mechanism that saves the current (DBMS) and a Distributed DBMS are two types of
establish relationships between tables12345. Here state of the database to disk12. This allows for database management systems that differ in how
are some types of keys: faster recovery in the event of a system failure or they store and manage data1234.
Primary Key: A primary key is a unique crash12. Centralized DBMS:
Here’s how the checkpoint works: A centralized DBMS stores and manages all of the
identifier for a record in a table1. It must
Write the begin_checkpoint record into a data in one place12.
contain unique values and cannot be NULL1.
log3. It is often used in organizations, businesses, or
Candidate Key: A candidate key is an attribute Collect checkpoint data in stable storage3. institutions2.
or set of attributes that can uniquely identify a Write the end_checkpoint record into a log3. Data can be accessed using a network, a local area
tuple1. Except for the primary key, the The recovery system reads the logs backward from network (LAN) or a wide area network (WAN)2.
remaining attributes are considered a the end to the last checkpoint3. It will keep track of Advantages include easier access and coordination
candidate key1. two lists – Undo and Redo3. Whenever there is a of data, minimal data redundancy, and lower cost
Super Key: A super key is an attribute or set of log with instructions <Tn, start> and <Tn, compared to other databases1.
attributes that can uniquely identify a tuple1. A commit> or only <Tn, commit> then it will put Disadvantages include higher data traffic and the
super key is a superset of a candidate key1. that transaction in Redo List3. Whenever a log risk of entire data destruction in case of system
record with no instruction of commit or abort is failure1.
Foreign Key: Foreign keys are the column of a
found, that transaction is put to Undo List Distributed DBMS:
table used to point to the primary key of
A distributed DBMS consists of multiple databases
another table1. They are used to establish that are connected with each other and are spread
relationships between tables1. across different physical locations13.
Alternate Key: There may be one or more The data stored in various physical locations can be
attributes or a combination of attributes that managed independently of other physical
uniquely identify each tuple in a relation. These locations1.
attributes or combinations of the attributes are Advantages include easy expansion as data is
called the candidate keys. One key is chosen as already spread across different physical locations,
the primary key from these candidate keys, and easy access from different networks, and higher
the remaining candidate key, if it exists, is security compared to a centralized database1.
termed the alternate key1. Disadvantages include higher cost, difficulty in
Composite Key: A composite key is a key that maintenance due to complexity, and difficulty in
providing a uniform view to users since it is spread
consists of two or more attributes that
across different physical locations
uniquely identify an entity in a table3.
Unique Key: A unique key is a set of one or
more than one fields/columns of a table that
uniquely identify a record in a database table
lOMoARcPSD|26772591

##Weak Entity cannot be used independently as it is 2. Conceptual LevelThe conceptual schema describes ##Concurrent Execution in DBMS:-In a multi-user
dependent on a strong entity type known as its owner the design of a database at the conceptual level. system, multiple users can access and use the same
entity. Also, the relationship that connects the weak Conceptual level is also known as logical [Link] database at one time, which is known as the concurrent
entity to its owner identity is called the identifying conceptual schema describes the structure of the whole execution of the database. It means that the same
relationship. A weak entity always has a total [Link] conceptual level describes what data are database is executed simultaneously on a multi-user
participation constraint with respect to its identifying to be stored in the database and also describes what system by different [Link] working on the
relationship because it cannot be identified relationship exists among those [Link] the conceptual database transactions, there occurs the requirement of
independently of its owner identity. A weak entity may level, internal details such as an implementation of the using the database by multiple users for performing
have a partial key, which is a list of attributes that data structure are [Link] and database different operations, and in that case, concurrent
identify weak entities related to the same owner entity. administrators work at this level.3. External LevelAt the execution of the database is [Link] thing is that
In the ER diagram, both the weak entity and its external level, a database contains several schemas that the simultaneous execution that is performed should be
corresponding relationship are represented using a sometimes called as subschema. The subschema is used done in an interleaved manner, and no operation should
double line and the partial key is underlined with a to describe the different view of the [Link] affect the other executing operations, thus maintaining
dotted [Link] the given ER diagram, Dependent is the external schema is also known as view [Link] the consistency of the database. Thus, on making the
view schema describes the database part that a concurrent execution of the transaction operations,
particular user group is interested and hides the there occur several challenging problems that need to
remaining database from that user [Link] view be solved.#Problems with Concurrent Execution:-In a
schema describes the end user interaction with database transaction, the two main operations
database [Link] Normal Form (3NF):A relation are READ and WRITE operations. So, there is a need to
is in third normal form, if there is no transitive manage these two operations in the concurrent
dependency for non-prime attributes as well as it is in execution of the transactions as if these operations are
second normal form. not performed in an interleaved manner, and the data
may become inconsistent. #Problem 1: Lost Update
##3rd normal form -A relation is in 3NF if at least one of Problems (W - W Conflict):-For example:Consider the
weak entity and it depends on the strong entity the following condition holds in every non-trivial below diagram where two transactions TX and TY, are
Employee via the relationship Depends on. There can be function dependency X –> Y:#X is a super key.#Y is a performed on the same account A where the balance of
an employee without a dependent in the Company but prime attribute (each element of Y is part of some account A is $300.
there will be no record of the Dependent in the candidate key).#In other words,A relation that is in First
company systems unless the dependent is associated and Second Normal Form and in which no non-primary-
with an Employee.#Strong Entity is complete by itself key attribute is transitively dependent on the primary
and is not dependent on any other entity type. It key, then it is in Third Normal Form (3NF).Note – If A->B
possess a primary key which describes each instance in and B->C are two FDs then A->C is called transitive
the strong entity set uniquely. That means any element [Link] normalization of 2NF relations to 3NF
in the strong entity set can be uniquely identified. A involves the removal of transitive dependencies. If a
Strong entity is represented by a square with a single transitive dependency exists, we remove the transitively
line unlike a Weak Entity which contained double lines. dependent attribute(s) from the relation by placing the
attribute(s) in a new relation along with a copy of the
[Link] the examples given below.
Example-1:In relation STUDENT given in Table 4,
Problem 2: Dirty Read Problems (W-R Conflict):-For
example:Consider two transactions TX and TY in the
below diagram performing read/write operations on
account A where the available balance in account A is
FD set:{STUD_NO -> STUD_NAME, STUD_NO -> $300:
STUD_STATE, STUD_STATE -> STUD_COUNTRY,
STUD_NO -> STUD_AGE}Candidate Key:
##Integrity Constraints Integrity constraints are a set of {STUD_NO},For this relation in table 4, STUD_NO ->
rules. It is used to maintain the quality of information. STUD_STATE and STUD_STATE -> STUD_COUNTRY are
Integrity constraints ensure that the data insertion, true. So STUD_COUNTRY is transitively dependent on
updating, and other processes have to be performed in STUD_NO. It violates the third normal form. To convert
such a way that data integrity is not affected. Thus, it in third normal form, we will decompose the relation
integrity constraint is used to guard against accidental STUDENT (STUD_NO, STUD_NAME, STUD_PHONE,
damage to the database. Types of Integrity Constraint 1. STUD_STATE, STUD_COUNTRY_STUD_AGE) as:
Domain constraints Domain constraints can be defined
as the definition of a valid set of values for an attribute.
The data type of domain includes string, character, Example-2:Consider relation R(A, B,
integer, time, date, currency, etc. The value of the C, D, E). Problem 3: Unrepeatable Read Problem (W-R Conflict)
attribute must be available in the corresponding All possible candidate keys in above For example:Consider two transactions, TX and TY,
domain. Example:2. Entity integrity constraints The relation are {A, E, CD, BC} All performing the read/write operations on account A,
entity integrity constraint states that primary key value attribute are on right sides of all having an available balance = $300. The diagram is
can't be null. This is because the primary key value is functional dependencies are prime. shown below:
used to identify individual rows in relation and if the Note –Third Normal Form (3NF) is
primary key has a null value, then we can't identify considered adequate for normal
those rows.A table can contain a null value other than relational database design because
the primary key [Link]. Referential Integrity most of the 3NF tables are free of
Constraints A referential integrity constraint is specified insertion, update, and deletion
between two [Link] the Referential integrity anomalies. Moreover, 3NF always ensures functional
constraints, if a foreign key in Table 1 refers to the dependency preserving and lossless.
Primary Key of Table 2, then every value of the Foreign
Key in Table 1 must be null or be available in Table ##Two-phase locking (2PL)The two-phase locking
[Link]. Key constraintsKeys are the entity set that protocol divides the execution phase of the transaction
is used to identify an entity within its entity set into three [Link] the first part, when the execution of
uniquely. An entity set can have multiple keys, but out the transaction starts, it seeks permission for the lock it
of which one key will be the primary key. A primary key [Link] the second part, the transaction acquires all
can contain a unique and null value in the relational the locks. The third phase is started as soon as the
[Link]: transaction releases its first [Link] the third phase, the ##Query optimization is of great importance for the
performance of a relational database, especially for the
##Three level ArchitectureThe three-level architecture is transaction cannot demand any new locks. It only execution of complex SQL statements. A query
also called ANSI/SPARC architecture or three- schema releases the acquired locks. optimizer decides the best methods for implementing
architecture. This framework is used to describe the each [Link] query optimizer selects, for instance,
structure of a specific database system. The three- whether or not to use indexes for a given query, and
schema architecture is also used to separate the user which join methods to use when joining multiple tables.
applications and physical database. The three-schema These decisions have a tremendous effect on SQL
architecture contains three-levels. It breaks the performance, and query optimization is a key
database down into three different categories. technology for every application, from operational
#The three-schema architecture is as follows: Systems to data warehouse and analytical systems to
content management systems.#There is the various
principle of Query Optimization are as follows
−[Link] how your database is executing your
There are two phases of 2PL:[Link] phase: In the [Link] as little data as possible [Link]
growing phase, a new lock on the data item may be intermediate results #There are various query
acquired by the transaction, but none can be released. optimization strategies are as follows− Use
[Link] phase: In the shrinking phase, existing lock Index, Aggregate Table, Vertical Partitioning, Horizontal
held by the transaction may be released, but no new Partitioning, De-normalization, Server Tuning,
locks can be [Link] lock conversion is allowed then
the following phase can happen:-Upgrading of lock ##Precedence graph, also known as serialization graph
(from S(a) to X (a)) is allowed in growing phase. or conflict graph, is used for testing Conflict
Downgrading of lock (from X(a) to S(a)) must be done in Serializability of a schedule in the condition that forms
shrinking the setting of concurrency control in databases.
[Link]: It is also known as a directed Graph G = (V, E), which
The following way consists of a pair of a set of nodes V = {V1, V2, V3, ...,
shows how unlocking Vn} and a set of directed edges E = {E1, E2, E3, ..., Em}.
In the above diagram:[Link] shows the DBMS and locking work with Where the set of nodes V are testing to retrieve
[Link] is used to transform the request 2-PL. identical data attribute through the transactions of a
and response between various database levels of Transaction T1: schedule and the set of edges E is regulated connectivity
[Link] not good for small DBMS because it Growing phase: from between a set of two [Link]: In the graph, for
takes more [Link] External / Conceptual mapping, it step 1-3,Shrinking each transaction Tp the graph contains a single node.
is necessary to transform the request from external phase: from step 5- So, In a schedule of a precedence graph, The total
level to conceptual [Link] Conceptual / Internal 7,Lock point: at 3 number of transactions will be similar to the total
mapping, DBMS transform the request from the Transaction T2: number of [Link]: An edge is regulated
conceptual to internal level.1. Internal Level The internal Growing phase: from connectivity between a set of two distinct
level has an internal schema which describes the step 2-6,Shrinking transactions Tq and Tr and it shows in the format Tq –
physical storage structure of the database. The internal phase: from step 8- >Tr, where Tq is the beginning of the edge and Tr is the
schema is also known as a physical schema. It uses the 9,Lock point: at 6 ending.
physical data model. It is used to define that how the
data will be stored in a block. The physical level is used
to describe complex low-level data structures in detail.
Downloaded by CAN CARTOR (rudhratech94123@[Link])
lOMoARcPSD|26772591

##Indexing is a data structure technique to efficiently ##A Distributed Database Management System ##Fragmentation is a process of dividing the whole or
retrieve records from the database files based on some (DDBMS) contains a single logical database that is full database into various subtables or sub relations so
attributes on which the indexing has been done. divided into a number of fragments. Every fragment that data can be stored in different systems. The small
Indexing in database systems is similar to what we see gets stored on one or more computers under the pieces of sub relations or subtables are called
in books. We know that data is stored in the form of control of a separate DBMS, with the computers fragments. These fragments are called logical data units
records. Every record has a key field, which helps it to connected by a communications network. Each position and are stored at various sites. It must be made sure
be recognized [Link] is defined based on its is capable of independently process every user's request that the fragments are such that they can be used to
indexing attributes. Indexing can be of the following that require access to local data (i.e., each position of reconstruct the original relation (i.e, there isn't any loss
types −[Link] Index − Primary index is defined on an the distributed system has some basic degree of local of data). In the fragmentation process, let's say, If a
ordered data file. The data file is ordered on a key field. autonomy) and is also able to process data stored on table Tis fragmented and is divided into a number of
The key field is generally the primary key of the relation. other computers within the network. Users access the fragments say T1, T2, T3..TN. The fragments contain
[Link] Index − Secondary index may be generated distributed database via applications that are classified sufficient information to allow the restoration of the
from a field which is a candidate key and has a unique as those which do not need data from other sites (local original table T. This restoration can be done by the use
value in every record, or a non-key with duplicate applications); and also, those that do need data from of UNION or JOlIN operation on various fragments. This
[Link] Index − Clustering index is defined other sites (global applications). You will be requiring a process is called data fragmentation. All of these
on an ordered data file. The data file is ordered on a DDBMS to have at least one global application.#some fragments are independent which means these
non-key field#Ordered Indexing is of two types – examples of distributed databases include Apache fragments can not be derived from others. The users
[Link] Index:-In dense index, there is an index record Ignite, Apache Cassandra, Apache HBase, Couchbase needn't be logically concerned about fragmentation
for every search key value in the database. This makes Server, Amazon SimpleDB, Clusterpoint, and which means they should not concerned that the data is
searching faster but requires more space to store index [Link] Ignite specializes in storing and fragmented and this is called fragmentation
records itself. Index records contain search key value computing large volumes of data across clusters of Independence or we can say fragmentation
and a pointer to the actual record on the disk. [Link] and disadvantage:-Organization's [Link]: As the data is stored close to
choice: Many organizations are distributed over several the usage site, the efficiency of the database system will
locations. It is natural for databases used in such an increase Local query optimization methods are sufficient
application to be spread over these [Link] for some queries as the data is available locally In order
availability: A failure at one site of a DDBMS, or a failure to maintain the security and privacy of the database
of a communication link making some sites unreachable, system, fragmentation is advantageous Disadvantages:
does not make the entire system inoperable. Distributed Access speeds may be very high if data from different
DBMSs are designed to carry on the function despite fragments are needed If we are using recursive
[Link] Index:-In sparse index, index records are not such [Link] performance: With the concept fragmentation, then it will be very expensive We have
created for every search key. An index record here of parallelism of distributed DBMSs, the speed of three methods for data fragmenting of a table:
contains a search key and an actual pointer to the data database access may be better than that achievable Harizontal fragmentation Vertical fragmentation Mixed
on the disk. To search a record, we first proceed by from a remote centralized database. or Hybrid fragmentation
index record and reach at the actual location of the
data. If the data we are looking for is not where we ##Checkpoint:-The checkpoint is a type of mechanism ##BCNF and 3NF and verify the statement "any relation
directly reach by following the index, then the system where all the previous logs are removed from the in BCNF is in 3NF but converse is not true.":-Consider
starts sequential search until the desired data is found. system and permanently stored in the storage [Link] the schema and functional dependency set of Empdept
checkpoint is like a bookmark. While the execution of given below:Empdept (emp# ,Dept#, Manager#,
the transaction, such checkpoints are marked, and the Dept_Name , Dept_Loc),Emp#Dept#  manager#
transaction is executed then using the steps of the manager#  Dept #Normalisation:-1st normal form: the
transaction, the log files will be [Link] it reaches relion is already in 1nf as each cell is single valued.2nd
to the checkpoint, then the transaction will be updated Normal form: A relation is in second normal form if it is
into the database, and till that point, the entire log file 1NF and every non key attribute is fully dependent on
will be removed from the file. Then the log file is each candidate key of the relation. Thus R is also in 2NF.
##Difference Between B-tree and Binary tree updated with the new step of transaction till next 3rd Normal form: A relation is in second normal form if
checkpoint and so [Link] checkpoint is used to declare it is 2NF and every non key attribute is non-transitively
a point before which the DBMS was in the consistent dependent on each candidate key of the relation. This
state, and all transactions were committed.#Recovery above relation is in 3NF as every non key attribute is
using CheckpointIn the following manner, a recovery non-transitively dependent on each candidate key of the
system recovers the database from this failure: [Link] primary key is emp# and candidate key is
The recovery system reads (emp# ,Dept#, Manager#)BCNF Normal form: A relation
log files from the end to is in second normal form if it is 3NF and if X->A in R and
start. It reads log files from A is not in X, then X is a candidate key. The above
T4 to T1. relations satisfy this [Link] above relation is not
Recovery system maintains in BCNF as in Fd manager#  Dept # , dept# is
two lists, a redo-list, and dependent on manager# but manager#is not in
B-tree and Binary tree are the types of non-linear data an undo-list. candidate key.
structure. Although the terms seem to be similar but are The transaction is put into
different in all aspects. A binary tree is used when the redo state if the recovery ## Normalization is a systematic approach of
records or data is stored in the RAM instead of disk as system sees a log with <Tn, decomposing tables to eliminate data redundancy
the accessing speed of RAM is much higher than the Start> and <Tn, Commit> (repetition) and undesirable characteristics like
disk. On the other hand, B-tree is used when the data is or just <Tn, Commit>. In the redo-list and their previous Insertion, Update and Deletion Anomalies. It is a multi-
stored in the disk it reduces the access time by reducing list, all the transactions are removed and then redone step process that puts data into tabular form, removing
the height of the tree and increasing the branches in the before saving their logs.#Relevance of Checkpoints :-A duplicated data from the relation tables.#Normalization
node.#Another difference between the B-tree and the checkpoint is used for recovery if there is an unexpected is used for mainly two purposes, [Link]
binary tree is that B-tree must have all of its child nodes shutdown in the database. Checkpoints work on some redundant(useless) [Link] data dependencies
on the same level whereas binary tree does not have intervals and write all dirty pages (modified pages) from make sense i.e data is logically stored.#Normalization
such constraint. A binary tree can have maximum 2 logs relay to data file from i.e from a buffer to physical rules are divided into the following normal forms:[Link]
subtrees or nodes whereas in B-tree can have M no of [Link] example: In the log file, transaction T2 and T3 Normal Form (1NF)[Link] should only have single(atomic)
subtrees or nodes where M is the order of the B-tree. will have <Tn, Start> and <Tn, Commit>. The T1 valued attributes/[Link] stored in a column
transaction will have only <Tn, commit> in the log file. should be of the same [Link] the columns in a
## Clustered index:-Cluster index is a type of index That's why the transaction is committed after the table should have unique [Link] the order in
which sorts the data rows in the table on their key checkpoint is crossed. Hence it puts T1, T2 and T3 which data is stored, does not [Link] Normal
values. In the Database, there is only one clustered transaction into redo [Link] transaction is put into Form (2NF)[Link] should be in the First Normal form.2.
index per table.A clustered index defines the order in undo state if the recovery system sees a log with <Tn, And, it should not have Partial [Link]
which data is stored in the table which can be sorted in Start> but no commit or abort log found. In the undo- Normal Form (3NF)1. It is in the Second Normal form.
only one way. So, there can be an only a single clustered list, all the transactions are undone, and their logs are [Link], it doesn't have Transitive [Link]
index for every table. In an RDBMS, usually, the primary [Link] example: Transaction T4 will have <Tn, and Codd Normal Form (BCNF)Boyce and Codd Normal
key allows you to create a clustered index based on that Start>. So T4 will be put into undo list since this Form is a higher version of the Third Normal form. This
specific column.#Clustered index implementation-SQL transaction is not yet complete and failed amid. form deals with certain type of anomaly that is not
Server allows you to specify the type of the index that handled by 3NF. A 3NF table which does not have
will be created automatically when you create a ## Data Replication is the process of storing data in multiple overlapping candidate keys is said to be in
UNIQUE constraint to be clustered index, if there is no more than one site or node. This is necessary for BCNF. For a table to be in BCNF, following conditions
clustered index created on that table, due to the fact improving the availability of data. There can be full must be satisfied:-1.R must be in 3rd Normal
that, only one clustered index can be created per each replication, in which a copy of the whole database is [Link], for each functional dependency ( X → Y ), X
table.# Non-clustered index:-A Non-clustered index stored at every site. There can also be partial should be a super [Link] Normal Form (4NF)[Link] is
stores the data at one location and indices at another replication, in which case, some fragment (important in the Boyce-Codd Normal [Link], it doesn't have
location. The index contains pointers to the location of frequently· used fragments) of the database are Multi-Valued Dependency.
that data. A single table can have many non-clustered replicated and others are not replicated. There are a
indexes as an index in the non-clustered index is stored number of advantages and disadvantages to replication. ##Keys help you to identify any row of data in a table. In
in different places.#For example, a book can have more For example, data can be copied between two on- a real-world application, a table could contain
than one index, one at the beginning which displays the premises hosts, between hosts in different locations, to thousands of records. Moreover, the records could be
contents of a book unit wise while the second index multiple storage devices on the same host, or to or from duplicated. Keys in RDBMS ensure that you can uniquely
shows the index of terms in alphabetical order. a cloud-based host. Data can be copied on demand or identify a table record despite these challenges.
be transferred in bulk or in batches according to a Allows you to establish a relationship between and
##Centralized database management system is the schedule, or be replicated in real time as the data is identify the relation between tables
system in which all the data is stored and managed in a written, changed, or deleted in the master source. Help you to enforce identity and integrity in the
single unit. This is also known as central computer #There are two types of data replication:1. Synchronous relationship.#Types of Keys in DBMS (Database
database system. This system is mostly used in an Replication:In synchronous replication, the replica will Management System)There are mainly Eight different
organization, in any Business Company or in institution be modified immediately after some changes are made types of Keys in DBMS and each key has it’s different
to centralize the tasks. Data can be accessed through a in the relation table. So there is no difference between functionality:Let’s look at each of the keys in DBMS with
network Local Area Network (LAN) or Wide Area original data and replica2. Asynchronous replication :In example:Super Key – A super key is a group of single or
Network (WAN). Mainframe computer is the example asynchronous replication, the replica will be modified multiple keys which identifies rows in a [Link]
of centralized database management system. after commit is fired on to the [Link] of Key – is a column or group of columns in a table that
[Link] of centralized [Link] query Data ReplicationAvailability,Increased parallelism,Less uniquely identify every row in that [Link] Key
processing.#The basic function of centralized database Data Movement over NetworkDisadvantages of Data – is a set of attributes that uniquely identify tuples in a
management system is to provide facility and give ReplicationIncreased overhead on update,Require more table. Candidate Key is a super key with no repeated
access to all the connected computers which fulfill all disk space,Expensive [Link] Key – is a column or group of
requirements requested by any single [Link] columns in a table that uniquely identify every row in
central unit,[Link],[Link]#Advantage of that [Link] Key – is a column that creates a
centralized database system:Data integrity, Data relationship between two tables. The purpose of
redundancy,Data security, Scalability and localization, Foreign keys is to maintain data integrity and allow
Data portability, Lesser cost and maintenance, navigation between two different instances of an entity.
#Disadvantage of centralized database systemSlow
processing,Less efficiency,Loss of data

Downloaded by CAN CARTOR (rudhratech94123@[Link])


lOMoARcPSD|26772591

##The role of Relational Algebra in query optimization- ##A two-phase commit is a standardized protocol that
When a query is placed, it is at first scanned, parsed and ensures that a database commit is implementing in the
validated. An internal representation of the query is situation where a commit operation must be broken
then created such as a query tree or a query graph. into two separate parts.
Then alternative execution strategies are devised for In database management, saving data changes is known
retrieving results from the database tables.#Relational as a commit and undoing changes is known as a
AlgebrRelational algebra is a procedural query language, rollback.
which takes instances of relations as input and yields #Phase 1 - Each server that needs to commit data writes
instances of relations as output. It uses operators to its data records to the log. If a server is unsuccessful, it
perform queries. An operator can be responds with a failure message. If successful, the server
either unary or binary. They accept relations as their replies with an OK message.
input and yield relations as their output. Relational #Phase 2 - This phase begins after all participants
algebra is performed recursively on a relation and respond OK. Then, the coordinator sends a signal to
intermediate results are also considered [Link] each server with commit instructions. After committing,
fundamental operations of relational algebra are as each writes the commit as part of its log record for
follows −[Link] different reference and sends the coordinator a message that its
[Link] Product [Link] Operation (σ) commit has been successfully implemented. If a server
It selects tuples that satisfy the given predicate from a fails, the coordinator sends instructions to all servers to
[Link] − σp(r)Where σ stands for selection roll back the transaction. After the servers roll back,
predicate and r stands for relation. p is prepositional each sends feedback that this has been completed.
logic formula which may use connectors like and,
or, and not. These terms may use relational operators ##Transaction:-The transaction is a set of logically
like − =, ≠, ≥, < , >, ≤.For example −σsubject = related operation. It contains a group of tasks. A
"database"(Books,Output − Selects tuples from books transaction is an action or series of actions. It is
where subject is 'database'.σsubject = "database" and performed by a single user to perform operations for
price = "450"(Books),Output − Selects tuples from books accessing the contents of the database.
where subject is 'database' and 'price' is 450. Example: Suppose an employee of bank transfers Rs 800
σsubject = "database" and price = "450" or year > from X's account to Y's account. This small transaction
"2010"(Books),Output − Selects tuples from books contains several low-level tasks: X's Account:-
where subject is 'database' and 'price' is 450 or those 1.Open_Account(X), 2.Old_Balance=[Link],
books published after [Link] Operation (∏) 3.New_Balance=Old_Balance-800,
It projects column(s) that satisfy a given predicate. [Link] = New_Balance, 5.Close_Account(X)
Notation − ∏A1, A2, An (r),Where A1, A2 , An are Y's Account:-1.Open_Account(Y),
attribute names of relation rDuplicate rows are 2.Old_Balance=[Link], 3.New_Balance=Old_Balance
automatically eliminated, as relation is a [Link] + 800, [Link]=New_Balance, 5.Close_Account(Y)
example ∏subject, author (Books),Selects and projects #Transaction property:-The transaction has the four
columns named as subject and author from the relation properties. These are used to maintain consistency in a
[Link] Operation (∪):-It performs binary union database, before and after the transaction.
between two given relations and is defined as −r ∪ s = { #Property of Transaction:-[Link]:-It states that all
t | t ∈ r or t ∈ s},r ∪ s = { t | t ∈ r or t ∈ s} operations of the transaction take place at once if not,
Relational Algebra is procedural query language, which the transaction is [Link] is no midway, i.e., the
takes Relation as input and generate relation as output. transaction cannot occur partially. Each transaction is
Relational algebra mainly provides theoretical treated as one unit and either run to completion or is
foundation for relational databases and SQL. Operators not executed at [Link] involves the following two
in Relational Algebra. Projection (π) Projection is used to operations: [Link]: If a transaction aborts then all the
project required column data from a [Link] changes made are not [Link]: If a transaction
databases are known as relational databases, and have commits then all the changes made are visible.
a table-based data structure, with a strict, predefined Example: Let's assume
schema required. NoSQL databases, or non-relational that following transaction
databases, can be document based, graph databases, T consisting of T1 and T2.
key-value pairs, or wide-column stores. A consists of Rs 600 and B
consists of Rs 300.
##Database managers develop and maintain Transfer Rs 100 from
organizations' databases. They create data storage and account A to account B.
retrieval systems, troubleshoot database issues, and After completion of the
implement database recovery procedures and safety transaction, A consists of
protocols. They also supervise the daily activities of Rs 500 and B consists of
database teams. Data is the cornerstone of any modern Rs 400.
software application, and databases are the most [Link]:-The integrity constraints are maintained
common way to store and manage data used by so that the database is consistent before and after the
[Link] the explosion of web and cloud [Link] execution of a transaction will leave a
technologies, databases have evolved from traditional database in either its prior stable state or a new stable
relational databases to more advanced types of [Link] example: The total amount must be
databases such as NoSQL, columnar, key-value, maintained before or after the transaction.
hierarchical, and distributed databases. Each type has [Link] before T occurs = 600+300=900 [Link] after T o
the ability to handle structured, semi-structured, and ccurs= 500+400=900 [Link]:-It shows that the data
even unstructured dataOn top of that, databases are which is used at the time of execution of a transaction
continuously handling mission-critical and sensitive cannot be used by the second transaction until the first
data. When this is coupled with compliance one is [Link] isolation, if the transaction T1 is
requirements and the distributed nature of most data being executed and using the data item X, then that
sets, managing databases has become highly complex. data item can't be accessed by any other transaction T2
As a result, organizations require robust, secure, and until the transaction T1 [Link]:-The durability
user-friendly tools to maintain these databases. property is used to indicate the performance of the
Components of a database management system database's consistent state. It states that the transaction
[Link] [Link] [Link] processor. made the permanent [Link] recovery subsystem
[Link] engine. [Link] catalog. [Link] of the DBMS has the responsibility of Durability
manager. [Link] and monitoring [Link] property.
utilities.
##A Data Dictionary is a collection of names, definitions,
and attributes about data elements that are being used
or captured in a database, information system, or part
of a research project. It describes the meanings and
purposes of data elements within the context of a
project, and provides guidance on interpretation,
accepted meanings and representation. A Data
Dictionary also provides metadata about data elements.
The metadata included in a Data Dictionary can assist in
defining the scope and characteristics of data elements,
as well the rules for their usage and application.
Why Use a Data Dictionary?Data Dictionaries are useful
for a number of reasons. In short, they:[Link] in
avoiding data inconsistencies across a [Link]
define conventions that are to be used across a project.
[Link] consistency in the collection and use of data
across multiple members of a research [Link]
data easier to [Link] the use of Data
[Link] Are Data Standards and Why Should I
Use Them?Data Standards are rules that govern the way
data are collected, recorded, and represented.
Standards provide a commonly understood reference
for the interpretation and use of data sets.
By using standards, researchers in the same disciplines
will know that the way their data are being collected
and described will be the same across different projects.
Using Data Standards as part of a well-crafted Data
Dictionary can help increase the usability of your
research data, and will ensure that data will be
recognizable and usable beyond the immediate research
team.

Downloaded by CAN CARTOR (rudhratech94123@[Link])


• Memory Hierarchy • Input/Output (I/O) Devices or • Instruction Set Characteristics
• Memory hierarchy organizes External or Peripheral Devices • The instruction set of a computer
memory types by speed, cost, and • I/O devices are used to interact with defines the machine language
size, balancing performance and the computer, allowing data to be instructions that the CPU can
efficiency. It typically includes: inputted into or outputted from the execute. Key characteristics
• Registers: Smallest and fastest, system. Common I/O devices include:
located in the CPU. include: • Operation Codes (Opcodes):
• Cache Memory: Fast, used to store • Keyboards: For inputting text and Specify the operations to be
frequently accessed data. commands. performed.
• Main Memory (RAM): Primary • Mice: For navigating and • Operands: The data or the
storage for active data. interacting with the graphical user addresses of the data.
• Secondary Memory: Non-volatile interface. • Instruction Formats: Layout of
storage like HDDs and SSDs. • Monitors: For displaying visual instructions in bits.
• Tertiary Storage: External storage output. • Addressing Modes: Methods for
options, including cloud storage. • Printers: For producing hard copies specifying operands.
• RAM (Random Access Memory) of digital documents. • Instruction Set Design
• Volatile memory used for • Scanners: For digitizing physical Considerations
temporary data storage. It is documents. • When designing an instruction set,
primary storage for running • The Input/Output Interface considerations include:
applications and active data. • The I/O interface manages • Complexity: Balancing simplicity
• ROM (Read-Only Memory) communication between the CPU for ease of use and complexity for
• Non-volatile memory used for and peripheral devices, ensuring functionality.
permanent data storage. It retains data is transferred smoothly. It • Efficiency: Minimizing the number
information even when the power is includes: of instructions and execution time.
off. • Ports: Physical connectors on a • Compatibility: Ensuring backward
• DRAM (Dynamic RAM) computer (e.g., USB, HDMI). compatibility with older systems.
• A type of RAM that needs periodic • Buses: Pathways for data transfer • Scalability: Ability to support
refreshing to retain data, commonly within the system (e.g., PCI, USB). future enhancements.
used in main memory. • The Device Controllers and its • Operand Data Types
• Flash Memory Structure • Types of data operands can include:
• Non-volatile memory used in USB • Device controllers are hardware • Integers: Whole numbers.
drives, SSDs, and memory cards. It components that manage specific • Floating-Point Numbers: Decimal
offers fast read/write times and is I/O devices. They translate high- numbers.
suitable for portable storage. level commands from the CPU into • Characters: ASCII or Unicode
• Secondary Memory device-specific operations. Key characters.
• Persistent storage for long-term data elements include: • Addresses: Memory locations.
retention. Includes: • Control Registers: Hold • Types of Instructions
• Hard Disk Drives (HDDs): commands and statuses. • Instructions can be classified into
Magnetic storage with large • Buffers: Temporary storage for various types, such as:
capacity. data being transferred. • Data Transfer Instructions: Move
• Optical Memories: CDs, DVDs, • Device Drivers data between registers and memory
and Blu-ray discs. • Software that allows the operating (e.g., LOAD, STORE).
• CCDs (Charge-Coupled Devices): system and application programs to • Arithmetic Instructions: Perform
Used in digital imaging. communicate with hardware mathematical operations (e.g.,
• Bubble Memories: Early non- devices. They provide a standard ADD, SUBTRACT).
volatile memory technology, now interface for interacting with • Logical Instructions: Perform
mostly obsolete. various devices. bitwise operations (e.g., AND, OR,
• RAID (Redundant Array of • Input Output Techniques NOT).
Independent Disks) • Various methods are used to • Control Instructions: Control the
• Technology that combines multiple facilitate data transfer between the flow of execution (e.g., JUMP,
disks into a single unit for enhanced CPU and I/O devices: CALL, RETURN).
performance and fault tolerance. • Programmed I/O: The CPU • Number of Addresses in an
Key RAID levels include: actively waits and checks for I/O Instruction
• RAID 0: Striping, no redundancy. operations to complete. • Instructions can have different
• RAID 1: Mirroring, full • Interrupt-Driven I/O: Devices numbers of addresses:
redundancy. send interrupts to signal the CPU • Zero-Address Instructions:
• RAID 5: Striping with parity, when they need attention, allowing Implicit operands (e.g., stack
balanced performance and the CPU to perform other tasks in operations).
the meantime.
redundancy. • One-Address Instructions: One
• RAID 6: Double parity, allows • Direct Memory Access (DMA): explicit operand.
Allows devices to transfer data
recovery from two simultaneous • Two-Address Instructions: Two
disk failures. directly to/from memory without
explicit operands.
• involving the CPU, improving
High Speed Memories • Three-Address Instructions:
efficiency.
• Cache Memory: Stores frequently Three explicit operands.
• Interrupt-Processing
accessed data for quick retrieval. • Addressing Schemes
• • Mechanisms to handle interrupts,
Cache Organisation: Structures • Addressing schemes specify how
cache levels (L1, L2, L3) to which temporarily halt the CPU's
the operands of an instruction are
optimize speed and size. current operations to service I/O
determined. Types include:
requests. It involves:
• Memory Interleaving: Increases • Immediate Addressing: Operand is
speed by distributing memory • Interrupt Handlers: Special
part of the instruction.
routines that execute in response to
addresses across multiple modules. • Direct Addressing: Address of the
interrupts.
• Associative Memory operand is given in the instruction.
• Also known as content-addressable • Priority Levels: To manage • Indirect Addressing: Address of
memory (CAM), this type of multiple interrupts, assigning the operand is found in a memory
memory is accessed based on the importance to different types. location specified by the instruction.
content rather than the address. • External Communication • Register Addressing: Operand is in
• Virtual Memory Interfaces a register.
• Extends the physical memory by • Interfaces that facilitate • Register Indirect Addressing:
using a portion of the disk to communication between the Register contains the address of the
simulate additional RAM, allowing computer and external devices or operand.
larger programs to run on systems networks, including: • Indexed Addressing: Base address
with limited physical memory. • USB (Universal Serial Bus): A and an index register are used to
• Instruction Decode (ID): standard interface for connecting find the operand.
Decoding the fetched instruction. peripheral devices. • Base Register Addressing: Similar
• Execute (EX): Performing the • Ethernet: For wired network to indexed addressing but uses a
operation specified by the connections. base register.
instruction. • Bluetooth: For wireless • Relative Addressing Scheme:
• Memory Access (MEM): communication with nearby Address is relative to the current
Accessing memory if needed (for devices. program counter.
load/store instructions). • Stack Addressing: Operand is on
• Write Back (WB): Writing the top of the stack.
result back to the register file. • Instruction Set and Format
• Benefits of Pipelining: Design Issues
• Increased Throughput: Multiple • Issues related to designing
instructions are processed • Execute (EX): Performing the instruction sets and formats include:
simultaneously. operation specified by the • Instruction Length: Fixed or
• Efficient Resource Utilization: instruction. variable length.
Keeps CPU components busy, • Memory Access (MEM): • Allocation of Bits: Number of bits
enhancing overall performance. Accessing memory if needed (for allocated to opcode and operands.
• Pipelining Challenges: load/store instructions). • Variable Length of Instructions:
• Hazards: Issues like data hazards, • Write Back (WB): Writing the Instructions of different lengths to
control hazards, and structural result back to the register file. optimize encoding.
hazards can disrupt the smooth flow • Benefits of Pipelining:
of the pipeline. • Increased Throughput: Multiple
• Data Hazards: When instructions instructions are processed
depend on the results of previous simultaneously.
instructions. • Efficient Resource Utilization:
• Control Hazards: Caused by Keeps CPU components busy,
branch instructions. enhancing overall performance.
• Structural Hazards: Resource • Pipelining Challenges:
conflicts when the hardware cannot • Hazards: Issues like data hazards,
support all operations. control hazards, and structural
• Mitigation Techniques: hazards can disrupt the smooth flow
• Forwarding: Passes the result of a of the pipeline.
previous instruction to a subsequent • Data Hazards: When instructions
instruction without writing it back depend on the results of previous
to the register file. instructions.
• Control Hazards: Caused by
branch instructions.
Branch Prediction: Predicts the outcome of
• Structural Hazards: Resource
branch instructions to minimize control
conflicts when the hardware cannot
hazards
support all operations.
• Mitigation Techniques:
• Forwarding: Passes the result of a
previous instruction to a subsequent
instruction without writing it back
to the register file.
• Branch Prediction: Predicts the
outcome of branch instructions to
minimize control hazards.



• Instruction Execution: An • Logic Gates • Sequential Circuits: The
Example • Logic gates are the basic building Definition
• This involves fetching an blocks of digital circuits. They • Sequential circuits are digital
instruction from memory, decoding perform basic logical functions and circuits in which the output depends
it to understand what action is are represented by symbols. not only on the present input but
required, and then executing it. This Common logic gates include AND, also on the history of inputs. They
cycle repeats for each instruction in OR, NOT, NAND, NOR, XOR, and have memory elements to store
a program. XNOR. information.
• Instruction Cycle • Logic Circuits • Flip-Flops
• The steps the CPU goes through to • Logic circuits are interconnected • Flip-flops are basic memory
execute an instruction: logic gates designed to perform elements in sequential circuits that
• Fetch: Retrieve an instruction from specific functions. They can be can store one bit of information.
memory. classified into combinational and They have two stable states
• Decode: Interpret the instruction. sequential circuits. (bistable) and can be used to store
• Execute: Perform the required • Combinational Circuits binary data.
action. • These circuits do not have memory • Basic Flip-Flops
• Store: Write back the result if elements; their output depends only • SR (Set-Reset) Flip-Flop: Has Set
necessary. on the current inputs. Examples (S) and Reset (R) inputs.
• Interrupts include adders, subtractors, • D (Data) Flip-Flop: Captures the
• Mechanisms that allow the CPU to multiplexers, and encoders. value of the data input at a
pause its current task and respond to • Canonical and Standard Forms particular instance.
urgent events, such as I/O • Canonical forms are standardized • JK Flip-Flop: A more versatile
operations. ways of writing logical expressions. flip-flop with J and K inputs.
• Interrupts and Instruction Cycle Two main types: • T (Toggle) Flip-Flop: Toggles its
• Interrupts can occur during the • Sum of Products (SOP): A logical state on each clock pulse if enabled.
instruction cycle, causing the CPU expression where ANDed terms are • Excitation Tables
to save its state and execute an ORed together. • Excitation tables define the required
interrupt service routine before • Product of Sums (POS): A logical inputs for a flip-flop to transition
returning to the original task. expression where ORed terms are from the current state to the next
• Computers: Then and Now ANDed together. state.
• The Beginning • Minimization of Gates • Master-Slave Flip-Flops
• Early computers were mechanical • This involves reducing the number • These consist of two flip-flops
or electro-mechanical devices used of logic gates used in a circuit (master and slave) and are used to
for simple calculations. without changing its output. eliminate timing issues. The master
• First Generation Computers Techniques include Karnaugh maps is triggered by the clock's leading
• (1940s-1950s): Used vacuum tubes and Boolean algebra. edge, and the slave is triggered by
for circuitry and magnetic drums • Design of Combinational Circuits the trailing edge.
for memory. They were large, • The process involves: • Edge Triggered Flip-Flops
expensive, and generated a lot of • Defining the problem and • These change state only on the edge
heat. determining the required outputs. (rising or falling) of the clock
• Second Generation Computers • Creating the truth table. signal, ensuring synchronized data
• (1950s-1960s): Transistors replaced • Deriving the logical expression. transfer.
vacuum tubes, making computers • Simplifying the expression. • Sequential Circuit Design
smaller, faster, more reliable, and • Implementing the circuit using logic • The process involves:
energy-efficient. gates. • State Diagram: Graphical
• Third Generation Computers • Examples of Logic Combinational representation of the states and
• (1960s-1970s): Integrated circuits Circuits [Link] Diagram:
replaced transistors, further • Adders: Circuits that perform Creating a circuit diagram using the
reducing size and cost while addition. Types include half adders selected flip-flops and logic gates.
increasing speed and reliability. and full adders. • Examples of Sequential Circuits
• Later Generations • Decoders: Convert binary • Registers: Groups of flip-flops used
• Fourth Generation: information from n input lines to a to store multiple bits of data.
Microprocessors and personal maximum of 2^n unique output • Counters: Devices that count
computers. lines. pulses and produce a specific output
• Fifth Generation and Beyond: • Multiplexer (MUX): A device that sequence.
Includes advancements in artificial selects one of several input signals • Asynchronous Counters
intelligence, quantum computing, and forwards the selected input to a • These counters change state with
and nanotechnology. single output line. changes in input (ripple effect),
• Encoder: Performs the reverse leading to potential timing issues.
operation of a decoder, converting • Synchronous Counters
information from 2^n inputs to an • All flip-flops are triggered
n-bit code. simultaneously by a common clock
• Programmable Logic Array signal, eliminating timing issues.
(PLA) • RAM (Random Access Memory)
• A type of programmable logic • A type of volatile memory used for
device used to implement temporary data storage. It allows
combinational logic circuits. It data to be read from and written to
consists of a set of AND gates and memory locations directly
OR gates with programmable
interconnections.
• Introduction to RISC • Microcomputer Architecture • MUL: Multiply operands.
• RISC stands for Reduced • Microcomputers, also known as • DIV: Divide operands.
Instruction Set Computer. It's a personal computers, are built • Bit Manipulation Instructions
CPU design philosophy that around a microprocessor. The 8086 • Operate on specific bits of a data
emphasizes simplicity and is a notable example of an early word. Examples:
efficiency. RISC processors use a microprocessor used in many • AND: Perform a bitwise AND.
small, highly optimized set of microcomputers. • OR: Perform a bitwise OR.
instructions, enabling faster • Structure of 8086 CPU • XOR: Perform a bitwise XOR.
execution compared to traditional • The 8086 CPU has a 16-bit • NOT: Perform a bitwise NOT.
Complex Instruction Set Computer architecture and can address up to • Program Execution Transfer
(CISC) processors. 1MB of memory. Key components Instructions
• RISC Architecture include: • Control the flow of execution.
• RISC architecture features include: • ALU (Arithmetic Logic Unit): Examples:
• Simple Instructions: Each Performs arithmetic and logical • JMP: Jump to a specified address.
instruction performs a small, simple operations.
• CALL: Call a procedure.
task. • CU (Control Unit): Directs
• RET: Return from a procedure.
• Fixed-Length Instructions: Easier operations within the CPU.
• JZ: Jump if zero flag is set.
to decode and pipeline. • Registers: Small storage locations
• String Instructions
• Load/Store Architecture: Only within the CPU.
• Operate on strings of data.
load and store instructions access • BIU (Bus Interface Unit): Handles
Examples:
memory; all other instructions communication between the CPU
operate on register contents. and memory/peripheral devices. • MOVSB: Move byte from source
string to destination string.
• Large Number of Registers: • EU (Execution Unit): Executes
Reduces the number of memory instructions and processes data. • MOVSW: Move word from source
string to destination string.
accesses, which are slower than • Register Set of 8086
• CMPS: Compare strings.
register accesses. • The 8086 has a variety of registers
• The Use of Large Register File • SCAS: Scan a string for a specific
divided into:
• value.
RISC processors typically have a • General Purpose Registers:
• Processor Control Instructions
large number of general-purpose • AX (Accumulator): Used for
registers. This allows more data to arithmetic operations. • Control the operation of the CPU.
Examples:
be kept close to the CPU, • BX (Base Register): Used for
minimizing slower memory indexing. • HLT: Halt the processor.
accesses. Benefits include: • WAIT: Wait for the processor to be
• CX (Count Register): Used for
• Reduced Memory Bottlenecks: loop counters.
ready.
Frequent memory accesses are • STI: Set interrupt flag.
• DX (Data Register): Used for I/O
avoided. operations. • CLI: Clear interrupt flag.
• Faster Context Switching: More • Segment Registers: • Addressing Modes
registers mean that data can be kept • CS (Code Segment): Points to the • The 8086 supports various
in registers during context switches, segment containing the executable addressing modes to specify
speeding up multitasking. code. operands:
• Comments on RISC • DS (Data Segment): Points to the • Register Addressing Mode
• RISC has several advantages and segment containing data. • The operand is a register.
some trade-offs: • SS (Stack Segment): Points to the • Immediate Addressing Mode
• Advantages: segment containing the stack. • The operand is a constant value
• Simplicity: Simplified hardware • ES (Extra Segment): Additional within the instruction.
design. data segment. • Direct Addressing Mode
• Efficiency: Faster instruction • Pointer and Index Registers: • The operand's address is specified
execution due to pipelining. • SP (Stack Pointer): Points to the directly in the instruction.
• Performance: High performance top of the stack. • Indirect Addressing Mode
with a higher instruction • BP (Base Pointer): Used to access • The address of the operand is held
throughput. stack data. in a register.
• Trade-offs: • SI (Source Index) and DI • Example of Addressing Modes
• Compiler Dependency: Requires (Destination Index): Used for • Immediate: MOV AX, 5
sophisticated compilers to translate string operations. (Immediate value 5 is moved to
high-level code into efficient RISC • Flag Register: Indicates the status AX)
instructions. of the CPU after operations. • Direct: MOV AX, [1234H]
• Program Size: More instructions • Instruction Set of 8086 (Content at memory address 1234H
may be needed to perform complex
• The instruction set includes various is moved to AX)
tasks, potentially increasing • Indirect: MOV AX, [BX]
types of instructions:
program size.
• Data Transfer Instructions (Content at address held in BX is
• RISC Pipelining
• Move data between registers, moved to AX)
• RISC processors make extensive memory, and I/O ports. Examples: • Register: MOV AX, BX (Content
use of pipelining to enhance
• MOV: Move data from one location of BX is moved to AX)
performance. Pipelining involves
to another.
overlapping different stages of
• PUSH: Push data onto the stack.
instruction execution to improve
throughput. • POP: Pop data from the stack.
• Stages of RISC Pipeline: • Arithmetic Instructions
• Instruction Fetch (IF): Fetching • Perform arithmetic operations.
Examples:
• ADD: Add two operands

You might also like