pre test examinationpre test examination · 2020-04-27 · baud rate: in case of data communication...
TRANSCRIPT
Pre Test ExaminationPre Test ExaminationPre Test ExaminationPre Test Examination
SyllabusSyllabusSyllabusSyllabus
Subject Computer ScienceSubject Computer ScienceSubject Computer ScienceSubject Computer Science
Class XIIClass XIIClass XIIClass XII
1 Sequential Logic Circuits
2 Computer Networking
3 Database Management System
A G Sir
Computer Networks
What is a computer Network
A network is any collection of independent computers that communicate with one another over a shared network medium A computer network is a collection of two or more connected computers When these computers are joined in a network people can share files and peripherals such as modems printers tape backup drives or CD-ROM drives When networks at multiple locations are connected using services available from phone companies people can send e-mail share links to the global Internet or conduct video conferences in real time with other remote users When a network becomes open sourced it can be managed properly with online collaboration software As companies rely on applications like electronic mail and database management for core business operations computer networking becomes increasingly more important Every network includes
bull At least two computers Server or Client workstation bull Networking Interface Cards (NIC) bull A connection medium usually a wire or cable although wireless communication
between networked computers and peripherals is also possible bull Network Operating system software such as Microsoft Windows NT or 2000 Novell
NetWare Unix and Linux
Importance of networking 1gt Resource sharing Without depending on where the computers are data can be shared
between the users
2gt High Reliability Data are stored in more than one machines because if one source is
crashed then the data can be accessed from another source So there is high
reliability
3gt Saving Money Using main frame computer system very much costly That is why network
system is used commonly
4gt Security In network system there is enough security No one can erase data easily
Some topics related to network i) Terminal Any input-output device used to send and receive data in a network
system is known as terminal Example Computers telephone Fax machine Sound box
etc
ii) Telecommunication Processors These are devices which support data transmission
and reception between terminals and computers Example Modem Multiplexers Front-
end Processor etc
iii) Telecommunication Channel and Media The media over which data are transmitted
and received are called Telecommunication Channel Example Optical Fiber Cable
Radio wave etc
iv) Computer Besides the micro computers used by the end user the computers are
used to send or processing information Various types of computers are used in
network
v) Telecommunication Software Telecommunication software consists of programs
These reside in host computer systems communication control computers and end user
computers
Data Signal Data are sent in the form of electrical signals in computer network Electrical signal means change of voltage with change of time When voltage is zero and
then the voltage gradually increases and reaches the maximum point then there is a
change in voltage After that it goes down with the decrease of voltage
Bandwidth Bandwidth is the difference between highest and lowest frequency in a
transmission medium It is the measure of how much data can be transmitted per second in
a particular transmission medium The unit of bandwidth for analog data is Kilohertz
(KHz) and for digital data are Kbps Mbps Gbps etc
Baud Rate In case of data communication Baud rate is the measure of number of times the
signal changes its value (voltage) Therefore baud rate is the measure of signaling
speed
Communication Media It is a physical channel between transmitter and receiver in a data transmission system It
interconnects source with destination Transmission media is divided in two classes
1gt Bounded media (Guided Media)
2gt Unbounded Media (Unguided Media)
Bounded Media In bounded media the waves are guided along a solid medium like copper wire Bounded media use electrical cables or optical cables
Coaxial Cable
A coaxial cable consists of many small cables in a protective cover The cover shields the
cable from physical dangers as well as from electromagnetic interference Within the cover
the various cables are shielded from interference with one another Coaxial cables are used
in communication networks that require many simultaneous communication links Each coaxial
cable can provide more than 5000 links
Coaxial cable is a two-conductor cable in which one conductor forms an electromagnetic
shield around the other The two conductors are separated by insulation It is a constant
impedance transmission cable This media is used in base band and broadband transmission
Coaxial cables do not produce external electric and magnetic fields and are not affected by
them This makes them ideally suited although more expensive for transmitting signals
There are two types of coaxial cables baseband and broadband A baseband coaxial cable
transmits a single signal at a time at very high speed A broadband coaxial cable can
transmit many simultaneous signals using different frequencies A baseband cable is mainly
used for LANs A broadband coaxial cable can carry only an analog signal So it must be
used with a modem
Baseband coaxial cables are 50 ohm cables used for digital transmission For 1Km cables
the bandwidth is 1-2 Gbps Longer cables can be used with low data rates or periodic
amplifiers Broadband coaxial cables are 75 ohm cables used for analog transmission They
use standard cable television technology To transmit digital signals on an analog network
each interface must have converters ie analog to digital for outgoing bit stream n vice
versa another difference bw baseband and broadband is that broadband systems have
developed dual cables Since broadband is used for large area it requires amplifiers which
are unidirectional In dual band systems two identical cables run together one used for
outgoing data one for incoming data Different bandwidths are given for inbound and
outbound cables Eg for 300MHz 5-30MHz for inbound and 40-300MHz for outbound
Features
bull It provides better immunity than twisted pair
bull This cable is able to transmit data at higher rates
Limitations
bull High installation cost
bull High maintenance cost
b) Twisted-Pair cable
Twisted-pair cable is made up of pairs of copper wires twisted together in precisely
calculated fashions The wires carry more information when twisted Two varieties of
twisted-pair cable are
bull shielded twisted-pair cable
bull Unshielded twisted-pair cable
1)Shielded twisted-pair cable
Shielded twisted-pair cabling is more
thoroughly insulated or shielded This cabling
is more reliable and expensive It is easy to
install The twisted pair varies in quality and
capacity Quality and capacity depend upon the
number of twists per inch and how much
insulation it has By twisting the wires around
one another electromagnetic interference from
external sources is reduced By adding
shielding twisted pair is capable of
transmitting data at higher rates
2)Unshielded twisted pair cable
In unshielded twisted pair cabling the twisted pair cable is not shielded Some
organizations use existing telephone wiring for their LANs This telephone wiring is
usually unshielded twisted pair cable
The main disadvantage associated with this is low noise immunity During a telephone
conversation noise and interference from other electronic equipment takes the form of
static and is rarely loud enough to disrupt the call
But that same line can scramble a data transmission and require the sending device to
retransmit An excessive number of such retransmissions will reduce network efficiency
Features of twisted-pair cables
bull Inexpensive
bull Easy to install
bull Easy to tap
bull Can accommodate up to 1000 devices
Limitations
The network coverage area is between 300 feet and 1000 feet only
c) Fiber- optic cable
A fiber-optic cable consists of strands of glass-like thread Through the use of a
laser data are transmitted from one end of a cable to the other Fiber optic cables will
increase the capacity of like-sized coaxial cables by at least a factor of 10 This makes
them valuable for use in a variety of applications mainly in communication network
Features
bull Huge bandwidth
bull Optical fiber systems are not affected by external noise
bull The error rate for the data transmitted across fiber optic cable is very low
Limitations
bull Cost is high
bull Fibers fragility makes it more difficult to handle
Unbounded MediaWireless communication
1gt Radio Communication Radio frequency transmission deals with frequency in order of
30 MHz Below 30 MHz frequency reflected towards the earth due to ionospheric
characteristics whereas above 30 MHz propagation of signal is on the line of sight
path To increase the distance antennas are placed in between line of sight paths
In radio communication data transfer rate is about 100 ndash 400 Mbps
2gt Microwave Communication Microwave systems transmit high speed microwave signal in
a line of sight path between relay station space The waves can not bend with the
curvature of the earth So microwave links would in variable use line of transmission
along ground route by repeater station placed 100 ndash 200 Km apart The repeater copies
or repeats the signal and amplifies all the signals before retransmission Microwave
signals are relayed by antennas usually placed on the top of the buildings towers
hills and mountain peaks The data transfer rate through microwave link is about 1000
Mbps
3gt Communication Satellites Communication Satellites in space orbiting 22000 miles
above the earth are also used as microwave relay stations These rotate at precise
point and spread above the equator so that these appear stationary to microwave
transmitters on the ground An artificial satellite which appears stationary to an
observer on the earth is called geostationary satellite When such a satellite is
used for communication purpose is called communication on satellite The
communication satellite usually acts as a reflector It accepts the signals from one
point of the earth and returns the same signal to some other points on the earth
Data Transmission Modes
There are three transmission modes
1gt Simplex Transmission In this mode data is transferred in one direction only
and never in opposite direction It is suitable for receive only printers
These devices do not transmit information Example Communication between
keyboard and computer
2gt Half-duplex Transmission In this mode data is transferred in both direction
but not simultaneously Example Communication between Computer and disk
3gt Full-duplex Transmission In this mode data can be transferred in both
directions simultaneously Example Telephone
Several Ways of Transmitting Signal
Parallel Transmission Digital computer only understands binary digits (bit) ie lsquo0rsquo and lsquo1rsquo So in computer network data are sent in the form of bit stream (combination of lsquo0rsquos
Data Transmission
Parallel Serial
Asynchronous Synchronous
and lsquo1rsquos) When n numbers of bit of a n bit data are sent simultaneously then the transmission is called Parallel Transmission Advantage All the bits are sent at a time So the speed of transmission is very high Disadvantage For n bit data there is n number of communication channels are needed Serial Transmission In case of serial transmission only one communication channel is used and all the bits are sent through that channel one after another Advantage i) Only one channel is required ii) Not costly iii) Very useful for long distance Disadvantages i) Speed of transmission is much slower than Parallel Transmission ii) Data have to wait long time in data-queue iii) Time consuming 1gt Asynchronous Transmission According to Serial transmission in case of Asynchronous
transmission bits are sent one after another In this case characters (Generally of 8 bits ) are send on at a time Every character starts with a Start bit which is denoted by lsquo0rsquo After the start bit the 8 bits of character are sent After that a parity bit is sent for error detection if any Then stop bit is sent which is denoted by lsquo1rsquo After that the start bit of another character is sent When no character is sent then the communication channel is in idle situation which is in binary lsquo1rsquo situation (presence of negative voltage in line) In case of Asynchronous transmission timing problem can be avoided
2gt Synchronous Transmission Synchronous transmission is one type of Serial Transmission In this case a block of bits is transmitted without start and stop bit in the form of long frame There is no space between two frames
Difference between Asynchronous and Synchronous Transmission
Asynchronous Transmission Synchronous Transmission
i) Every character is sent separately ii) At the beginning and end of every character there is start bit and stop bit
iii) Constant bit rate iv) No limit of block length v) Low speed communication vi) Synchronisation errors results in loss of only one characters
i) Characters are sent like in the form of block
ii) There is no start bit or stop bit
iii) Constant bit rate over a block iv) Block length is fixed v) High speed communication vii) Synchronisation errors results in loss of complete block
Switching According to demand switch is needed to construct connection between two points in a network The construction of the said connection is called Switching There are three types of Switching
i) Circuit Switching It analogous to a simple telephone call When telephone call is made then the switching instruments of the telephone system search for physical link between sender and receiver telephone This technology is circuit switching technology The line is available for the duration of the call At the end of the
call circuit is broken and another location can be dialed and new circuit is established
ii) Message Switching In this type of switching technology no physical link between sender and receiver is needed Instead of that at first the data of the sender are stored in router in the form of block Then the blocks are sent by the router one after another Every block is received by router router examines for error and resends In case of message switching there is no fixed length for blocks Disk is needed to store long block in router and the blocks may wait for long times in router
iii) Packet Switching The problems in message switching can be overcome by Packet switching In this case there is maximum size for the blocks and they are called packets So there is no need for disk because it can be stored into the main memory of the router The advantages of packet switching over message switching are
1 The first packet of message containing many packets will be sent to receiver without depending on the second packet`s situation Therefore receiving and sending message can be done simultaneously by the router
2 It can avoid network congestion
Types of Networks Computer Networks fall into three classes regarding the size distance and the structure
namely LAN (Local Area Network) MAN (Metropolitan Area Network) WAN (Wide Area Network)
A LAN links a small group of functionally similar workstations within a local geographic
area such as a series of adjacent cubicles or offices on the same floor Once the Computer
network expands to include other floors or divers office within a metropolitan area it
becomes a MAN Finally a WAN is simply a LAN of LANs WANs expand the boundaries of
computer networking to a global or even galactic scale
LAN (Local Area Network)
A Local Area Network is a computer network covering a small Networks geographical
area like a home office or groups of buildings eg a school Network For example a
library will have a wired or wireless LAN Network for users to interconnect local
networking devices eg printers and servers to connect to the internet The defining
characteristics of LANs Network in contrast to Wide Area Networks (WANs) includes their
much higher data-transfer rates smaller geographic range and lack of need for leased
telecommunication lines Smaller Networks generally consist of a one or more switches
linked to each other - often with one connected to a router cable modem or DSL modem for
Internet access LANs Network may have connections with other LANs Network via leased
lines leased services
MAN (Metropolitan Area Network)
MAN stands for Metropolitan Area Networks is one of a number of types of networks A MAN (
Metropolitan Area Networks ) is a relatively new class of network MAN is larger than a
local area network (LAN) and as its name implies covers the area of a single city MANs (
Metropolitan Area Networks ) rarely extend beyond 100 KM and frequently comprise a
combination of different hardware and transmission media
The two most important components of MANs ( Metropolitan Area Networks ) are security and
standardization Security is important because information is being shared between
dissimilar systems Standardization is necessary to ensure reliable data communication
A MAN ( Metropolitan Area Networks ) usually interconnects a number of local area networks
(LANs) using a high-capacity backbone technology such as fiber-optical links and provides
up-link services to wide area networks (or WAN) and the Internet
MAN ( Metropolitan Area Network ) adopted technologies from both LAN (local area network)
and WAN (Wide Area Network) to serve its purpose Some legacy technologies used for MAN
( Metropolitan Area Network ) are ATM FDDI DQDB and SMDS These older technologies are in
the process of being displaced by Gigabit Ethernet and 10 Gigabit Ethernet At the physical
level MAN links between LANs (local area networks) have been built on fiber optical cables
or using wireless technologies such as microwave or radio
The Metropolitan Area Networks (MAN) protocols are mostly at the data link level (layer 2
in the OSI model ) which are defined by IEEE ITU-T etc
WAN (Wide Area Networks)
A wide area network (WAN) is a telecommunication network A wide area network is simply a
LAN of LANs or Network Of Networks WANs connect LANs (Local Area Networks) that may be on
opposite sides of a building across the country or around the world WANs (wide area
networks) are characterized by the slowest data communication rates and the largest
distances WANs (wide area networks) can be of two types an enterprise WAN (wide area
networks) and Global WAN (wide area networks)
Computers connected to a Wide Area Networks are often connected through public networks
such as the telephone system They can also be connected through leased lines or
satellites The largest WAN (wide area networks) in existence is the Internet Some
segments of the Internet like VPN (Virtual Private Networks) based extranets are also
WANs (wide area networks) in themselves Finally many WANs (wide area networks) are
corporate or research networks that utilize leased lines
Numerous WANs have been constructed including public packet networks large corporate
networks military networks banking networks stock brokerage networks and airline
reservation networks
Campus Area Network (CAN)
A campus area networks (CANs) is a computer network interconnecting a few local area
networks (LANs) within a university campus or corporate campus Network Campus area network
may link a variety of campus buildings A campus area network is larger than a local area
network but smaller than a metropolitan area network (MAN) or wide area network (WAN)CAN
can also stand for corporate area network
Topology
The term Computer Network topology defines the geographic arrangement of computer
networking devices It describes the actual layout of the computer network hardware Given
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
A G Sir
Computer Networks
What is a computer Network
A network is any collection of independent computers that communicate with one another over a shared network medium A computer network is a collection of two or more connected computers When these computers are joined in a network people can share files and peripherals such as modems printers tape backup drives or CD-ROM drives When networks at multiple locations are connected using services available from phone companies people can send e-mail share links to the global Internet or conduct video conferences in real time with other remote users When a network becomes open sourced it can be managed properly with online collaboration software As companies rely on applications like electronic mail and database management for core business operations computer networking becomes increasingly more important Every network includes
bull At least two computers Server or Client workstation bull Networking Interface Cards (NIC) bull A connection medium usually a wire or cable although wireless communication
between networked computers and peripherals is also possible bull Network Operating system software such as Microsoft Windows NT or 2000 Novell
NetWare Unix and Linux
Importance of networking 1gt Resource sharing Without depending on where the computers are data can be shared
between the users
2gt High Reliability Data are stored in more than one machines because if one source is
crashed then the data can be accessed from another source So there is high
reliability
3gt Saving Money Using main frame computer system very much costly That is why network
system is used commonly
4gt Security In network system there is enough security No one can erase data easily
Some topics related to network i) Terminal Any input-output device used to send and receive data in a network
system is known as terminal Example Computers telephone Fax machine Sound box
etc
ii) Telecommunication Processors These are devices which support data transmission
and reception between terminals and computers Example Modem Multiplexers Front-
end Processor etc
iii) Telecommunication Channel and Media The media over which data are transmitted
and received are called Telecommunication Channel Example Optical Fiber Cable
Radio wave etc
iv) Computer Besides the micro computers used by the end user the computers are
used to send or processing information Various types of computers are used in
network
v) Telecommunication Software Telecommunication software consists of programs
These reside in host computer systems communication control computers and end user
computers
Data Signal Data are sent in the form of electrical signals in computer network Electrical signal means change of voltage with change of time When voltage is zero and
then the voltage gradually increases and reaches the maximum point then there is a
change in voltage After that it goes down with the decrease of voltage
Bandwidth Bandwidth is the difference between highest and lowest frequency in a
transmission medium It is the measure of how much data can be transmitted per second in
a particular transmission medium The unit of bandwidth for analog data is Kilohertz
(KHz) and for digital data are Kbps Mbps Gbps etc
Baud Rate In case of data communication Baud rate is the measure of number of times the
signal changes its value (voltage) Therefore baud rate is the measure of signaling
speed
Communication Media It is a physical channel between transmitter and receiver in a data transmission system It
interconnects source with destination Transmission media is divided in two classes
1gt Bounded media (Guided Media)
2gt Unbounded Media (Unguided Media)
Bounded Media In bounded media the waves are guided along a solid medium like copper wire Bounded media use electrical cables or optical cables
Coaxial Cable
A coaxial cable consists of many small cables in a protective cover The cover shields the
cable from physical dangers as well as from electromagnetic interference Within the cover
the various cables are shielded from interference with one another Coaxial cables are used
in communication networks that require many simultaneous communication links Each coaxial
cable can provide more than 5000 links
Coaxial cable is a two-conductor cable in which one conductor forms an electromagnetic
shield around the other The two conductors are separated by insulation It is a constant
impedance transmission cable This media is used in base band and broadband transmission
Coaxial cables do not produce external electric and magnetic fields and are not affected by
them This makes them ideally suited although more expensive for transmitting signals
There are two types of coaxial cables baseband and broadband A baseband coaxial cable
transmits a single signal at a time at very high speed A broadband coaxial cable can
transmit many simultaneous signals using different frequencies A baseband cable is mainly
used for LANs A broadband coaxial cable can carry only an analog signal So it must be
used with a modem
Baseband coaxial cables are 50 ohm cables used for digital transmission For 1Km cables
the bandwidth is 1-2 Gbps Longer cables can be used with low data rates or periodic
amplifiers Broadband coaxial cables are 75 ohm cables used for analog transmission They
use standard cable television technology To transmit digital signals on an analog network
each interface must have converters ie analog to digital for outgoing bit stream n vice
versa another difference bw baseband and broadband is that broadband systems have
developed dual cables Since broadband is used for large area it requires amplifiers which
are unidirectional In dual band systems two identical cables run together one used for
outgoing data one for incoming data Different bandwidths are given for inbound and
outbound cables Eg for 300MHz 5-30MHz for inbound and 40-300MHz for outbound
Features
bull It provides better immunity than twisted pair
bull This cable is able to transmit data at higher rates
Limitations
bull High installation cost
bull High maintenance cost
b) Twisted-Pair cable
Twisted-pair cable is made up of pairs of copper wires twisted together in precisely
calculated fashions The wires carry more information when twisted Two varieties of
twisted-pair cable are
bull shielded twisted-pair cable
bull Unshielded twisted-pair cable
1)Shielded twisted-pair cable
Shielded twisted-pair cabling is more
thoroughly insulated or shielded This cabling
is more reliable and expensive It is easy to
install The twisted pair varies in quality and
capacity Quality and capacity depend upon the
number of twists per inch and how much
insulation it has By twisting the wires around
one another electromagnetic interference from
external sources is reduced By adding
shielding twisted pair is capable of
transmitting data at higher rates
2)Unshielded twisted pair cable
In unshielded twisted pair cabling the twisted pair cable is not shielded Some
organizations use existing telephone wiring for their LANs This telephone wiring is
usually unshielded twisted pair cable
The main disadvantage associated with this is low noise immunity During a telephone
conversation noise and interference from other electronic equipment takes the form of
static and is rarely loud enough to disrupt the call
But that same line can scramble a data transmission and require the sending device to
retransmit An excessive number of such retransmissions will reduce network efficiency
Features of twisted-pair cables
bull Inexpensive
bull Easy to install
bull Easy to tap
bull Can accommodate up to 1000 devices
Limitations
The network coverage area is between 300 feet and 1000 feet only
c) Fiber- optic cable
A fiber-optic cable consists of strands of glass-like thread Through the use of a
laser data are transmitted from one end of a cable to the other Fiber optic cables will
increase the capacity of like-sized coaxial cables by at least a factor of 10 This makes
them valuable for use in a variety of applications mainly in communication network
Features
bull Huge bandwidth
bull Optical fiber systems are not affected by external noise
bull The error rate for the data transmitted across fiber optic cable is very low
Limitations
bull Cost is high
bull Fibers fragility makes it more difficult to handle
Unbounded MediaWireless communication
1gt Radio Communication Radio frequency transmission deals with frequency in order of
30 MHz Below 30 MHz frequency reflected towards the earth due to ionospheric
characteristics whereas above 30 MHz propagation of signal is on the line of sight
path To increase the distance antennas are placed in between line of sight paths
In radio communication data transfer rate is about 100 ndash 400 Mbps
2gt Microwave Communication Microwave systems transmit high speed microwave signal in
a line of sight path between relay station space The waves can not bend with the
curvature of the earth So microwave links would in variable use line of transmission
along ground route by repeater station placed 100 ndash 200 Km apart The repeater copies
or repeats the signal and amplifies all the signals before retransmission Microwave
signals are relayed by antennas usually placed on the top of the buildings towers
hills and mountain peaks The data transfer rate through microwave link is about 1000
Mbps
3gt Communication Satellites Communication Satellites in space orbiting 22000 miles
above the earth are also used as microwave relay stations These rotate at precise
point and spread above the equator so that these appear stationary to microwave
transmitters on the ground An artificial satellite which appears stationary to an
observer on the earth is called geostationary satellite When such a satellite is
used for communication purpose is called communication on satellite The
communication satellite usually acts as a reflector It accepts the signals from one
point of the earth and returns the same signal to some other points on the earth
Data Transmission Modes
There are three transmission modes
1gt Simplex Transmission In this mode data is transferred in one direction only
and never in opposite direction It is suitable for receive only printers
These devices do not transmit information Example Communication between
keyboard and computer
2gt Half-duplex Transmission In this mode data is transferred in both direction
but not simultaneously Example Communication between Computer and disk
3gt Full-duplex Transmission In this mode data can be transferred in both
directions simultaneously Example Telephone
Several Ways of Transmitting Signal
Parallel Transmission Digital computer only understands binary digits (bit) ie lsquo0rsquo and lsquo1rsquo So in computer network data are sent in the form of bit stream (combination of lsquo0rsquos
Data Transmission
Parallel Serial
Asynchronous Synchronous
and lsquo1rsquos) When n numbers of bit of a n bit data are sent simultaneously then the transmission is called Parallel Transmission Advantage All the bits are sent at a time So the speed of transmission is very high Disadvantage For n bit data there is n number of communication channels are needed Serial Transmission In case of serial transmission only one communication channel is used and all the bits are sent through that channel one after another Advantage i) Only one channel is required ii) Not costly iii) Very useful for long distance Disadvantages i) Speed of transmission is much slower than Parallel Transmission ii) Data have to wait long time in data-queue iii) Time consuming 1gt Asynchronous Transmission According to Serial transmission in case of Asynchronous
transmission bits are sent one after another In this case characters (Generally of 8 bits ) are send on at a time Every character starts with a Start bit which is denoted by lsquo0rsquo After the start bit the 8 bits of character are sent After that a parity bit is sent for error detection if any Then stop bit is sent which is denoted by lsquo1rsquo After that the start bit of another character is sent When no character is sent then the communication channel is in idle situation which is in binary lsquo1rsquo situation (presence of negative voltage in line) In case of Asynchronous transmission timing problem can be avoided
2gt Synchronous Transmission Synchronous transmission is one type of Serial Transmission In this case a block of bits is transmitted without start and stop bit in the form of long frame There is no space between two frames
Difference between Asynchronous and Synchronous Transmission
Asynchronous Transmission Synchronous Transmission
i) Every character is sent separately ii) At the beginning and end of every character there is start bit and stop bit
iii) Constant bit rate iv) No limit of block length v) Low speed communication vi) Synchronisation errors results in loss of only one characters
i) Characters are sent like in the form of block
ii) There is no start bit or stop bit
iii) Constant bit rate over a block iv) Block length is fixed v) High speed communication vii) Synchronisation errors results in loss of complete block
Switching According to demand switch is needed to construct connection between two points in a network The construction of the said connection is called Switching There are three types of Switching
i) Circuit Switching It analogous to a simple telephone call When telephone call is made then the switching instruments of the telephone system search for physical link between sender and receiver telephone This technology is circuit switching technology The line is available for the duration of the call At the end of the
call circuit is broken and another location can be dialed and new circuit is established
ii) Message Switching In this type of switching technology no physical link between sender and receiver is needed Instead of that at first the data of the sender are stored in router in the form of block Then the blocks are sent by the router one after another Every block is received by router router examines for error and resends In case of message switching there is no fixed length for blocks Disk is needed to store long block in router and the blocks may wait for long times in router
iii) Packet Switching The problems in message switching can be overcome by Packet switching In this case there is maximum size for the blocks and they are called packets So there is no need for disk because it can be stored into the main memory of the router The advantages of packet switching over message switching are
1 The first packet of message containing many packets will be sent to receiver without depending on the second packet`s situation Therefore receiving and sending message can be done simultaneously by the router
2 It can avoid network congestion
Types of Networks Computer Networks fall into three classes regarding the size distance and the structure
namely LAN (Local Area Network) MAN (Metropolitan Area Network) WAN (Wide Area Network)
A LAN links a small group of functionally similar workstations within a local geographic
area such as a series of adjacent cubicles or offices on the same floor Once the Computer
network expands to include other floors or divers office within a metropolitan area it
becomes a MAN Finally a WAN is simply a LAN of LANs WANs expand the boundaries of
computer networking to a global or even galactic scale
LAN (Local Area Network)
A Local Area Network is a computer network covering a small Networks geographical
area like a home office or groups of buildings eg a school Network For example a
library will have a wired or wireless LAN Network for users to interconnect local
networking devices eg printers and servers to connect to the internet The defining
characteristics of LANs Network in contrast to Wide Area Networks (WANs) includes their
much higher data-transfer rates smaller geographic range and lack of need for leased
telecommunication lines Smaller Networks generally consist of a one or more switches
linked to each other - often with one connected to a router cable modem or DSL modem for
Internet access LANs Network may have connections with other LANs Network via leased
lines leased services
MAN (Metropolitan Area Network)
MAN stands for Metropolitan Area Networks is one of a number of types of networks A MAN (
Metropolitan Area Networks ) is a relatively new class of network MAN is larger than a
local area network (LAN) and as its name implies covers the area of a single city MANs (
Metropolitan Area Networks ) rarely extend beyond 100 KM and frequently comprise a
combination of different hardware and transmission media
The two most important components of MANs ( Metropolitan Area Networks ) are security and
standardization Security is important because information is being shared between
dissimilar systems Standardization is necessary to ensure reliable data communication
A MAN ( Metropolitan Area Networks ) usually interconnects a number of local area networks
(LANs) using a high-capacity backbone technology such as fiber-optical links and provides
up-link services to wide area networks (or WAN) and the Internet
MAN ( Metropolitan Area Network ) adopted technologies from both LAN (local area network)
and WAN (Wide Area Network) to serve its purpose Some legacy technologies used for MAN
( Metropolitan Area Network ) are ATM FDDI DQDB and SMDS These older technologies are in
the process of being displaced by Gigabit Ethernet and 10 Gigabit Ethernet At the physical
level MAN links between LANs (local area networks) have been built on fiber optical cables
or using wireless technologies such as microwave or radio
The Metropolitan Area Networks (MAN) protocols are mostly at the data link level (layer 2
in the OSI model ) which are defined by IEEE ITU-T etc
WAN (Wide Area Networks)
A wide area network (WAN) is a telecommunication network A wide area network is simply a
LAN of LANs or Network Of Networks WANs connect LANs (Local Area Networks) that may be on
opposite sides of a building across the country or around the world WANs (wide area
networks) are characterized by the slowest data communication rates and the largest
distances WANs (wide area networks) can be of two types an enterprise WAN (wide area
networks) and Global WAN (wide area networks)
Computers connected to a Wide Area Networks are often connected through public networks
such as the telephone system They can also be connected through leased lines or
satellites The largest WAN (wide area networks) in existence is the Internet Some
segments of the Internet like VPN (Virtual Private Networks) based extranets are also
WANs (wide area networks) in themselves Finally many WANs (wide area networks) are
corporate or research networks that utilize leased lines
Numerous WANs have been constructed including public packet networks large corporate
networks military networks banking networks stock brokerage networks and airline
reservation networks
Campus Area Network (CAN)
A campus area networks (CANs) is a computer network interconnecting a few local area
networks (LANs) within a university campus or corporate campus Network Campus area network
may link a variety of campus buildings A campus area network is larger than a local area
network but smaller than a metropolitan area network (MAN) or wide area network (WAN)CAN
can also stand for corporate area network
Topology
The term Computer Network topology defines the geographic arrangement of computer
networking devices It describes the actual layout of the computer network hardware Given
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
v) Telecommunication Software Telecommunication software consists of programs
These reside in host computer systems communication control computers and end user
computers
Data Signal Data are sent in the form of electrical signals in computer network Electrical signal means change of voltage with change of time When voltage is zero and
then the voltage gradually increases and reaches the maximum point then there is a
change in voltage After that it goes down with the decrease of voltage
Bandwidth Bandwidth is the difference between highest and lowest frequency in a
transmission medium It is the measure of how much data can be transmitted per second in
a particular transmission medium The unit of bandwidth for analog data is Kilohertz
(KHz) and for digital data are Kbps Mbps Gbps etc
Baud Rate In case of data communication Baud rate is the measure of number of times the
signal changes its value (voltage) Therefore baud rate is the measure of signaling
speed
Communication Media It is a physical channel between transmitter and receiver in a data transmission system It
interconnects source with destination Transmission media is divided in two classes
1gt Bounded media (Guided Media)
2gt Unbounded Media (Unguided Media)
Bounded Media In bounded media the waves are guided along a solid medium like copper wire Bounded media use electrical cables or optical cables
Coaxial Cable
A coaxial cable consists of many small cables in a protective cover The cover shields the
cable from physical dangers as well as from electromagnetic interference Within the cover
the various cables are shielded from interference with one another Coaxial cables are used
in communication networks that require many simultaneous communication links Each coaxial
cable can provide more than 5000 links
Coaxial cable is a two-conductor cable in which one conductor forms an electromagnetic
shield around the other The two conductors are separated by insulation It is a constant
impedance transmission cable This media is used in base band and broadband transmission
Coaxial cables do not produce external electric and magnetic fields and are not affected by
them This makes them ideally suited although more expensive for transmitting signals
There are two types of coaxial cables baseband and broadband A baseband coaxial cable
transmits a single signal at a time at very high speed A broadband coaxial cable can
transmit many simultaneous signals using different frequencies A baseband cable is mainly
used for LANs A broadband coaxial cable can carry only an analog signal So it must be
used with a modem
Baseband coaxial cables are 50 ohm cables used for digital transmission For 1Km cables
the bandwidth is 1-2 Gbps Longer cables can be used with low data rates or periodic
amplifiers Broadband coaxial cables are 75 ohm cables used for analog transmission They
use standard cable television technology To transmit digital signals on an analog network
each interface must have converters ie analog to digital for outgoing bit stream n vice
versa another difference bw baseband and broadband is that broadband systems have
developed dual cables Since broadband is used for large area it requires amplifiers which
are unidirectional In dual band systems two identical cables run together one used for
outgoing data one for incoming data Different bandwidths are given for inbound and
outbound cables Eg for 300MHz 5-30MHz for inbound and 40-300MHz for outbound
Features
bull It provides better immunity than twisted pair
bull This cable is able to transmit data at higher rates
Limitations
bull High installation cost
bull High maintenance cost
b) Twisted-Pair cable
Twisted-pair cable is made up of pairs of copper wires twisted together in precisely
calculated fashions The wires carry more information when twisted Two varieties of
twisted-pair cable are
bull shielded twisted-pair cable
bull Unshielded twisted-pair cable
1)Shielded twisted-pair cable
Shielded twisted-pair cabling is more
thoroughly insulated or shielded This cabling
is more reliable and expensive It is easy to
install The twisted pair varies in quality and
capacity Quality and capacity depend upon the
number of twists per inch and how much
insulation it has By twisting the wires around
one another electromagnetic interference from
external sources is reduced By adding
shielding twisted pair is capable of
transmitting data at higher rates
2)Unshielded twisted pair cable
In unshielded twisted pair cabling the twisted pair cable is not shielded Some
organizations use existing telephone wiring for their LANs This telephone wiring is
usually unshielded twisted pair cable
The main disadvantage associated with this is low noise immunity During a telephone
conversation noise and interference from other electronic equipment takes the form of
static and is rarely loud enough to disrupt the call
But that same line can scramble a data transmission and require the sending device to
retransmit An excessive number of such retransmissions will reduce network efficiency
Features of twisted-pair cables
bull Inexpensive
bull Easy to install
bull Easy to tap
bull Can accommodate up to 1000 devices
Limitations
The network coverage area is between 300 feet and 1000 feet only
c) Fiber- optic cable
A fiber-optic cable consists of strands of glass-like thread Through the use of a
laser data are transmitted from one end of a cable to the other Fiber optic cables will
increase the capacity of like-sized coaxial cables by at least a factor of 10 This makes
them valuable for use in a variety of applications mainly in communication network
Features
bull Huge bandwidth
bull Optical fiber systems are not affected by external noise
bull The error rate for the data transmitted across fiber optic cable is very low
Limitations
bull Cost is high
bull Fibers fragility makes it more difficult to handle
Unbounded MediaWireless communication
1gt Radio Communication Radio frequency transmission deals with frequency in order of
30 MHz Below 30 MHz frequency reflected towards the earth due to ionospheric
characteristics whereas above 30 MHz propagation of signal is on the line of sight
path To increase the distance antennas are placed in between line of sight paths
In radio communication data transfer rate is about 100 ndash 400 Mbps
2gt Microwave Communication Microwave systems transmit high speed microwave signal in
a line of sight path between relay station space The waves can not bend with the
curvature of the earth So microwave links would in variable use line of transmission
along ground route by repeater station placed 100 ndash 200 Km apart The repeater copies
or repeats the signal and amplifies all the signals before retransmission Microwave
signals are relayed by antennas usually placed on the top of the buildings towers
hills and mountain peaks The data transfer rate through microwave link is about 1000
Mbps
3gt Communication Satellites Communication Satellites in space orbiting 22000 miles
above the earth are also used as microwave relay stations These rotate at precise
point and spread above the equator so that these appear stationary to microwave
transmitters on the ground An artificial satellite which appears stationary to an
observer on the earth is called geostationary satellite When such a satellite is
used for communication purpose is called communication on satellite The
communication satellite usually acts as a reflector It accepts the signals from one
point of the earth and returns the same signal to some other points on the earth
Data Transmission Modes
There are three transmission modes
1gt Simplex Transmission In this mode data is transferred in one direction only
and never in opposite direction It is suitable for receive only printers
These devices do not transmit information Example Communication between
keyboard and computer
2gt Half-duplex Transmission In this mode data is transferred in both direction
but not simultaneously Example Communication between Computer and disk
3gt Full-duplex Transmission In this mode data can be transferred in both
directions simultaneously Example Telephone
Several Ways of Transmitting Signal
Parallel Transmission Digital computer only understands binary digits (bit) ie lsquo0rsquo and lsquo1rsquo So in computer network data are sent in the form of bit stream (combination of lsquo0rsquos
Data Transmission
Parallel Serial
Asynchronous Synchronous
and lsquo1rsquos) When n numbers of bit of a n bit data are sent simultaneously then the transmission is called Parallel Transmission Advantage All the bits are sent at a time So the speed of transmission is very high Disadvantage For n bit data there is n number of communication channels are needed Serial Transmission In case of serial transmission only one communication channel is used and all the bits are sent through that channel one after another Advantage i) Only one channel is required ii) Not costly iii) Very useful for long distance Disadvantages i) Speed of transmission is much slower than Parallel Transmission ii) Data have to wait long time in data-queue iii) Time consuming 1gt Asynchronous Transmission According to Serial transmission in case of Asynchronous
transmission bits are sent one after another In this case characters (Generally of 8 bits ) are send on at a time Every character starts with a Start bit which is denoted by lsquo0rsquo After the start bit the 8 bits of character are sent After that a parity bit is sent for error detection if any Then stop bit is sent which is denoted by lsquo1rsquo After that the start bit of another character is sent When no character is sent then the communication channel is in idle situation which is in binary lsquo1rsquo situation (presence of negative voltage in line) In case of Asynchronous transmission timing problem can be avoided
2gt Synchronous Transmission Synchronous transmission is one type of Serial Transmission In this case a block of bits is transmitted without start and stop bit in the form of long frame There is no space between two frames
Difference between Asynchronous and Synchronous Transmission
Asynchronous Transmission Synchronous Transmission
i) Every character is sent separately ii) At the beginning and end of every character there is start bit and stop bit
iii) Constant bit rate iv) No limit of block length v) Low speed communication vi) Synchronisation errors results in loss of only one characters
i) Characters are sent like in the form of block
ii) There is no start bit or stop bit
iii) Constant bit rate over a block iv) Block length is fixed v) High speed communication vii) Synchronisation errors results in loss of complete block
Switching According to demand switch is needed to construct connection between two points in a network The construction of the said connection is called Switching There are three types of Switching
i) Circuit Switching It analogous to a simple telephone call When telephone call is made then the switching instruments of the telephone system search for physical link between sender and receiver telephone This technology is circuit switching technology The line is available for the duration of the call At the end of the
call circuit is broken and another location can be dialed and new circuit is established
ii) Message Switching In this type of switching technology no physical link between sender and receiver is needed Instead of that at first the data of the sender are stored in router in the form of block Then the blocks are sent by the router one after another Every block is received by router router examines for error and resends In case of message switching there is no fixed length for blocks Disk is needed to store long block in router and the blocks may wait for long times in router
iii) Packet Switching The problems in message switching can be overcome by Packet switching In this case there is maximum size for the blocks and they are called packets So there is no need for disk because it can be stored into the main memory of the router The advantages of packet switching over message switching are
1 The first packet of message containing many packets will be sent to receiver without depending on the second packet`s situation Therefore receiving and sending message can be done simultaneously by the router
2 It can avoid network congestion
Types of Networks Computer Networks fall into three classes regarding the size distance and the structure
namely LAN (Local Area Network) MAN (Metropolitan Area Network) WAN (Wide Area Network)
A LAN links a small group of functionally similar workstations within a local geographic
area such as a series of adjacent cubicles or offices on the same floor Once the Computer
network expands to include other floors or divers office within a metropolitan area it
becomes a MAN Finally a WAN is simply a LAN of LANs WANs expand the boundaries of
computer networking to a global or even galactic scale
LAN (Local Area Network)
A Local Area Network is a computer network covering a small Networks geographical
area like a home office or groups of buildings eg a school Network For example a
library will have a wired or wireless LAN Network for users to interconnect local
networking devices eg printers and servers to connect to the internet The defining
characteristics of LANs Network in contrast to Wide Area Networks (WANs) includes their
much higher data-transfer rates smaller geographic range and lack of need for leased
telecommunication lines Smaller Networks generally consist of a one or more switches
linked to each other - often with one connected to a router cable modem or DSL modem for
Internet access LANs Network may have connections with other LANs Network via leased
lines leased services
MAN (Metropolitan Area Network)
MAN stands for Metropolitan Area Networks is one of a number of types of networks A MAN (
Metropolitan Area Networks ) is a relatively new class of network MAN is larger than a
local area network (LAN) and as its name implies covers the area of a single city MANs (
Metropolitan Area Networks ) rarely extend beyond 100 KM and frequently comprise a
combination of different hardware and transmission media
The two most important components of MANs ( Metropolitan Area Networks ) are security and
standardization Security is important because information is being shared between
dissimilar systems Standardization is necessary to ensure reliable data communication
A MAN ( Metropolitan Area Networks ) usually interconnects a number of local area networks
(LANs) using a high-capacity backbone technology such as fiber-optical links and provides
up-link services to wide area networks (or WAN) and the Internet
MAN ( Metropolitan Area Network ) adopted technologies from both LAN (local area network)
and WAN (Wide Area Network) to serve its purpose Some legacy technologies used for MAN
( Metropolitan Area Network ) are ATM FDDI DQDB and SMDS These older technologies are in
the process of being displaced by Gigabit Ethernet and 10 Gigabit Ethernet At the physical
level MAN links between LANs (local area networks) have been built on fiber optical cables
or using wireless technologies such as microwave or radio
The Metropolitan Area Networks (MAN) protocols are mostly at the data link level (layer 2
in the OSI model ) which are defined by IEEE ITU-T etc
WAN (Wide Area Networks)
A wide area network (WAN) is a telecommunication network A wide area network is simply a
LAN of LANs or Network Of Networks WANs connect LANs (Local Area Networks) that may be on
opposite sides of a building across the country or around the world WANs (wide area
networks) are characterized by the slowest data communication rates and the largest
distances WANs (wide area networks) can be of two types an enterprise WAN (wide area
networks) and Global WAN (wide area networks)
Computers connected to a Wide Area Networks are often connected through public networks
such as the telephone system They can also be connected through leased lines or
satellites The largest WAN (wide area networks) in existence is the Internet Some
segments of the Internet like VPN (Virtual Private Networks) based extranets are also
WANs (wide area networks) in themselves Finally many WANs (wide area networks) are
corporate or research networks that utilize leased lines
Numerous WANs have been constructed including public packet networks large corporate
networks military networks banking networks stock brokerage networks and airline
reservation networks
Campus Area Network (CAN)
A campus area networks (CANs) is a computer network interconnecting a few local area
networks (LANs) within a university campus or corporate campus Network Campus area network
may link a variety of campus buildings A campus area network is larger than a local area
network but smaller than a metropolitan area network (MAN) or wide area network (WAN)CAN
can also stand for corporate area network
Topology
The term Computer Network topology defines the geographic arrangement of computer
networking devices It describes the actual layout of the computer network hardware Given
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
Coaxial cables do not produce external electric and magnetic fields and are not affected by
them This makes them ideally suited although more expensive for transmitting signals
There are two types of coaxial cables baseband and broadband A baseband coaxial cable
transmits a single signal at a time at very high speed A broadband coaxial cable can
transmit many simultaneous signals using different frequencies A baseband cable is mainly
used for LANs A broadband coaxial cable can carry only an analog signal So it must be
used with a modem
Baseband coaxial cables are 50 ohm cables used for digital transmission For 1Km cables
the bandwidth is 1-2 Gbps Longer cables can be used with low data rates or periodic
amplifiers Broadband coaxial cables are 75 ohm cables used for analog transmission They
use standard cable television technology To transmit digital signals on an analog network
each interface must have converters ie analog to digital for outgoing bit stream n vice
versa another difference bw baseband and broadband is that broadband systems have
developed dual cables Since broadband is used for large area it requires amplifiers which
are unidirectional In dual band systems two identical cables run together one used for
outgoing data one for incoming data Different bandwidths are given for inbound and
outbound cables Eg for 300MHz 5-30MHz for inbound and 40-300MHz for outbound
Features
bull It provides better immunity than twisted pair
bull This cable is able to transmit data at higher rates
Limitations
bull High installation cost
bull High maintenance cost
b) Twisted-Pair cable
Twisted-pair cable is made up of pairs of copper wires twisted together in precisely
calculated fashions The wires carry more information when twisted Two varieties of
twisted-pair cable are
bull shielded twisted-pair cable
bull Unshielded twisted-pair cable
1)Shielded twisted-pair cable
Shielded twisted-pair cabling is more
thoroughly insulated or shielded This cabling
is more reliable and expensive It is easy to
install The twisted pair varies in quality and
capacity Quality and capacity depend upon the
number of twists per inch and how much
insulation it has By twisting the wires around
one another electromagnetic interference from
external sources is reduced By adding
shielding twisted pair is capable of
transmitting data at higher rates
2)Unshielded twisted pair cable
In unshielded twisted pair cabling the twisted pair cable is not shielded Some
organizations use existing telephone wiring for their LANs This telephone wiring is
usually unshielded twisted pair cable
The main disadvantage associated with this is low noise immunity During a telephone
conversation noise and interference from other electronic equipment takes the form of
static and is rarely loud enough to disrupt the call
But that same line can scramble a data transmission and require the sending device to
retransmit An excessive number of such retransmissions will reduce network efficiency
Features of twisted-pair cables
bull Inexpensive
bull Easy to install
bull Easy to tap
bull Can accommodate up to 1000 devices
Limitations
The network coverage area is between 300 feet and 1000 feet only
c) Fiber- optic cable
A fiber-optic cable consists of strands of glass-like thread Through the use of a
laser data are transmitted from one end of a cable to the other Fiber optic cables will
increase the capacity of like-sized coaxial cables by at least a factor of 10 This makes
them valuable for use in a variety of applications mainly in communication network
Features
bull Huge bandwidth
bull Optical fiber systems are not affected by external noise
bull The error rate for the data transmitted across fiber optic cable is very low
Limitations
bull Cost is high
bull Fibers fragility makes it more difficult to handle
Unbounded MediaWireless communication
1gt Radio Communication Radio frequency transmission deals with frequency in order of
30 MHz Below 30 MHz frequency reflected towards the earth due to ionospheric
characteristics whereas above 30 MHz propagation of signal is on the line of sight
path To increase the distance antennas are placed in between line of sight paths
In radio communication data transfer rate is about 100 ndash 400 Mbps
2gt Microwave Communication Microwave systems transmit high speed microwave signal in
a line of sight path between relay station space The waves can not bend with the
curvature of the earth So microwave links would in variable use line of transmission
along ground route by repeater station placed 100 ndash 200 Km apart The repeater copies
or repeats the signal and amplifies all the signals before retransmission Microwave
signals are relayed by antennas usually placed on the top of the buildings towers
hills and mountain peaks The data transfer rate through microwave link is about 1000
Mbps
3gt Communication Satellites Communication Satellites in space orbiting 22000 miles
above the earth are also used as microwave relay stations These rotate at precise
point and spread above the equator so that these appear stationary to microwave
transmitters on the ground An artificial satellite which appears stationary to an
observer on the earth is called geostationary satellite When such a satellite is
used for communication purpose is called communication on satellite The
communication satellite usually acts as a reflector It accepts the signals from one
point of the earth and returns the same signal to some other points on the earth
Data Transmission Modes
There are three transmission modes
1gt Simplex Transmission In this mode data is transferred in one direction only
and never in opposite direction It is suitable for receive only printers
These devices do not transmit information Example Communication between
keyboard and computer
2gt Half-duplex Transmission In this mode data is transferred in both direction
but not simultaneously Example Communication between Computer and disk
3gt Full-duplex Transmission In this mode data can be transferred in both
directions simultaneously Example Telephone
Several Ways of Transmitting Signal
Parallel Transmission Digital computer only understands binary digits (bit) ie lsquo0rsquo and lsquo1rsquo So in computer network data are sent in the form of bit stream (combination of lsquo0rsquos
Data Transmission
Parallel Serial
Asynchronous Synchronous
and lsquo1rsquos) When n numbers of bit of a n bit data are sent simultaneously then the transmission is called Parallel Transmission Advantage All the bits are sent at a time So the speed of transmission is very high Disadvantage For n bit data there is n number of communication channels are needed Serial Transmission In case of serial transmission only one communication channel is used and all the bits are sent through that channel one after another Advantage i) Only one channel is required ii) Not costly iii) Very useful for long distance Disadvantages i) Speed of transmission is much slower than Parallel Transmission ii) Data have to wait long time in data-queue iii) Time consuming 1gt Asynchronous Transmission According to Serial transmission in case of Asynchronous
transmission bits are sent one after another In this case characters (Generally of 8 bits ) are send on at a time Every character starts with a Start bit which is denoted by lsquo0rsquo After the start bit the 8 bits of character are sent After that a parity bit is sent for error detection if any Then stop bit is sent which is denoted by lsquo1rsquo After that the start bit of another character is sent When no character is sent then the communication channel is in idle situation which is in binary lsquo1rsquo situation (presence of negative voltage in line) In case of Asynchronous transmission timing problem can be avoided
2gt Synchronous Transmission Synchronous transmission is one type of Serial Transmission In this case a block of bits is transmitted without start and stop bit in the form of long frame There is no space between two frames
Difference between Asynchronous and Synchronous Transmission
Asynchronous Transmission Synchronous Transmission
i) Every character is sent separately ii) At the beginning and end of every character there is start bit and stop bit
iii) Constant bit rate iv) No limit of block length v) Low speed communication vi) Synchronisation errors results in loss of only one characters
i) Characters are sent like in the form of block
ii) There is no start bit or stop bit
iii) Constant bit rate over a block iv) Block length is fixed v) High speed communication vii) Synchronisation errors results in loss of complete block
Switching According to demand switch is needed to construct connection between two points in a network The construction of the said connection is called Switching There are three types of Switching
i) Circuit Switching It analogous to a simple telephone call When telephone call is made then the switching instruments of the telephone system search for physical link between sender and receiver telephone This technology is circuit switching technology The line is available for the duration of the call At the end of the
call circuit is broken and another location can be dialed and new circuit is established
ii) Message Switching In this type of switching technology no physical link between sender and receiver is needed Instead of that at first the data of the sender are stored in router in the form of block Then the blocks are sent by the router one after another Every block is received by router router examines for error and resends In case of message switching there is no fixed length for blocks Disk is needed to store long block in router and the blocks may wait for long times in router
iii) Packet Switching The problems in message switching can be overcome by Packet switching In this case there is maximum size for the blocks and they are called packets So there is no need for disk because it can be stored into the main memory of the router The advantages of packet switching over message switching are
1 The first packet of message containing many packets will be sent to receiver without depending on the second packet`s situation Therefore receiving and sending message can be done simultaneously by the router
2 It can avoid network congestion
Types of Networks Computer Networks fall into three classes regarding the size distance and the structure
namely LAN (Local Area Network) MAN (Metropolitan Area Network) WAN (Wide Area Network)
A LAN links a small group of functionally similar workstations within a local geographic
area such as a series of adjacent cubicles or offices on the same floor Once the Computer
network expands to include other floors or divers office within a metropolitan area it
becomes a MAN Finally a WAN is simply a LAN of LANs WANs expand the boundaries of
computer networking to a global or even galactic scale
LAN (Local Area Network)
A Local Area Network is a computer network covering a small Networks geographical
area like a home office or groups of buildings eg a school Network For example a
library will have a wired or wireless LAN Network for users to interconnect local
networking devices eg printers and servers to connect to the internet The defining
characteristics of LANs Network in contrast to Wide Area Networks (WANs) includes their
much higher data-transfer rates smaller geographic range and lack of need for leased
telecommunication lines Smaller Networks generally consist of a one or more switches
linked to each other - often with one connected to a router cable modem or DSL modem for
Internet access LANs Network may have connections with other LANs Network via leased
lines leased services
MAN (Metropolitan Area Network)
MAN stands for Metropolitan Area Networks is one of a number of types of networks A MAN (
Metropolitan Area Networks ) is a relatively new class of network MAN is larger than a
local area network (LAN) and as its name implies covers the area of a single city MANs (
Metropolitan Area Networks ) rarely extend beyond 100 KM and frequently comprise a
combination of different hardware and transmission media
The two most important components of MANs ( Metropolitan Area Networks ) are security and
standardization Security is important because information is being shared between
dissimilar systems Standardization is necessary to ensure reliable data communication
A MAN ( Metropolitan Area Networks ) usually interconnects a number of local area networks
(LANs) using a high-capacity backbone technology such as fiber-optical links and provides
up-link services to wide area networks (or WAN) and the Internet
MAN ( Metropolitan Area Network ) adopted technologies from both LAN (local area network)
and WAN (Wide Area Network) to serve its purpose Some legacy technologies used for MAN
( Metropolitan Area Network ) are ATM FDDI DQDB and SMDS These older technologies are in
the process of being displaced by Gigabit Ethernet and 10 Gigabit Ethernet At the physical
level MAN links between LANs (local area networks) have been built on fiber optical cables
or using wireless technologies such as microwave or radio
The Metropolitan Area Networks (MAN) protocols are mostly at the data link level (layer 2
in the OSI model ) which are defined by IEEE ITU-T etc
WAN (Wide Area Networks)
A wide area network (WAN) is a telecommunication network A wide area network is simply a
LAN of LANs or Network Of Networks WANs connect LANs (Local Area Networks) that may be on
opposite sides of a building across the country or around the world WANs (wide area
networks) are characterized by the slowest data communication rates and the largest
distances WANs (wide area networks) can be of two types an enterprise WAN (wide area
networks) and Global WAN (wide area networks)
Computers connected to a Wide Area Networks are often connected through public networks
such as the telephone system They can also be connected through leased lines or
satellites The largest WAN (wide area networks) in existence is the Internet Some
segments of the Internet like VPN (Virtual Private Networks) based extranets are also
WANs (wide area networks) in themselves Finally many WANs (wide area networks) are
corporate or research networks that utilize leased lines
Numerous WANs have been constructed including public packet networks large corporate
networks military networks banking networks stock brokerage networks and airline
reservation networks
Campus Area Network (CAN)
A campus area networks (CANs) is a computer network interconnecting a few local area
networks (LANs) within a university campus or corporate campus Network Campus area network
may link a variety of campus buildings A campus area network is larger than a local area
network but smaller than a metropolitan area network (MAN) or wide area network (WAN)CAN
can also stand for corporate area network
Topology
The term Computer Network topology defines the geographic arrangement of computer
networking devices It describes the actual layout of the computer network hardware Given
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
In unshielded twisted pair cabling the twisted pair cable is not shielded Some
organizations use existing telephone wiring for their LANs This telephone wiring is
usually unshielded twisted pair cable
The main disadvantage associated with this is low noise immunity During a telephone
conversation noise and interference from other electronic equipment takes the form of
static and is rarely loud enough to disrupt the call
But that same line can scramble a data transmission and require the sending device to
retransmit An excessive number of such retransmissions will reduce network efficiency
Features of twisted-pair cables
bull Inexpensive
bull Easy to install
bull Easy to tap
bull Can accommodate up to 1000 devices
Limitations
The network coverage area is between 300 feet and 1000 feet only
c) Fiber- optic cable
A fiber-optic cable consists of strands of glass-like thread Through the use of a
laser data are transmitted from one end of a cable to the other Fiber optic cables will
increase the capacity of like-sized coaxial cables by at least a factor of 10 This makes
them valuable for use in a variety of applications mainly in communication network
Features
bull Huge bandwidth
bull Optical fiber systems are not affected by external noise
bull The error rate for the data transmitted across fiber optic cable is very low
Limitations
bull Cost is high
bull Fibers fragility makes it more difficult to handle
Unbounded MediaWireless communication
1gt Radio Communication Radio frequency transmission deals with frequency in order of
30 MHz Below 30 MHz frequency reflected towards the earth due to ionospheric
characteristics whereas above 30 MHz propagation of signal is on the line of sight
path To increase the distance antennas are placed in between line of sight paths
In radio communication data transfer rate is about 100 ndash 400 Mbps
2gt Microwave Communication Microwave systems transmit high speed microwave signal in
a line of sight path between relay station space The waves can not bend with the
curvature of the earth So microwave links would in variable use line of transmission
along ground route by repeater station placed 100 ndash 200 Km apart The repeater copies
or repeats the signal and amplifies all the signals before retransmission Microwave
signals are relayed by antennas usually placed on the top of the buildings towers
hills and mountain peaks The data transfer rate through microwave link is about 1000
Mbps
3gt Communication Satellites Communication Satellites in space orbiting 22000 miles
above the earth are also used as microwave relay stations These rotate at precise
point and spread above the equator so that these appear stationary to microwave
transmitters on the ground An artificial satellite which appears stationary to an
observer on the earth is called geostationary satellite When such a satellite is
used for communication purpose is called communication on satellite The
communication satellite usually acts as a reflector It accepts the signals from one
point of the earth and returns the same signal to some other points on the earth
Data Transmission Modes
There are three transmission modes
1gt Simplex Transmission In this mode data is transferred in one direction only
and never in opposite direction It is suitable for receive only printers
These devices do not transmit information Example Communication between
keyboard and computer
2gt Half-duplex Transmission In this mode data is transferred in both direction
but not simultaneously Example Communication between Computer and disk
3gt Full-duplex Transmission In this mode data can be transferred in both
directions simultaneously Example Telephone
Several Ways of Transmitting Signal
Parallel Transmission Digital computer only understands binary digits (bit) ie lsquo0rsquo and lsquo1rsquo So in computer network data are sent in the form of bit stream (combination of lsquo0rsquos
Data Transmission
Parallel Serial
Asynchronous Synchronous
and lsquo1rsquos) When n numbers of bit of a n bit data are sent simultaneously then the transmission is called Parallel Transmission Advantage All the bits are sent at a time So the speed of transmission is very high Disadvantage For n bit data there is n number of communication channels are needed Serial Transmission In case of serial transmission only one communication channel is used and all the bits are sent through that channel one after another Advantage i) Only one channel is required ii) Not costly iii) Very useful for long distance Disadvantages i) Speed of transmission is much slower than Parallel Transmission ii) Data have to wait long time in data-queue iii) Time consuming 1gt Asynchronous Transmission According to Serial transmission in case of Asynchronous
transmission bits are sent one after another In this case characters (Generally of 8 bits ) are send on at a time Every character starts with a Start bit which is denoted by lsquo0rsquo After the start bit the 8 bits of character are sent After that a parity bit is sent for error detection if any Then stop bit is sent which is denoted by lsquo1rsquo After that the start bit of another character is sent When no character is sent then the communication channel is in idle situation which is in binary lsquo1rsquo situation (presence of negative voltage in line) In case of Asynchronous transmission timing problem can be avoided
2gt Synchronous Transmission Synchronous transmission is one type of Serial Transmission In this case a block of bits is transmitted without start and stop bit in the form of long frame There is no space between two frames
Difference between Asynchronous and Synchronous Transmission
Asynchronous Transmission Synchronous Transmission
i) Every character is sent separately ii) At the beginning and end of every character there is start bit and stop bit
iii) Constant bit rate iv) No limit of block length v) Low speed communication vi) Synchronisation errors results in loss of only one characters
i) Characters are sent like in the form of block
ii) There is no start bit or stop bit
iii) Constant bit rate over a block iv) Block length is fixed v) High speed communication vii) Synchronisation errors results in loss of complete block
Switching According to demand switch is needed to construct connection between two points in a network The construction of the said connection is called Switching There are three types of Switching
i) Circuit Switching It analogous to a simple telephone call When telephone call is made then the switching instruments of the telephone system search for physical link between sender and receiver telephone This technology is circuit switching technology The line is available for the duration of the call At the end of the
call circuit is broken and another location can be dialed and new circuit is established
ii) Message Switching In this type of switching technology no physical link between sender and receiver is needed Instead of that at first the data of the sender are stored in router in the form of block Then the blocks are sent by the router one after another Every block is received by router router examines for error and resends In case of message switching there is no fixed length for blocks Disk is needed to store long block in router and the blocks may wait for long times in router
iii) Packet Switching The problems in message switching can be overcome by Packet switching In this case there is maximum size for the blocks and they are called packets So there is no need for disk because it can be stored into the main memory of the router The advantages of packet switching over message switching are
1 The first packet of message containing many packets will be sent to receiver without depending on the second packet`s situation Therefore receiving and sending message can be done simultaneously by the router
2 It can avoid network congestion
Types of Networks Computer Networks fall into three classes regarding the size distance and the structure
namely LAN (Local Area Network) MAN (Metropolitan Area Network) WAN (Wide Area Network)
A LAN links a small group of functionally similar workstations within a local geographic
area such as a series of adjacent cubicles or offices on the same floor Once the Computer
network expands to include other floors or divers office within a metropolitan area it
becomes a MAN Finally a WAN is simply a LAN of LANs WANs expand the boundaries of
computer networking to a global or even galactic scale
LAN (Local Area Network)
A Local Area Network is a computer network covering a small Networks geographical
area like a home office or groups of buildings eg a school Network For example a
library will have a wired or wireless LAN Network for users to interconnect local
networking devices eg printers and servers to connect to the internet The defining
characteristics of LANs Network in contrast to Wide Area Networks (WANs) includes their
much higher data-transfer rates smaller geographic range and lack of need for leased
telecommunication lines Smaller Networks generally consist of a one or more switches
linked to each other - often with one connected to a router cable modem or DSL modem for
Internet access LANs Network may have connections with other LANs Network via leased
lines leased services
MAN (Metropolitan Area Network)
MAN stands for Metropolitan Area Networks is one of a number of types of networks A MAN (
Metropolitan Area Networks ) is a relatively new class of network MAN is larger than a
local area network (LAN) and as its name implies covers the area of a single city MANs (
Metropolitan Area Networks ) rarely extend beyond 100 KM and frequently comprise a
combination of different hardware and transmission media
The two most important components of MANs ( Metropolitan Area Networks ) are security and
standardization Security is important because information is being shared between
dissimilar systems Standardization is necessary to ensure reliable data communication
A MAN ( Metropolitan Area Networks ) usually interconnects a number of local area networks
(LANs) using a high-capacity backbone technology such as fiber-optical links and provides
up-link services to wide area networks (or WAN) and the Internet
MAN ( Metropolitan Area Network ) adopted technologies from both LAN (local area network)
and WAN (Wide Area Network) to serve its purpose Some legacy technologies used for MAN
( Metropolitan Area Network ) are ATM FDDI DQDB and SMDS These older technologies are in
the process of being displaced by Gigabit Ethernet and 10 Gigabit Ethernet At the physical
level MAN links between LANs (local area networks) have been built on fiber optical cables
or using wireless technologies such as microwave or radio
The Metropolitan Area Networks (MAN) protocols are mostly at the data link level (layer 2
in the OSI model ) which are defined by IEEE ITU-T etc
WAN (Wide Area Networks)
A wide area network (WAN) is a telecommunication network A wide area network is simply a
LAN of LANs or Network Of Networks WANs connect LANs (Local Area Networks) that may be on
opposite sides of a building across the country or around the world WANs (wide area
networks) are characterized by the slowest data communication rates and the largest
distances WANs (wide area networks) can be of two types an enterprise WAN (wide area
networks) and Global WAN (wide area networks)
Computers connected to a Wide Area Networks are often connected through public networks
such as the telephone system They can also be connected through leased lines or
satellites The largest WAN (wide area networks) in existence is the Internet Some
segments of the Internet like VPN (Virtual Private Networks) based extranets are also
WANs (wide area networks) in themselves Finally many WANs (wide area networks) are
corporate or research networks that utilize leased lines
Numerous WANs have been constructed including public packet networks large corporate
networks military networks banking networks stock brokerage networks and airline
reservation networks
Campus Area Network (CAN)
A campus area networks (CANs) is a computer network interconnecting a few local area
networks (LANs) within a university campus or corporate campus Network Campus area network
may link a variety of campus buildings A campus area network is larger than a local area
network but smaller than a metropolitan area network (MAN) or wide area network (WAN)CAN
can also stand for corporate area network
Topology
The term Computer Network topology defines the geographic arrangement of computer
networking devices It describes the actual layout of the computer network hardware Given
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
path To increase the distance antennas are placed in between line of sight paths
In radio communication data transfer rate is about 100 ndash 400 Mbps
2gt Microwave Communication Microwave systems transmit high speed microwave signal in
a line of sight path between relay station space The waves can not bend with the
curvature of the earth So microwave links would in variable use line of transmission
along ground route by repeater station placed 100 ndash 200 Km apart The repeater copies
or repeats the signal and amplifies all the signals before retransmission Microwave
signals are relayed by antennas usually placed on the top of the buildings towers
hills and mountain peaks The data transfer rate through microwave link is about 1000
Mbps
3gt Communication Satellites Communication Satellites in space orbiting 22000 miles
above the earth are also used as microwave relay stations These rotate at precise
point and spread above the equator so that these appear stationary to microwave
transmitters on the ground An artificial satellite which appears stationary to an
observer on the earth is called geostationary satellite When such a satellite is
used for communication purpose is called communication on satellite The
communication satellite usually acts as a reflector It accepts the signals from one
point of the earth and returns the same signal to some other points on the earth
Data Transmission Modes
There are three transmission modes
1gt Simplex Transmission In this mode data is transferred in one direction only
and never in opposite direction It is suitable for receive only printers
These devices do not transmit information Example Communication between
keyboard and computer
2gt Half-duplex Transmission In this mode data is transferred in both direction
but not simultaneously Example Communication between Computer and disk
3gt Full-duplex Transmission In this mode data can be transferred in both
directions simultaneously Example Telephone
Several Ways of Transmitting Signal
Parallel Transmission Digital computer only understands binary digits (bit) ie lsquo0rsquo and lsquo1rsquo So in computer network data are sent in the form of bit stream (combination of lsquo0rsquos
Data Transmission
Parallel Serial
Asynchronous Synchronous
and lsquo1rsquos) When n numbers of bit of a n bit data are sent simultaneously then the transmission is called Parallel Transmission Advantage All the bits are sent at a time So the speed of transmission is very high Disadvantage For n bit data there is n number of communication channels are needed Serial Transmission In case of serial transmission only one communication channel is used and all the bits are sent through that channel one after another Advantage i) Only one channel is required ii) Not costly iii) Very useful for long distance Disadvantages i) Speed of transmission is much slower than Parallel Transmission ii) Data have to wait long time in data-queue iii) Time consuming 1gt Asynchronous Transmission According to Serial transmission in case of Asynchronous
transmission bits are sent one after another In this case characters (Generally of 8 bits ) are send on at a time Every character starts with a Start bit which is denoted by lsquo0rsquo After the start bit the 8 bits of character are sent After that a parity bit is sent for error detection if any Then stop bit is sent which is denoted by lsquo1rsquo After that the start bit of another character is sent When no character is sent then the communication channel is in idle situation which is in binary lsquo1rsquo situation (presence of negative voltage in line) In case of Asynchronous transmission timing problem can be avoided
2gt Synchronous Transmission Synchronous transmission is one type of Serial Transmission In this case a block of bits is transmitted without start and stop bit in the form of long frame There is no space between two frames
Difference between Asynchronous and Synchronous Transmission
Asynchronous Transmission Synchronous Transmission
i) Every character is sent separately ii) At the beginning and end of every character there is start bit and stop bit
iii) Constant bit rate iv) No limit of block length v) Low speed communication vi) Synchronisation errors results in loss of only one characters
i) Characters are sent like in the form of block
ii) There is no start bit or stop bit
iii) Constant bit rate over a block iv) Block length is fixed v) High speed communication vii) Synchronisation errors results in loss of complete block
Switching According to demand switch is needed to construct connection between two points in a network The construction of the said connection is called Switching There are three types of Switching
i) Circuit Switching It analogous to a simple telephone call When telephone call is made then the switching instruments of the telephone system search for physical link between sender and receiver telephone This technology is circuit switching technology The line is available for the duration of the call At the end of the
call circuit is broken and another location can be dialed and new circuit is established
ii) Message Switching In this type of switching technology no physical link between sender and receiver is needed Instead of that at first the data of the sender are stored in router in the form of block Then the blocks are sent by the router one after another Every block is received by router router examines for error and resends In case of message switching there is no fixed length for blocks Disk is needed to store long block in router and the blocks may wait for long times in router
iii) Packet Switching The problems in message switching can be overcome by Packet switching In this case there is maximum size for the blocks and they are called packets So there is no need for disk because it can be stored into the main memory of the router The advantages of packet switching over message switching are
1 The first packet of message containing many packets will be sent to receiver without depending on the second packet`s situation Therefore receiving and sending message can be done simultaneously by the router
2 It can avoid network congestion
Types of Networks Computer Networks fall into three classes regarding the size distance and the structure
namely LAN (Local Area Network) MAN (Metropolitan Area Network) WAN (Wide Area Network)
A LAN links a small group of functionally similar workstations within a local geographic
area such as a series of adjacent cubicles or offices on the same floor Once the Computer
network expands to include other floors or divers office within a metropolitan area it
becomes a MAN Finally a WAN is simply a LAN of LANs WANs expand the boundaries of
computer networking to a global or even galactic scale
LAN (Local Area Network)
A Local Area Network is a computer network covering a small Networks geographical
area like a home office or groups of buildings eg a school Network For example a
library will have a wired or wireless LAN Network for users to interconnect local
networking devices eg printers and servers to connect to the internet The defining
characteristics of LANs Network in contrast to Wide Area Networks (WANs) includes their
much higher data-transfer rates smaller geographic range and lack of need for leased
telecommunication lines Smaller Networks generally consist of a one or more switches
linked to each other - often with one connected to a router cable modem or DSL modem for
Internet access LANs Network may have connections with other LANs Network via leased
lines leased services
MAN (Metropolitan Area Network)
MAN stands for Metropolitan Area Networks is one of a number of types of networks A MAN (
Metropolitan Area Networks ) is a relatively new class of network MAN is larger than a
local area network (LAN) and as its name implies covers the area of a single city MANs (
Metropolitan Area Networks ) rarely extend beyond 100 KM and frequently comprise a
combination of different hardware and transmission media
The two most important components of MANs ( Metropolitan Area Networks ) are security and
standardization Security is important because information is being shared between
dissimilar systems Standardization is necessary to ensure reliable data communication
A MAN ( Metropolitan Area Networks ) usually interconnects a number of local area networks
(LANs) using a high-capacity backbone technology such as fiber-optical links and provides
up-link services to wide area networks (or WAN) and the Internet
MAN ( Metropolitan Area Network ) adopted technologies from both LAN (local area network)
and WAN (Wide Area Network) to serve its purpose Some legacy technologies used for MAN
( Metropolitan Area Network ) are ATM FDDI DQDB and SMDS These older technologies are in
the process of being displaced by Gigabit Ethernet and 10 Gigabit Ethernet At the physical
level MAN links between LANs (local area networks) have been built on fiber optical cables
or using wireless technologies such as microwave or radio
The Metropolitan Area Networks (MAN) protocols are mostly at the data link level (layer 2
in the OSI model ) which are defined by IEEE ITU-T etc
WAN (Wide Area Networks)
A wide area network (WAN) is a telecommunication network A wide area network is simply a
LAN of LANs or Network Of Networks WANs connect LANs (Local Area Networks) that may be on
opposite sides of a building across the country or around the world WANs (wide area
networks) are characterized by the slowest data communication rates and the largest
distances WANs (wide area networks) can be of two types an enterprise WAN (wide area
networks) and Global WAN (wide area networks)
Computers connected to a Wide Area Networks are often connected through public networks
such as the telephone system They can also be connected through leased lines or
satellites The largest WAN (wide area networks) in existence is the Internet Some
segments of the Internet like VPN (Virtual Private Networks) based extranets are also
WANs (wide area networks) in themselves Finally many WANs (wide area networks) are
corporate or research networks that utilize leased lines
Numerous WANs have been constructed including public packet networks large corporate
networks military networks banking networks stock brokerage networks and airline
reservation networks
Campus Area Network (CAN)
A campus area networks (CANs) is a computer network interconnecting a few local area
networks (LANs) within a university campus or corporate campus Network Campus area network
may link a variety of campus buildings A campus area network is larger than a local area
network but smaller than a metropolitan area network (MAN) or wide area network (WAN)CAN
can also stand for corporate area network
Topology
The term Computer Network topology defines the geographic arrangement of computer
networking devices It describes the actual layout of the computer network hardware Given
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
and lsquo1rsquos) When n numbers of bit of a n bit data are sent simultaneously then the transmission is called Parallel Transmission Advantage All the bits are sent at a time So the speed of transmission is very high Disadvantage For n bit data there is n number of communication channels are needed Serial Transmission In case of serial transmission only one communication channel is used and all the bits are sent through that channel one after another Advantage i) Only one channel is required ii) Not costly iii) Very useful for long distance Disadvantages i) Speed of transmission is much slower than Parallel Transmission ii) Data have to wait long time in data-queue iii) Time consuming 1gt Asynchronous Transmission According to Serial transmission in case of Asynchronous
transmission bits are sent one after another In this case characters (Generally of 8 bits ) are send on at a time Every character starts with a Start bit which is denoted by lsquo0rsquo After the start bit the 8 bits of character are sent After that a parity bit is sent for error detection if any Then stop bit is sent which is denoted by lsquo1rsquo After that the start bit of another character is sent When no character is sent then the communication channel is in idle situation which is in binary lsquo1rsquo situation (presence of negative voltage in line) In case of Asynchronous transmission timing problem can be avoided
2gt Synchronous Transmission Synchronous transmission is one type of Serial Transmission In this case a block of bits is transmitted without start and stop bit in the form of long frame There is no space between two frames
Difference between Asynchronous and Synchronous Transmission
Asynchronous Transmission Synchronous Transmission
i) Every character is sent separately ii) At the beginning and end of every character there is start bit and stop bit
iii) Constant bit rate iv) No limit of block length v) Low speed communication vi) Synchronisation errors results in loss of only one characters
i) Characters are sent like in the form of block
ii) There is no start bit or stop bit
iii) Constant bit rate over a block iv) Block length is fixed v) High speed communication vii) Synchronisation errors results in loss of complete block
Switching According to demand switch is needed to construct connection between two points in a network The construction of the said connection is called Switching There are three types of Switching
i) Circuit Switching It analogous to a simple telephone call When telephone call is made then the switching instruments of the telephone system search for physical link between sender and receiver telephone This technology is circuit switching technology The line is available for the duration of the call At the end of the
call circuit is broken and another location can be dialed and new circuit is established
ii) Message Switching In this type of switching technology no physical link between sender and receiver is needed Instead of that at first the data of the sender are stored in router in the form of block Then the blocks are sent by the router one after another Every block is received by router router examines for error and resends In case of message switching there is no fixed length for blocks Disk is needed to store long block in router and the blocks may wait for long times in router
iii) Packet Switching The problems in message switching can be overcome by Packet switching In this case there is maximum size for the blocks and they are called packets So there is no need for disk because it can be stored into the main memory of the router The advantages of packet switching over message switching are
1 The first packet of message containing many packets will be sent to receiver without depending on the second packet`s situation Therefore receiving and sending message can be done simultaneously by the router
2 It can avoid network congestion
Types of Networks Computer Networks fall into three classes regarding the size distance and the structure
namely LAN (Local Area Network) MAN (Metropolitan Area Network) WAN (Wide Area Network)
A LAN links a small group of functionally similar workstations within a local geographic
area such as a series of adjacent cubicles or offices on the same floor Once the Computer
network expands to include other floors or divers office within a metropolitan area it
becomes a MAN Finally a WAN is simply a LAN of LANs WANs expand the boundaries of
computer networking to a global or even galactic scale
LAN (Local Area Network)
A Local Area Network is a computer network covering a small Networks geographical
area like a home office or groups of buildings eg a school Network For example a
library will have a wired or wireless LAN Network for users to interconnect local
networking devices eg printers and servers to connect to the internet The defining
characteristics of LANs Network in contrast to Wide Area Networks (WANs) includes their
much higher data-transfer rates smaller geographic range and lack of need for leased
telecommunication lines Smaller Networks generally consist of a one or more switches
linked to each other - often with one connected to a router cable modem or DSL modem for
Internet access LANs Network may have connections with other LANs Network via leased
lines leased services
MAN (Metropolitan Area Network)
MAN stands for Metropolitan Area Networks is one of a number of types of networks A MAN (
Metropolitan Area Networks ) is a relatively new class of network MAN is larger than a
local area network (LAN) and as its name implies covers the area of a single city MANs (
Metropolitan Area Networks ) rarely extend beyond 100 KM and frequently comprise a
combination of different hardware and transmission media
The two most important components of MANs ( Metropolitan Area Networks ) are security and
standardization Security is important because information is being shared between
dissimilar systems Standardization is necessary to ensure reliable data communication
A MAN ( Metropolitan Area Networks ) usually interconnects a number of local area networks
(LANs) using a high-capacity backbone technology such as fiber-optical links and provides
up-link services to wide area networks (or WAN) and the Internet
MAN ( Metropolitan Area Network ) adopted technologies from both LAN (local area network)
and WAN (Wide Area Network) to serve its purpose Some legacy technologies used for MAN
( Metropolitan Area Network ) are ATM FDDI DQDB and SMDS These older technologies are in
the process of being displaced by Gigabit Ethernet and 10 Gigabit Ethernet At the physical
level MAN links between LANs (local area networks) have been built on fiber optical cables
or using wireless technologies such as microwave or radio
The Metropolitan Area Networks (MAN) protocols are mostly at the data link level (layer 2
in the OSI model ) which are defined by IEEE ITU-T etc
WAN (Wide Area Networks)
A wide area network (WAN) is a telecommunication network A wide area network is simply a
LAN of LANs or Network Of Networks WANs connect LANs (Local Area Networks) that may be on
opposite sides of a building across the country or around the world WANs (wide area
networks) are characterized by the slowest data communication rates and the largest
distances WANs (wide area networks) can be of two types an enterprise WAN (wide area
networks) and Global WAN (wide area networks)
Computers connected to a Wide Area Networks are often connected through public networks
such as the telephone system They can also be connected through leased lines or
satellites The largest WAN (wide area networks) in existence is the Internet Some
segments of the Internet like VPN (Virtual Private Networks) based extranets are also
WANs (wide area networks) in themselves Finally many WANs (wide area networks) are
corporate or research networks that utilize leased lines
Numerous WANs have been constructed including public packet networks large corporate
networks military networks banking networks stock brokerage networks and airline
reservation networks
Campus Area Network (CAN)
A campus area networks (CANs) is a computer network interconnecting a few local area
networks (LANs) within a university campus or corporate campus Network Campus area network
may link a variety of campus buildings A campus area network is larger than a local area
network but smaller than a metropolitan area network (MAN) or wide area network (WAN)CAN
can also stand for corporate area network
Topology
The term Computer Network topology defines the geographic arrangement of computer
networking devices It describes the actual layout of the computer network hardware Given
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
call circuit is broken and another location can be dialed and new circuit is established
ii) Message Switching In this type of switching technology no physical link between sender and receiver is needed Instead of that at first the data of the sender are stored in router in the form of block Then the blocks are sent by the router one after another Every block is received by router router examines for error and resends In case of message switching there is no fixed length for blocks Disk is needed to store long block in router and the blocks may wait for long times in router
iii) Packet Switching The problems in message switching can be overcome by Packet switching In this case there is maximum size for the blocks and they are called packets So there is no need for disk because it can be stored into the main memory of the router The advantages of packet switching over message switching are
1 The first packet of message containing many packets will be sent to receiver without depending on the second packet`s situation Therefore receiving and sending message can be done simultaneously by the router
2 It can avoid network congestion
Types of Networks Computer Networks fall into three classes regarding the size distance and the structure
namely LAN (Local Area Network) MAN (Metropolitan Area Network) WAN (Wide Area Network)
A LAN links a small group of functionally similar workstations within a local geographic
area such as a series of adjacent cubicles or offices on the same floor Once the Computer
network expands to include other floors or divers office within a metropolitan area it
becomes a MAN Finally a WAN is simply a LAN of LANs WANs expand the boundaries of
computer networking to a global or even galactic scale
LAN (Local Area Network)
A Local Area Network is a computer network covering a small Networks geographical
area like a home office or groups of buildings eg a school Network For example a
library will have a wired or wireless LAN Network for users to interconnect local
networking devices eg printers and servers to connect to the internet The defining
characteristics of LANs Network in contrast to Wide Area Networks (WANs) includes their
much higher data-transfer rates smaller geographic range and lack of need for leased
telecommunication lines Smaller Networks generally consist of a one or more switches
linked to each other - often with one connected to a router cable modem or DSL modem for
Internet access LANs Network may have connections with other LANs Network via leased
lines leased services
MAN (Metropolitan Area Network)
MAN stands for Metropolitan Area Networks is one of a number of types of networks A MAN (
Metropolitan Area Networks ) is a relatively new class of network MAN is larger than a
local area network (LAN) and as its name implies covers the area of a single city MANs (
Metropolitan Area Networks ) rarely extend beyond 100 KM and frequently comprise a
combination of different hardware and transmission media
The two most important components of MANs ( Metropolitan Area Networks ) are security and
standardization Security is important because information is being shared between
dissimilar systems Standardization is necessary to ensure reliable data communication
A MAN ( Metropolitan Area Networks ) usually interconnects a number of local area networks
(LANs) using a high-capacity backbone technology such as fiber-optical links and provides
up-link services to wide area networks (or WAN) and the Internet
MAN ( Metropolitan Area Network ) adopted technologies from both LAN (local area network)
and WAN (Wide Area Network) to serve its purpose Some legacy technologies used for MAN
( Metropolitan Area Network ) are ATM FDDI DQDB and SMDS These older technologies are in
the process of being displaced by Gigabit Ethernet and 10 Gigabit Ethernet At the physical
level MAN links between LANs (local area networks) have been built on fiber optical cables
or using wireless technologies such as microwave or radio
The Metropolitan Area Networks (MAN) protocols are mostly at the data link level (layer 2
in the OSI model ) which are defined by IEEE ITU-T etc
WAN (Wide Area Networks)
A wide area network (WAN) is a telecommunication network A wide area network is simply a
LAN of LANs or Network Of Networks WANs connect LANs (Local Area Networks) that may be on
opposite sides of a building across the country or around the world WANs (wide area
networks) are characterized by the slowest data communication rates and the largest
distances WANs (wide area networks) can be of two types an enterprise WAN (wide area
networks) and Global WAN (wide area networks)
Computers connected to a Wide Area Networks are often connected through public networks
such as the telephone system They can also be connected through leased lines or
satellites The largest WAN (wide area networks) in existence is the Internet Some
segments of the Internet like VPN (Virtual Private Networks) based extranets are also
WANs (wide area networks) in themselves Finally many WANs (wide area networks) are
corporate or research networks that utilize leased lines
Numerous WANs have been constructed including public packet networks large corporate
networks military networks banking networks stock brokerage networks and airline
reservation networks
Campus Area Network (CAN)
A campus area networks (CANs) is a computer network interconnecting a few local area
networks (LANs) within a university campus or corporate campus Network Campus area network
may link a variety of campus buildings A campus area network is larger than a local area
network but smaller than a metropolitan area network (MAN) or wide area network (WAN)CAN
can also stand for corporate area network
Topology
The term Computer Network topology defines the geographic arrangement of computer
networking devices It describes the actual layout of the computer network hardware Given
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
The two most important components of MANs ( Metropolitan Area Networks ) are security and
standardization Security is important because information is being shared between
dissimilar systems Standardization is necessary to ensure reliable data communication
A MAN ( Metropolitan Area Networks ) usually interconnects a number of local area networks
(LANs) using a high-capacity backbone technology such as fiber-optical links and provides
up-link services to wide area networks (or WAN) and the Internet
MAN ( Metropolitan Area Network ) adopted technologies from both LAN (local area network)
and WAN (Wide Area Network) to serve its purpose Some legacy technologies used for MAN
( Metropolitan Area Network ) are ATM FDDI DQDB and SMDS These older technologies are in
the process of being displaced by Gigabit Ethernet and 10 Gigabit Ethernet At the physical
level MAN links between LANs (local area networks) have been built on fiber optical cables
or using wireless technologies such as microwave or radio
The Metropolitan Area Networks (MAN) protocols are mostly at the data link level (layer 2
in the OSI model ) which are defined by IEEE ITU-T etc
WAN (Wide Area Networks)
A wide area network (WAN) is a telecommunication network A wide area network is simply a
LAN of LANs or Network Of Networks WANs connect LANs (Local Area Networks) that may be on
opposite sides of a building across the country or around the world WANs (wide area
networks) are characterized by the slowest data communication rates and the largest
distances WANs (wide area networks) can be of two types an enterprise WAN (wide area
networks) and Global WAN (wide area networks)
Computers connected to a Wide Area Networks are often connected through public networks
such as the telephone system They can also be connected through leased lines or
satellites The largest WAN (wide area networks) in existence is the Internet Some
segments of the Internet like VPN (Virtual Private Networks) based extranets are also
WANs (wide area networks) in themselves Finally many WANs (wide area networks) are
corporate or research networks that utilize leased lines
Numerous WANs have been constructed including public packet networks large corporate
networks military networks banking networks stock brokerage networks and airline
reservation networks
Campus Area Network (CAN)
A campus area networks (CANs) is a computer network interconnecting a few local area
networks (LANs) within a university campus or corporate campus Network Campus area network
may link a variety of campus buildings A campus area network is larger than a local area
network but smaller than a metropolitan area network (MAN) or wide area network (WAN)CAN
can also stand for corporate area network
Topology
The term Computer Network topology defines the geographic arrangement of computer
networking devices It describes the actual layout of the computer network hardware Given
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
the location of workstations and peripherals the goal of topology is to find the most
economical and efficient way to connect all the users to the computer network resources
while providing adequate capacity to handle user demands maintain system reliability and
minimize delay Basic Types of Topology
There are six basic types of network topologies in the study of network topology bus
topology ring topology star topology hybrid topology mesh topology and tree topology
The interconnections between computers whether logical or physical are the foundation of
this classification
Bus Network Topology bull All the nodes (file server workstations and peripherals) on a bus topology are connected by one single cable bull A bus topology consists of a main run of cable with a terminator at each end All nodes (file server workstations and peripherals) are connected to the linear cable bull Popular on LANs because they are inexpensive and easy to install
Advantages of Bus Topology bull It is Cheap easy to handle and implement bull Require less cable bull It is best suited for small networks Disadvantages of Bus Topology bull The cable length is limited This limits the number of stations that can be connected bull This network topology can perform well only for a limited number of nodes
Bus Network Topology Star Network Topology
Star Network Topology bull In a star network each node (file server workstations and peripherals) is connected to a central device called a hub bull The hub takes a signal that comes from any node and passes it along to all the other nodes in the network bull Data on a star network passes through the hub switch or concentrator before continuing to its destination bull The hub switch or concentrator manages and controls all functions of the network bull The star topology reduces the chance of network failure by connecting all of the systems to a central node Advantages of Star Topology bull Easy to manage bull Easy to locate problems (cableworkstations) bull Easier to expand than a bus or ring topology
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
bull Easy to install and wire bull Easy to detect faults and to remove parts Disadvantages of Star Topology bull Requires more cable length than a linear topology bull If the hub or concentrator fails nodes attached are disabled bull More expensive because of the cost of the concentrators
Ring Network Topology
bull In a ring network every device has exactly two neighbours for communication purposes bull All messages travel through a ring in the same direction bull A failure in any cable or device breaks the loop and can take down the entire network bull To implement a ring network we use the Token Ring technology bull A token or small data packet is continuously passed around the network When a device needs to transmit it reserves the token for the next trip around then attaches its data packet to it Advantage of Ring Topology bull Very orderly network where every device has access to the token and the opportunity to transmit bull Easier to Mange than a Bus Network bull Good Communication over long distances bull Handles high volume of traffic Disadvantages of Ring Topology bull The failure of a single node of the network can cause the entire network to fail bull The movement or changes made to network nodes affects the performance of the entire network
Ring Network Topology Mesh Network Topology
Mesh Network Topology
bull In this topology each node is connected to every other node in the network
bull Implementing the mesh topology is expensive and difficult bull In this type of network each node may send message to destination through multiple paths bull While the data is travelling on the Mesh Network it is automatically configured to reach the destination by taking the shortest route which means the least number of hops Advantage of Mesh Topology bull No traffic problem as there are dedicated links
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
bull It has multiple links so if one route is blocked then other routes can be used for data communication bull Points to point links make fault identification easy Disadvantage of Mesh Topology bull There is mesh of wiring which can be difficult to manage bull Installation is complex as each node is connected to every node bull Cabling cost is high
Tree Network Topology
bull A tree topology (hierarchical topology) can be viewed as a collection of star networks
arranged in a hierarchy
bull This tree has individual peripheral nodes which are required to transmit to and receive from one other only and are not required to act as repeaters or regenerators bull The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and easier troubleshooting bull This is particularly helpful for colleges universities and schools so that each of the connect to the big network in some way Advantages of a Tree Topology bull Point-to-point wiring for individual segments bull Supported by several hardware and software vendors bull All the computers have access to the larger and their immediate networks Disadvantages of a Tree Topology bull Overall length of each segment is limited by the type of cabling used bull If the backbone line breaks the entire segment goes down bull More difficult to configure and wire than other topologies
Hybrid topology
bull A combination of any two or more network topologies
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
bull A hybrid topology always accrues when two different basic network topologies are connected bull It is a mixture of above mentioned topologies Usually a central computer is attached with sub-controllers which in turn participate in a variety of topologies Advantages of a Hybrid Topology bull It is extremely flexible bull It is very reliable Disadvantages of a Hybrid Topology bull Expensive
Data Access System in LAN Two important data access systems are i) CSMA CSMACD and CSMACA ii) Token Passing
i) Carrier Sensed Multiple Access (CSMA) CSMA is a network access method used on
shared network topologies such as Ethernet to control access to the network Devices
attached to the network cable listen (carrier sense) before transmitting If the channel is
in use devices wait before transmitting MA (Multiple Access) indicates that many devices
can connect to and share the same network All devices have equal access to use the network
when it is clear Even though devices attempt to sense whether the network is in use there
is a good chance that two stations will attempt to access it at the same time On large
networks the transmission time between one end of the cable and another is enough that one
station may access the cable even though another has already just accessed it There are
two methods for avoiding these so-called collisions listed here
CSMACD (Carrier Sense Multiple AccessCollision Detection) CD (collision detection)
defines what happens when two devices sense a clear channel then attempt to transmit at
the same time A collision occurs and both devices stop transmission wait for a random
amount of time and then retransmit This is the technique used to access the 8023
Ethernet network channel This method handles collisions as they occur but if the bus is
constantly busy collisions can occur so often that performance drops drastically It is
estimated that network traffic must be less than 40 percent of the bus capacity for the
network to operate efficiently If distances are long time lags occur that may result in
inappropriate carrier sensing and hence collisions
CSMACA (Carrier Sense Multiple AccessCollision Avoidance) In CA (collision avoidance)
collisions are avoided because each node signals its intent to transmit before actually
doing so This method is not popular because it requires excessive overhead that reduces
performance
ii) Token Passing In case of token passing there is no chance for collision Here the
data are divided into frames Token is the simple frame which is the permission for the
data transmission In this system each station can send signal in turn Each station sends
signal only during its turn and sends one frame only A token passes from station to
station around the ring A station may send data when it receives the token
LAN Protocols i) Ethernet The Ethernet topology was developed at the University of Hawaii to connect computers on the various Islands It was radio based design Ethernet is one of the most
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
popular Computer Network or LAN technologies in use today covering more than 85 of the computer networks Ethernet system consists of three basic elements 1 The physical medium use to carry Ethernet signals between computers on the network 2 A set of rules (protocols) embedded in each Ethernet interface that will decide how multiple computers on the network will have access to the data on the medium 3 An Ethernet frame that consists of a standardized set of bits used to carry data over the system The operation of Ethernet can be described in simple terms as follows Each computer on the Ethernet Network also known as a node operates independently of all other nodes All nodes attached to an Ethernet are connected to a shared medium over which the Ethernet signals travel serially one data bit at a time To send data a station first listens to the channel and when the channel is idle the station transmits its information in the form of an Ethernet frame or packet The Ethernet rules (protocol) are defined in such a way that every node gets a fair amount of frame transmission opportunity As each Ethernet frame is sent out on the shared medium the Ethernet interfaces inside the node look at the destination address The interfaces compare the destination address of the frame with their own address The Ethernet interface with the same address as the destination address in the frame will read the entire frame and all other network interfaces will ignore the information Medium Access Control of Ethernet The set of rules which ensures that every node in an Ethernet gets a fair amount of frame transmission opportunity are called the Medium Access Control mechanism The Medium Access Control mechanism is based on a system called Carrier Sense Multiple Access with Collision Detection (CSMDCD) Ethernet Frame The heart of Ethernet system is the Ethernet Frame which is used to deliver information between the computers The frame consists of a set of bits organized into several fields These fields include address fields a data field and an error checking field that checks the integrity of the bits in the frame to make sure that the frame has arrived intact Advantages of Ethernet Ethernets major advantages are 1 It is an inexpensive way to achieve high speed LAN transmissions (10 to 100 MBs)
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
2 It is a proven technology that supports various writing configurations 3 It works well with a large number of LAN and micro-to-mainframe applications 4 It is easy to install Disadvantages of Ethernet The Ethernet cabling ahs the following disadvantages 1 Ethernet is not a high-level performer in high-load environments This protocol (CSMACD Carrier Sense Multiple AccessCollision Detection) can slow down dramatically if hundreds of workstations are competing for the same cabling trunk 2 Its linear bus cabling system can sometimes make it difficult to isolate problems
ii) Token Ring Token ring local area network (LAN) technology is a protocol which resides at the data link layer (DLL) of the OSI model It uses a special three-byte frame called a token that travels around the ring Token-possession grants the possessor permission to transmit on the medium Token ring frames travel completely around the loop
Initially used only in IBM computers it was eventually standardized with protocol IEEE 8025
The data transmission process goes as follows
Empty information frames are continuously circulated on the ring When a computer has a message to send it inserts a token in an empty frame (this may
consist of simply changing a 0 to a 1 in the token bit part of the frame) and inserts a message and a destination identifier in the frame
The frame is then examined by each successive workstation The workstation that identifies itself to be the destination for the message copies it from the frame and changes the token back to 0
When the frame gets back to the originator it sees that the token has been changed to 0 and that the message has been copied and received It removes the message from the frame
The frame continues to circulate as an empty frame ready to be taken by a workstation when it has a message to send
The token scheme can also be used with bus topology LANs
Advantages of Token Ring
Here are Token rings most useful advantages
a It offers excellent throughput under high-load conditions
b Token Ring facilitates LAN-to-LAN mainframe connections especially for interfacing with
IBMs broader connectivity strategies
c It has built-in troubleshooting mechanisms such as beaconing and auto-reconfiguration
and may now be used with UTP cabling
d It has the most reliable protocol (token-passing) the most trouble-free configuration
(physical star) and the fastest connectivity scheme (r or 16 mbs)
Disadvantages of Token Ring
Few of the disadvantages of Token Ring are
a Token Ring is very expensive All topology components cost much more than other more
popular standards
b It is relatively proprietary Token Rings complexity is built into the hardware
components This means hat you need to choose a manufacturer and stick with it
c Engineers must have considerable expertise to manage and troubleshoot token ring
components
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
Data Transmission Techniques in WAN See Switching
WAN Devices i)Network Repeater A repeater connects two segments of your network cable It retimes and regenerates the signals to proper amplitudes and sends them to the other segments When talking about ethernet topology you are probably talking about using a hub as a repeater Repeaters require a small amount of time to regenerate the signal This can cause a propagation delay which can affect network communication when there are several repeaters in a row Many network architectures limit the number of repeaters that can be used in a row Repeaters work only at the physical layer of the OSI network model ii)Bridge A bridge reads the outermost section of data on the data packet to tell where the message is going It reduces the traffic on other network segments since it does not send all packets Bridges can be programmed to reject packets from particular networks Bridging occurs at the data link layer of the OSI model which means the bridge cannot read IP addresses but only the outermost hardware address of the packet In our case the bridge can read the ethernet data which gives the hardware address of the destination address not the IP address Bridges forward all broadcast messages Only a special bridge called a translation bridge will allow two networks of different architectures to be connected Bridges do not normally allow connection of networks with different architectures The hardware address is also called the MAC (media access control) address To determine the network segment a MAC address belongs to bridges use one of Transparent Bridging - They build a table of addresses (bridging table) as they receive packets If the address is not in the bridging table the packet is forwarded to all segments other than the one it came from This type of bridge is used on ethernet networks Source route bridging - The source computer provides path information inside the packet This is used on Token Ring networks iii)Network Router A router is used to route data packets between two networks It reads
the information in each packet to tell where it is going If it is destined for an
immediate network it has access to it will strip the outer packet readdress the packet
to the proper ethernet address and transmit it on that network If it is destined for
another network and must be sent to another router it will re-package the outer packet
to be received by the next router and send it to the next router The section on routing
explains the theory behind this and how routing tables are used to help determine packet
destinations Routing occurs at the network layer of the OSI model They can connect
networks with different architectures such as Token Ring and Ethernet Although they can
transform information at the data link level routers cannot transform information from
one data format such as TCPIP to another such as IPXSPX Routers do not send broadcast
packets or corrupted packets If the routing table does not indicate the proper address
of a packet the packet is discarded
iv)Brouter There is a device called a brouter which will function similar to a bridge for
network transport protocols that are not routable and will function as a router for
routable protocols It functions at the network and data link layers of the OSI network
model
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
v)Gateway A gateway can translate information between different network data formats or
network architectures It can translate TCPIP to AppleTalk so computers supporting TCPIP
can communicate with Apple brand computers Most gateways operate at the application layer
but can operate at the network or session layer of the OSI model Gateways will start at
the lower level and strip information until it gets to the required level and repackage the
information and work its way back toward the hardware layer of the OSI model To confuse
issues when talking about a router that is used to interface to another network the word
gateway is often used This does not mean the routing machine is a gateway as defined here
although it could be
vi)Modem A modem (modulator-demodulator) is a device that modulates an analog carrier
signal to encode digital information and also demodulates such a carrier signal to decode
the transmitted information The goal is to produce a signal that can be transmitted easily
and decoded to reproduce the original digital data Modems can be used over any means of
transmitting analog signals from light emitting diodes to radio The most familiar example
is a voice band modem that turns the digital data of a personal computer into
modulated electrical signals in the voice frequency range of a telephone channel These
signals can be transmitted over telephone lines and demodulated by another modem at the
receiver side to recover the digital data
OSI Model The Open Systems Interconnect (OSI) model has seven layers This article describes and
explains them beginning with the lowest in the hierarchy (the physical) and proceeding
to the highest (the application) The layers are stacked this way
bull Application bull Presentation bull Session bull Transport bull Network bull Data Link bull Physical
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
PHYSICAL LAYER
The physical layer the lowest layer of the OSI model is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium It describes the
electricaloptical mechanical and functional interfaces to the physical medium and
carries the signals for all of the higher layers It provides
bull Data encoding modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium and to aid in bit and frame synchronization It determines
o What signal state represents a binary 1 o How the receiving station knows when a bit-time starts o How the receiving station delimits a frame
bull Physical medium attachment accommodating various possibilities in the medium
o Will an external transceiver (MAU) be used to connect to the medium o How many pins do the connectors have and what is each pin used for
bull Transmission technique determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling
bull Physical medium transmission transmits bits as electrical or optical signals appropriate for the physical medium and determines
o What physical medium options can be used o How many voltsdb should be used to represent a given signal state using a
given physical medium
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
DATA LINK LAYER
The data link layer provides error-free transfer of data frames from one node to another
over the physical layer allowing layers above it to assume virtually error-free
transmission over the link To do this the data link layer provides
bull Link establishment and termination establishes and terminates the logical link between two nodes
bull Frame traffic control tells the transmitting node to back-off when no frame buffers are available
bull Frame sequencing transmitsreceives frames sequentially bull Frame acknowledgment providesexpects frame acknowledgments Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt
bull Frame delimiting creates and recognizes frame boundaries bull Frame error checking checks received frames for integrity bull Media access management determines when the node has the right to use the physical
medium
NETWORK LAYER
The network layer controls the operation of the subnet deciding which physical path the
data should take based on network conditions priority of service and other factors It
provides
bull Routing routes frames among networks bull Subnet traffic control routers (network layer intermediate systems) can instruct a
sending station to throttle back its frame transmission when the routers buffer fills up
bull Frame fragmentation if it determines that a downstream routers maximum transmission unit (MTU) size is less than the frame size a router can fragment a frame for transmission and re-assembly at the destination station
bull Logical-physical address mapping translates logical addresses or names into physical addresses
bull Subnet usage accounting has accounting functions to keep track of frames forwarded by subnet intermediate systems to produce billing information
TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free in sequence and with
no losses or duplications It relieves the higher layer protocols from any concern with the
transfer of data between them and their peers
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer For a reliable network layer with virtual circuit capability a
minimal transport layer is required If the network layer is unreliable andor only
supports datagrams the transport protocol should include extensive error detection and
recovery
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
The transport layer provides
bull Message segmentation accepts a message from the (session) layer above it splits the message into smaller units (if not already small enough) and passes the smaller units down to the network layer The transport layer at the destination station reassembles the message
bull Message acknowledgment provides reliable end-to-end message delivery with acknowledgments
bull Message traffic control tells the transmitting station to back-off when no message buffers are available
bull Session multiplexing multiplexes several message streams or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer)
Typically the transport layer can accept relatively large messages but there are strict
message size limits imposed by the network (or lower) layer Consequently the transport
layer must break up the messages into smaller units or frames prepending a header to each
frame
The transport layer header information must then include control information such as
message start and message end flags to enable the transport layer on the other end to
recognize message boundaries In addition if the lower layers do not maintain sequence
the transport header must contain sequence information to enable the transport layer on the
receiving end to get the pieces back together in the right order before handing the
received message up to the layer above
SESSION LAYER
The session layer allows session establishment between processes running on different
stations It provides
bull Session establishment maintenance and termination allows two application processes on different machines to establish use and terminate a connection called a session
bull Session support performs the functions that allow these processes to communicate over the network performing security name recognition logging and so on
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer It can be
viewed as the translator for the network This layer may translate data from a format used
by the application layer into a common format at the sending station then translate the
common format to a format known to the application layer at the receiving station
The presentation layer provides
bull Character code translation for example ASCII to EBCDIC bull Data conversion bit order CR-CRLF integer-floating point and so on bull Data compression reduces the number of bits that need to be transmitted on the
network bull Data encryption encrypt data for security purposes For example password
encryption
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services This layer contains a variety of commonly needed functions
bull Resource sharing and device redirection bull Remote file access bull Remote printer access bull Inter-process communication bull Network management bull Directory services bull Electronic messaging (such as mail) bull Network virtual terminals
ISDN Integrated Services Digital Network is a telephone system network It is a wide area
network becoming widely available Prior to the ISDN the phone system was viewed as a way
to transport voice with some special services available for data The key feature of the
ISDN is that it integrates speech and data on the same lines adding features that were not
available in the classic telephone system ISDN is a circuit -switched telephone network system that also provides access to packet switched networks designed to allow digital transmission of voice and data over ordinary telephone copper wires resulting in better voice quality thanmiddot an analog phone It offers circuit-switched connections (for either voice or data) and packet-switched connections (for data) in increments of 64 Kbits Another major market application is Internet access where ISDN typically provides a maximum of 128 Kbits in both upstream and downstream directions (which can be considered to be broadband speed since it exceeds the narrowband speeds of standard analog 56k telephone lines)
The principle of ISDN
The ISDN is supported by a wide range of voice and non-voice applications of the same
network It provides a range of servicesmiddot using a limited set of connections and
multipurpose user-network interface arrangements
ISDN supports a variety of applications that include both switched and non-switched
connections The switched connections Include both circuit and packet switched
connections
As far as possible new services introduced into an ISDN should be arranged to be
compatible with the 64 Kbps switched digital connections
A layered protocol structure should be used for the specification of access to an ISDN
This is the same as the OSI reference model The standards which have already been
developed for OSI applications such as X25 can be used for ISDN
ISDNs may be implemented in a variety of configurations
ISDN Services
The purpose of the ISDN is to provide fully integrated digital services to users These
services fall into categories- better services teleservices and supplementary services
1 Bearer Services Bearer services provide the means to transfer information (voice data
and video) between users without the network manipulating the content of that information
The network does not need to process the information and therefore does not change the
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
content Bearer services belong to the first three layers of the OSI model and are well
defined in the ISDN standard They can be provided using circuit-switched packet-switched
frame-switched or cell-switched networks
2 Teleservices In teleservices the network may change or process the contents of the
data These services correspond to layers 4-7 of the OSI model Teleservices relay on the
facilities of the bearer services and are designed to accommodate complex user needs
without the user having to be aware of the details of the process Teleservices include
telephony teletex telefax videotex telex and teleconferencing Although the ISDN
defines these services by name they have not yet become standards
3 Supplementary Service Supplementary services are those services that provide additional
functionality to the bearer services and teleservices Examples of these services are
reverse charging call waiting and message handling all familiar from todays telephone
company services
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
Networking Questions
A) Answer the following questions- 1) What is computer network Write its importance
2) What are the difference between Asynchronous transmission and Synchronous Transmission
3) What is LAN MAN WAN
4) Define Topology
5) What are the advantage and disadvantage of Ring Topology
6) What are the advantage and disadvantage of Tree topology
7) Write short notes on Ethernet and Token Ring
8) Define ISDN
9) Describe Datalink layer and Transport layer
10) What is Firewall
B) MCQ questions and Answer- 1) The full form of CSMACD-
a)Carrier sense multiple access with collision detection
b)Carrier system multiple access with collision device
c)Cancel system multiple access with collision device
d) none of these
Ans-a
2) X25_________protocol
a) Packet switching b)CSMACD c)Message switching d)All of these
Ans-a
3) Connectionless protocol is-
a)TCP b)UDP c)ARP d)RARP
Ans-b
4) Required protocol of Transport layer in TCPIP model-
a)ARPRARP b)TCPUDP c)ICMPUDP d)None of these
5) When a wire or cable transport a signal in a time in network system is called-
a)Broadband network b)Baseband network c)Client server d)None of these
Ans-a
6) Digital signal is formed with
a) Electromagnetive wave b)0 and 1 c)voice and data d)none of these
Ans-b
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
7) Example of half duplex-
a)Telephone b) Radio c)walkie talkie d)television
Ans-c
8) The full form of NIC-
a)Network interface card b)network installation card c)None of these d)All
Ans-a
9) Start bit and stop bit is used in -
a) Asynchronous transmission b) Syschronous transmission c) Client server d) None of these
Ans-a
10) When each computer work server as well as client in network system is called-
a)LAN b) MAN C) Client server d) Peer to Peer
Ans-d
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
PPPPaaaaggggeeee 1111 ooooffff 7777
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System Data Data হল কান িবষয় ব বা বি সপিক ত অথ হীন অসংগিঠত াথিমক সংখা অথবা শ$ যার িনিদ ( প)িতেত ি+য়াকরণ বা িবে-ষেণর (Processing) পর সসংগিঠত অথ পণ হয় Information ববহােরর অনপয াথিমক ডটািল ি+য়াকরণ বা িবে-ষেণর মাধেম য অথ পণ সসংগিঠত ও ববহােরর উপেযাগী িহসােব পিরণত হয় তােক Information বেল Data Processing Data ক ইনফেম শন এ পিরণত করার প)িতেক Data Processing বেল Data ও Information এর পাথ ক
Data Information 1H Data হল কান বি ব ইতািদ সপিক ত অসংগিঠত াথিমক তথ
1H ইনফেম শন হল ি+য়াকরণ বা Process করার পর সগিঠত এবং অথ পণ তথ
2H Data হল ি+য়াকরণ বা িবে-ষেণর পেব র Jপ 2H ইনফেম শন হল ি+য়াকরণ বা িবে-ষেণর পরবত ী Jপ
3H Data সংLহ অেনক সময় পিরMম ও বয় সােপN 3H ইনফরেমশন Oতরীর NেP অেনক কম সময় পিরMম ও বয় হয়
Database Database হল পারRপিরক সপক য তথ যখােন িবিধব) (Structured) ববVার মাধেম সসংহত ভােব ও Xত তথ সংরিNত করা যায়Database এ সম Data বা তথেক এক বা একািধক টিবেলর মেধ সংরিNত করা হয়
Database Management System Database Management System বা DBMS হেলা একছ Programme এর সমাহার যখােন পারRপিরক সপক য তথেক িবিধব) ববVার মাধেম সসংহত ভােব ও Xত সংরিNত করা হয় এছাড়াও তেথর নবীকরণ (Update) িবেয়াজন (Delete) ইতািদ েয়াজন অনসাের িনিদ ( তেথর পয েবNণ খবই Xততার সেc সপাদন করা যায়
DBMS এর েয়াগ 1H বাংিকংেয়র NেP বত মােন ডটােবস িসেdেমর ভত ববহার লN করা যায় 2H এয়ারলাইনস ও রলওেয় িরজােভ শন এর NেP ডটােবস িসেdম ববeত হয় 3H আিথ ক িহসাব -িনকােশর NেPও ডটােবস িসেdেমর ভত ববহার লN করা যায় DBMS এর সিবধা 1H ডটােবস িসেdেম তেথর বাhল জিনত সমসা (Data Redundancy) িনয়jণ করা যায় 2H তেথর অসcিত (Data Inconsistency) ডাটােবজ িসেdম এ দর করা সkব 3H তেথর অখlতা (Data Integrity) এবং তেথর মৗিলকn (Data Independency) রNা করা যায় 4H ডটােবস িসেdেম বাকআপ প)িতর মাধেম ডটা পনp)ার সkব DBMS এর অসিবধা 1H ডটােবস িসেdেম সম ডটা কqrীয়ভােব িনয়িjত হওয়ায় কান sিট দখা িদেল সাধারণ ববহারকারী সংেশাধন করেত পােরনা 2H ডটােবস িসেdেম য সম সফটওয়ার ইিtিনয়ার ডটােবস অাডিমিনেuটর ডটােবস িডজাইনার ডটােবস অপােরটর েতকেক কােজ দN হেত হয় 3H ডটােবস িসেdম Vাপন ও রNণােবNণ যেথ( বয়বhল 4H ডটােবস িসেdম তলনামলকভােব অেনক জিটল ি+য়া ডটা িডকশনাির (Data Dictionary) ডটা িডকশনাির এমন একিট মটােডটার সংLহয ফাইল যখােন i) ডটােবেসর ডটা সপািকত িবিভv তথ(যমন ডটার অথ ৬টার উৎপিy অন ডটার সেc সপক জটার বাবহার ডটার ধরন ও আকার ডটার ফরমযাট ইতািদ) অবVান কের ii) ডটােবেসর সম ফাইলিলর তািলকা সংরিNত থােক iii) িতিট ফাইেলর রকত সংখা এবং িফz বা ডটা পেদর নাম এবং ধন সংরিNত থােক iv) +মানসাের িনিদ ( সিচ ও িনয়ম অনসাের ফাইলিলর পিরচায় সিচপP আকাের রাখা গােক v) ডটােবেসর টাবেলর NেP িবিভv তথ (যমন-টিবেলর নাম টিবেলর ওনার (Owner) বা মািলক কখন টিবলিট
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
PPPPaaaaggggeeee 2222 ooooffff 7777
Oতির করা হয়েছ এবং শষ কেব টিবলিট অাকেসস করা হেয়েছ টিবলিটর uাকচার বা গঠন ইতািদ) সংরিNত থােক vi) ডটােবেসর অবেজিলর ইনেড (Index) কেqটস (Constraints) আকেসস রাইট (Access Right) িভফqট মান (Default Value) ইতািদ সংরিNত থােক তাই ডটা িডকশনাির কতপেN ভটােবেসর মটােডটা য ফাইেল সিচত থােক তােক বােঝায় তেব ডটা িভকশনািরেত কত ডটা থােক না এবং ডটা িডকশনাির ছাড়া DBMS ডটােবস থেক ডটা অাকেসস করেত পাের না DBMS-এ ডটা িডকশনাির লকািয়ত (Hidden) অবVায় রাখা হয় িনরাপyার কারেণ তেব ডটােবেসর pnপণ ববহারকারী যমন-ডটােবস আাডিমিনেuটর (DBA) অািেকশন াLামার ডটা মােনজার ইতািদ শাসক ডটা িডকশনাির ববহার করেত পাের মটােডটা (Metadata) মটােডটা হল ডটা অাবাউট ডটা (Data About Data) অথ াৎ কােনা ডটা সপেক বণ না করার জন য ডটা ববহার করা হয় তােক মটােডটা বেল ডটােবস িসেdেম ডটা িডকশনাির (Data Dictionary)-রমেধ মটােডটা সিত থােক মটােডটার মাধেম কােনা ডটােবস অবেজের যসব তথিল সংরিNত থােক সিল হল i অবেজিটর ওনার (Owner) বা মািলক এবং গঠন iiH অবেজের ডটাটাইপ ও আকার iiiH অবেজিট কখন Oতির করা হেয়েছ ivH শষ কখন অবেজিট ববহার করা হেয়েছ vH অবেজিটর অাকেসস রাইট (Access Right) ইতািদ উদাহরেণর সাহােয মটােডটার ধারণা করা যেত পাের যমন - iH একিট টট ফাইেলর NেP তার সাইজ তার লখক কান তািরেখ Oতির এবং কান তািরেখ শষ পিরবত ন করা হেয়েছ ইতািদর িববরণ হল ওই ফাইেলর মটােডটা iiH ছিবয কােনা ফাইেলর মটােডটা হল তার সাইজ (Size) রেজািলউশন (Resolution) ইতািদ iiH আবার ওেয়বেপেজর NেP মটােডটা হলেপজিট কান ভাষায় লখা হেয়েছ ববeত টলস পজিটর িবষয়ব ইতািদ ডটােবস িমা (Schema) ও ইনdা (Instance) িমা (Schema) কােনা ডটােবেসর বা টিবেলর গঠন য প)িতর মাধেম িনধ ািরত হয় তােক ডটােবস িমা (Schema) বেল অথ াৎ ডটােবস িমার মাধেম টিবেলর নাম কলাম বা অািিবউের নাম এবং তােদর ডটা টাইপ উেখ করা হয় ইটা (Instance) ডটােবস িসেdেম কােনা িনিদ ( মহেত া ডটার সমL িচPিটেক ওই মহেত র ডটােবস ইটা বেল সমেয়র সেc সেc ডটােবস ইটা পিরবিত ত হেত পাের DBA কী DBA বা ডটােবস অাডিমিনেuটর-এর কাজিল লখাে
Database Administrator (DBA) য বি DBMS বা ডটােবস মােনজেমqট িসেdেমর সমL ডটােবস বা সপিক ত সমL ােLামিলেক কqrীয়ভােব Pণ কের তােক DBA বা ডটােবস অাডিমিনেuটর (Database Administrator ) বেল DBA-এর কাজ (Function)িল হল-- (i) DBA ডটােবস িসেdেমর িমা বা গঠন বণ না কের (ii) ডটােবস ববহার করার NেP িবিভv ববহারকারীেক অনমিত দান কের (iii) ডটােবস িসেdেমর ডটার Oবধতা ও িনরাপy রNা কের (iv) ডটা বাকআপ (Back up) ডটার আপেডশন (Updation) িডে য়ােজনীয় জায়গা ফাকা করা ইতািদ িবিভv pnপণ কাজ সপাদন কের (v) ডটােবস িসেdেমর জন য়ােজনীয় সফটওয়ার ও হাড ওয়ার িনব াচন করা
DBMS এর 3 Schema Architecture ডটােবেসর গঠন জিটল কিতর হওয়ায় দN ডটােবস ােLামারগণ ডটােবস থেক ডটা দশ েনর NেP সাধারণ ববহারকারীেদর থেক িবিভv িবমত েরর মাধেম ডটােবেসর মল গঠনেক আড়াল কের রােখন ডটােবস িমার িবমত র িতন ভােগ িবভ-
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
aH িফিজকাল লেভল িমা (Physical Levকত পিরমাণ জায়গা বা Memory লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয় সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNমbH লিজকাল লেভল িমা (Logical Level Schema) সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের লকানাে (Hidden) থােক cH এটারনাল বা িভউ লেভল িমা (External or View Level Schema) ডটােবেসর সেc সপক (interaction) ও যাবণ না এই ের লকােনা(Hidden) থােক Data Model ডটা মেডল(Data Model) এমন একিট িবষয়এর মাধেম ডটােবেসর সম ডটািল িনেজেদরসংরিNত হেব কীভােব িনয়িjত হেব তা আডটা মেডল িবিভv কার হেত পাের যমন
Entity Relationship Model এনিটিট িরেলশনিশপ মেডল হল কতকিলসপেক র (Relationship) িচিPত Jপ যা বাব পিরিVিতেক (Real World) সqদর approach মেন চেল এনিটিট িরেলশনিশপ মেডেলর pnপণ উপাদানিল
(Physical Level Schema) এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনাপিরচালক িমার এই ের কাজ করেত সNম
(Logical Level Schema) যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
(External or View Level Schema) িমার এই ের সাধারণ ববহারকারী ও যাগােযাগ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
িবষয় বা ধারণা যার মাধেম ডটােবেসর uাকচার বািনেজেদর মেধ কীভােব য থাকেব কীভােব েসসআেলািচত থােক
যমন-
কতকিল মল ধারণাগত িবষয় বা ব বা অবেজ (Entity) ডটােবস Oতির করেত ববeত হয় এনিটিট িরেলশনিশপ ও িনখতভােব ডটােবেস উপVাপন করা যায় এই
উপাদানিল হল -
PPPPaaaaggggeeee 3333 ooooffff 7777
এই ধরেনর িমা ডটােবেস ডটা dার বা সংরNেণর জন লাগেব তা িনধ ারণ কের এই িমার মাধেম ভৗত ের ডটােবস িডজাইন করা হয়
সাধারণ ববহারকারীরা এই র অাকেসস বা ববহার করেত পাের না সাধারণত ডটােবস িডজাইনার িসেdম
যৗিক বা লিজকাল লেভল িমা েরর মাধেম ডটােবেস সংরিNত dার টাইপ কীJপ হেব এবং ডটােবেস সংরিNত রকেড র পারRপিরক িরেলশন (Relation) বা সপক কী হেব তা িনধ ারণ করা হয় সাধারণত ডটােবস অাডিমিনেuটর এই ের কাজ কের ডটােবেসর ভৗত গঠন এই ের
িমার এই ের সাধারণ ববহারকারী গ গেড় তলেত সNম হেলও িমার ভৗত গঠন ও যৗিক েরর
বা কাঠামােক বণ না করা হয় েসস হেব কীভােব
(Entity) এবং তােদর মেধ িরেলশনিশপ মেডেলর মাধেম এই মেডলিট Top-Down
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
এনিটিট (Entity) এনিটিট হল Entity-relationship িচিত করা হয় এবং অন কান ব বা ঘটনা
যমন- iH কাপািনর NেP কম চাির (Employee) েতেকই এক-একিট এনিটিট iiH িবদালেয়রেNেP ছাPছাPী (Students) েতকিট এনিটিট (Entity)-ক িচ করার তjভােব িচিত করা যায় যমন-িবদালেয়ররাল নiexclর (Roll NoH) নাম (Name) িঠকানাএনিটিট সট (Entity Set) একই ধরেনরতািলকােক এনিটিট সট (Entity Set) বেলিঠকানা (Address) Phone Number DesignationiiH িবদালেয়র সম ছাPছাPীেদর (Students) (Class) ইতািদ িনেয় এনিটিট সট অািিবউট (Attribute) ডটােবেসর িতিটসেটর অািিবউট (Attribute) বেল যমননiexclর (Roll NoH) নাম (Name) িঠকানা (Address) ইতািদ iiH হাসপাতােলর ডাার (Doctor) এনিটিটফান নiexclর (Phone NoH) Rপশালাইেজশন
এনিটিট-র িবিভv কার অািিবউট থােকiH িসপল অািিবউট (Simple Attribute) অািিবউট (Simple Attribute) বেল যমনiiH কেপািসট অািিবউট (Composite Attribute) কেপািসট অািিবউট (Composite Attribute) Name ও Surname- এ ভাগ করা যায় iiH িসcল ভালড অািিবউট (Single Valuহয় তােদর িসcল ভালড অািিবউট (Single Valued Attribute)যমন ndash Student এনিটিটর রাল নiexclর (Roll NoH) ivH মালিটভালড অািিবউট (Multivalued Atribute) একািধক হয় তােদর মালিটভালড অািিবউট(Phone NoH) অািিবউেটর মান ছাP বা িরেলশনিশপ (Relationship) ডটােবেসVাপনেক িরেলশনিশপ (Relationship) বেল েতক এনিটিটর যএনিটিট সট থেক িনিদ ( এনিটিট ক পপকভােবসপক বা িরেলশনিশপ Vাপন করেত পাের
relationship মেডেলর ধান ধারণাগত িবষয় বা বঘটনা থেক সপণ পথক ভােব সনা করা যায়
(Employee) িডপাট েমqট(Department) কাdমার বা
(Students) িশNক (Teachers) ইতািদ েতেক এক-একিটকরার জন একািধক Oবিশ( থােক এবং িকছ Oবিশে(র
িবদালেয়র ছাPছাPী (Students) এই এনিটিট(Entity) িঠকানা (Address) Mিণ (Class) মাক স (Marks)
ধরেনর এবং একই Oবিশে(র একািধক এনিটিট িনেয় গিঠতবেল যমন-iH কাপািনর সম কম চারীেদর নাম (EmployeeDesignation বতন (Salary) ইতািদ মান িনেয় গিঠত
(Students) রাল নiexclর (Roll NoH) নাম (Name) িঠকানা
িতিট এনিটিট সেটর য িনজ Oবিশ( থােক তােদরযমন-iH িবদালেয়র ছাPছাPী বা Students এনিটিটর অািিবউটিল হল
(Address) ফান নiexclর (Phone NoH) Mিণ (Class)
এনিটিট-র অািিবউটিল হল আই িড (ID) নাম (Name)Rপশালাইেজশন (Specialization) ইতািদ
থােক - (Simple Attribute) সাধারণত য অািিবউটিল আর িবভ
যমন-Student এনিটিট-র রাল নiexclর (Roll NoH) (Composite Attribute) য সম অািিবউট ভেঙ ফলা বা
(Composite Attribute) বেল যমন-Student এনিটিটর নাম (Name)
(Single Valued Attribute) এনিটিট র স সম অািিবউেট(Single Valued Attribute) বেল (Roll NoH) অািিবউেটর NেP েতক ছাPবা ছাPীর
(Multivalued Atribute) িনিদ ( এনিটিট র NেP স-সমঅািিবউট (Multivalued Aftribute) বেল যমন-Student
ছাPীেদর NেP একািধক হেত পাের
ডটােবেস অবিVত একািধক এনিটিট-র মেধ পারRপিরক বেল েতক এনিটিটর য অািিবউটিটর মান তj
পপকভােব িচিত করা যায়) তার মাধেম একািধক পাের
PPPPaaaaggggeeee 4444 ooooffff 7777
ব যার currenারা অবেজেক
বা yenােয়qট (Customer)
একিট এনিটিট Oবিশে(র মাধেম এনিটিট ক
(Entity) র উেখেযাগ Oবিশ( হল (Marks) ইতািদ
গিঠত সট বা িলd বা (Employee Name) ID গিঠত এনিটিট সট
িঠকানা (Address) Mিণ
তােদর ওই এনিটিট বা এনিটিট এনিটিটর অািিবউটিল হল রাল
(Class) মাক স (Marks)
(Name) িঠকানা (Address)
িবভ করা যায়না তােদর িসপল (Roll NoH)
বা িবভ করা যায় তােদর Name) অািিবউটিট First
অািিবউেটর মান brvbarধমাP একিটই
ছাPীর একিট মানই হয় সম অািিবউেটর মান Student এনিটিট র ফান নiexclর
সপক (Association) তj থােক (যার মাধেম এনিটিট িনেজেদর মেধ
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
যমন - iH কােনা কাপািনর কম চারী (Employee) িরেলশনিশপ iiH হাসপাতােলর ডাার (Doctor) িবদালেয়র ছাPছাPী (Student) ও িশNক এনিটিট িরেলশনিশপ ডায়াLাম (Entity-Relationship Diagram or ER Diagram)য ডায়াLােমর মাধেম সমL ডটােবেসর এনিটিটডটােবসিটর সামিLক গঠন বণ না করা যায়
Relationship Diagram or ER Diagram)
উদাহরণ িবদালেয়র িশNক (Teacher)
িবিভv কার কী (Types of Key) িরেলশনাল ডটােবস মেডেল কী (Key) হলঅািিবউট বা িফল যার বা যােদর মাধেমযায় যমন -STUDENT টিবেলর (Roll Name Class Phone Marksিরেলশনাল ডটা মেডেল িবিভv ধরেনর কী সপার-কী (Super-key) সপার-কী (Superঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড
STUDENT টিবেলর Super-key হেলা - iH _S reg vH _S id S class viH S
(Employee) ও িডপাট েমqট (Department) এনিটিট(Doctor) ও রাগী (Patient) এর মেধ সপক বা
িশNক (Teacher) এর মেধ সপক বা িরেলশনিশপ
Relationship Diagram or ER Diagram) এনিটিট-িলর মেধ সপক Vাপন বা িরেলশনিশেপযায় তােক এনিটিট িরেলশনিশপ ডায়াLাম বা ই আর
Relationship Diagram or ER Diagram) বেল এই ডায়াLাম Oতিরেত ববeত িচ বা তীক
(Teacher) ও ছাPছাPীর (Student) এনিটিট িরেলশনিশপ ডায়া
হল কােনা িনিদ ( িরেলশন বা এনিটিট-র বা টিবেলরমাধেম ওই িরেলশেনর বা টিবেলর কােনা টাপল (Tuple)
(Roll Name Class Phone Marks অািিবউটিলরকী ববeত হয় সিল হল ndash
(Super-key) হল িনিদ ( ডটােবস িরেলশন বা টিবেলরঅািিবউেটর সমি( যার currenারা ঐ টিবেলর যেকােনা রকড ক তjভােব (Lniquely) শনাy
iH _ S id iiH _ _S id S nameH iiiH _S_ _S name S ph _S class ইতািদ
PPPPaaaaggggeeee 5555 ooooffff 7777
এনিটিট র মেধ সপক বা বা িরেলশনিশপ iiiH
িরেলশনিশেপর িচP তেল ধের আর ডায়াLাম (Entity
তীকিল হেলা ndash
ডায়াLাম হল-
টিবেলর এক বা একািধক (Tuple) বা রকড েক সনা করা
অািিবউটিলর মেধ কী (Key) হল Roll
টিবেলর এক বা একািধক িফz বা শনাy (Identify) করা যায়
_ _ name S reg S add ivH
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
PPPPaaaaggggeeee 6666 ooooffff 7777
কািlেডট-কী Candidate-key িরেলশনাল ডটােবস িসেdেম এক বা একািধক সপার-কী (Super-key)-িলর মেধ য সম সপার-কী -ক আর ছাটা করা বা ভাঙা যায় না এবং ছাটা করেলও সই ছাটা ছাটা অংশ ( কতপেN এক বা একািধক অািিবউট) currenারা ডটােবস টিবেলর কােনা রকড েক yordfভােব (Uniquely)িচিত করা যায় না তােক ওই টিবেলর কািlেডট-কী (Candidate-key) বেল অতএব দy সপার-কী-িলর মেধ i iv ও vi হল কািlেডট-কী (Candidate-key) াইমাির-কী (Primary-key) কােনা িরেলশনাল ডটােবস িসেdেম কানা িরেলশেনরেটিবেলর কািlেডট-কী-িলর মেধ সবােচেয় Nr কী যার currenারা ওই িরেলশন বা টিবেলর য-কানা টাপল (Tuple) বা রকড েক তjভােব (Uniquely) িচিত করা যায় তােক ওই িরেলশন বা টিবেলর াইমাির -কী (Primary-key) বেল টিবেল এই Key-এর মান সবসময় তj (Distinct) এবং কখনাই ফাকা (NULL) হেত পাের না উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ iH S id _ _iiH (S reg iiiH S name _ _ S ph S class I এর মেধ _ S id হল STUDENT টিবেলর াইমাির-কী [তেব এখােন _ S reg ও Primary-key
িহেসেব ববহার করা যত] াইমারী কী এর Oবিশ( ( Characteristics of Primary Key) iH কানা িরেলশন বা ডটােবস টিবেল brvbarধমাP একিটই াইমাির-কী থােক iH াইমাির-কী য অািিবউেটর মান কখনােই ফাকা বা শন হয় না iiH াইমাির-কী অািিবউেটর মান ডিেকট হওয়া থেক িতরাধ কের অshyটারেনট -কী (Alternate-key) কানা িরেলশন বা ডটােবস টিবেলর কািlেডট-কী-িলর মেধ য-কানা একিটেক াইমাির-কী িহেসেব বেছ নওয়ার পর বািক য কী বা কী-সটিল পেড় থােক তােক অshyটারেনট-কী (Alternate-key) বেল উদাহরণ দy STUDENT টিবেলর 3িট কািlেডট-কী অবVান কের - _ _ iH S id iiH S reg iiiH
_ _ _ (S name S ph S class এর মেধ _ (S id -ক াইমাির-কী িহেসেব বেছ িনেল বািক (ii) ও (iii) কী সট পেড় থােক এিলই STUDENT টিবেলর অshyটারেনট -কী (Alternate Key) কপািজট-কী (Composite-key) ডটােবস িসেdেম কখনও কখনও কানা িরেলশন বা টিবল বা এনিটিট-র অেনক সময় তj িফz বা অযািিবউট থােক না সেNেP একািধক িফz বা অািিবউট িমিলত হেয় ওই টিবেলর াইমাির-কী (Primary-kev) িহেসেব কাজ কের তখন ওই একািধক িফেzর সটেক কপািজট-কী (Composite-key) বেল উদাহরণ ধরা যাক Employee Dept Salary নােম িতনিট টিবল আেছ
_ _ _ _ _iH Employee (E id E name E city E designation Dept id) _ _ _iiH Dept (Dept id Dept name Dept location)
_ _iiiH Salary(E id Dept id amount doj)H ওপেরর iH নং টিবেলর াইমাির-কী _E id এবং iiH নং টিবেলর াইমাির-কী Dept id িক iii নং টিবেলর কানা তj িফz বা অিিবউট নই _ _ E id Dept id কী-সট Salary টিবেলর াইমাির-কী িহেসেব কাজ কের শিশালী (Strong) এবং দব ল (Weak) এনিটিট ডটােবেসর য সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায়H তােক শীিশালী এনিটিট বেল যমন-Student (RollName Sex City Mark) এনিটিট-র াইমাির-কী Roll য-সম এনিটিট-র অািিবউট থেক িনিদ ( াইমাির-কী খেজ পাওয়া যায় না তােক দব ল এনটািট বেল যমন-Loan
_(Loan name _Loan date) এনিটিট-র থেক াইমাির-কী পাওয়া যায় না ডটােবস কেqটস (Database Constraints) কেqটস (Contraints) িরেলশনাল ডটােবেস ডটার সিঠকতা (accuracy) িবmacrতা (Reliability) সপণ তা (Completeness) ইতািদ বজায় রাখার জন ডটা েবশ করার সময় য িনয়ম নীিত (Rules) ববহার করা হয় তােক
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
PPPPaaaaggggeeee 7777 ooooffff 7777
ডটােবস কেqটস (constraints) বেল ডটােবেস িবিভv ধরেনর কেqটস (Constraints) ববeত হয় সিল হল - (i) এনিটিট ইিqটিLিট কেqটস (Entity Integrity Constraints) িরেলশনাস ডটােবস িসেdেম এনিটিট ইিqটিLিট কেqটস হল সই সম িনয়মনীিত যার মাধেম বাঝা যায় কানা একিট টাপল (Tuple) বা রকেড র (Rccord) াইমাির কী-এর মান কখনও শন (NULL) হেত পাের না (ii) ডামন কলেqটস (Domain Constraints) িরেলশনাল ডটােবস িসেdেম ডােেমন কqপেqটস হল সই সমসত িনয়মনীিত যার মাধেম বাঝা যায় কানা ডটােবস টিবেলর িতিট িফz বা অািিবউেটর একিট িনিদ ( ভাল (Value) বা মান আেছ যা ওই অািিবউিটর মােনর সট থেক উপলdeg হয় ধরা যাক STUDENT টিবেলর Month িফেzর মান বারা মােসর নােমর য সট হয় তার মেধ থেক য-কােনা একিট হেব (iii) রফােরিয়াল ইিqটিLিট কেqটস (Referential Integrity constraints) িরেলশনাল ডটােবস িসেdম যখন দিট টিবল বা এনিটিটর মেধ সপক বা িরেলশনিশপ Vাপন করা হয় তখন রফােরিয়াল ইিplusmnিLিট কেqqটস ববহার করা হয় এই কেqটস-এর মাধেম কানা টিবেলর ফেরন কী মােনর জন অন টিবেলর াইমাির কী-এর মান িনিsup2ত করা হয় অথ াৎ থম টিবেলর াইমাির কী িফেzর মান বতীত অন কানা মান িcurrenতীয় টিবেলর ফেরন কী িফেzর মান িহেসেব গহীত হেব না তমিন Referential Integrity িনয়েমর জন থম টিবেলর কানা ডটা মেছ ফলেল বা পিরবত ন করেল িcurrenতীয় টিবেলর ডটাও মেছ যােব বা পিরবিত ত হেব এই িনয়মেক Cascading delete বা cascading update বেল
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
CHAPTERCHAPTERCHAPTERCHAPTER
DATABASE DATABASE DATABASE DATABASE
MANAGEMENT MANAGEMENT MANAGEMENT MANAGEMENT
SYSTEMSYSTEMSYSTEMSYSTEM
CLASS XIICLASS XIICLASS XIICLASS XII
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
Data Data can be defined as a representation of facts concepts or instructions in a formalized manner which
should be suitable for communication interpretation or processing by human or electronic machine
Information Information is organized or classified data which has some meaningful values for the receiver
Information is the processed data on which decisions and actions are based
Database Database is a collection of data and Management System is a set of programs to store and retrieve
those data
Database Management System A database management system (DBMS) is a software package designed to
define manipulate retrieve and manage data in a database A DBMS generally manipulates the data itself the
data format field names record structure and file structure
Database Applications
Applications where we use Database Management Systems are
Telecom There is a database to keeps track of the information regarding calls made network usage customer
details etc Without the database systems it is hard to maintain that huge amount of data that keeps updating
every millisecond
Industry Where it is a manufacturing unit warehouse or distribution centre each one needs a database to keep
the records of ins and outs For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each day
this is where DBMS comes into picture
Banking System For storing customer info tracking day to day credit and debit transactions generating bank
statements etc All this work has been done with the help of Database management systems
Sales To store customer information production information and invoice details
Airlines To travel though airlines we make early reservations this reservation information along with flight
schedule is stored in database
Education sector Database systems are frequently used in schools and colleges to store and retrieve the data
regarding student details staff details course details exam details payroll data attendance details fees details
etc There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient manner
Online shopping You must be aware of the online shopping websites such as Amazon Flipkart etc These sites
store the product information your addresses and preferences credit details and provide you the relevant list of
products based on your query All this involves a Database management system
Drawbacks of File system
Data redundancy Data redundancy refers to the duplication of data let say we are managing the data of a
college where a student is enrolled for two courses the same student details in such case will be stored twice
which will take more storage than needed Data redundancy often leads to higher storage costs and poor access
time
Data inconsistency Data redundancy leads to data inconsistency lets take the same example that we have taken
above a student is enrolled for two courses and we have student address stored twice now lets say student
requests to change his address if the address is changed at one place and not on all the records then this can lead
to data inconsistency
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
Data Isolation Because data are scattered in various files and files may be in different formats writing new
application programs to retrieve the appropriate data is difficult
Dependency on application programs Changing files would lead to change in application programs
Data Security Data should be secured from unauthorised
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
processing systems
Advantage of DBMS over file system
There are several advantages of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data
improves access time
Data Consistency and Integrity As we discussed earlier t
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
it
Data Security It is easier to apply access constraints in database systems so th
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
data leaks and misuse of data
Privacy Limited access means privacy of data
Easy access to data Database systems manages data in such a way so that the data is easily accessible with fast
response times
Easy recovery Since database system keeps the backup of data it is easier to do a full recovery of data in case of
a failure
Flexible Database systems are more flexible than file processing systems
Disadvantages of DBMS
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them
DBMS ndash Three Level Architecture
Because data are scattered in various files and files may be in different formats writing new
e the appropriate data is difficult
Changing files would lead to change in application programs
Data should be secured from unauthorised access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No redundant data Redundancy removed by data normalization No data duplication saves storage and
Data Consistency and Integrity As we discussed earlier the root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
Data Security It is easier to apply access constraints in database systems so that only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
Privacy Limited access means privacy of data
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
systems are more flexible than file processing systems
DBMS implementation cost is high compared to the file system
Complexity Database systems are complex to understand
Performance Database systems are generic making them suitable for various applications
Because data are scattered in various files and files may be in different formats writing new
Changing files would lead to change in application programs
access for example a student in a college should not
be able to see the payroll details of the teachers such kind of security constraints are difficult to apply in file
of Database management system over file system Few of them are as follows
No data duplication saves storage and
he root cause of data inconsistency is data redundancy
since data normalization takes care of the data redundancy data inconsistency also been taken care of as part of
at only authorized user is able to
access the data Each user has a different set of access thus data is secured from the issues such as identity theft
atabase systems manages data in such a way so that the data is easily accessible with fast
keeps the backup of data it is easier to do a full recovery of data in case of
suitable for various applications
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
This architecture has three levels
1 External level
2 Conceptual level
3 Internal level
External level
It is also called view level The reason this level is called ldquoviewrdquo is
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level)
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
Conceptual level
It is also called logical level The whole design of the database such as relationship among data schema of data
etc are described in this level
Database constraints and security are also implemented in this level of architecture This level is maintained
DBA (database administrator)
Internal level
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Instance and schema in DBMS
Schema Design of a database is called the schema
and view schema
For example In the following diagram we have a schema that shows the r
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
The design of a database at physical level is called
described at this level
Design of database at logical level is called
this level at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
physical level)
Design of database at view level is called
database systems
view level The reason this level is called ldquoviewrdquo is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table defi
only concerned about data which is what returned back to the view level after it has been fetched from database
External level is the ldquotop levelrdquo of the Three Level DBMS Architecture
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest le
Design of a database is called the schema Schema is of three types Physical schema logical schema
For example In the following diagram we have a schema that shows the relationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
design of a database at physical level is called physical schema how the data stored in blocks of storage is
Design of database at logical level is called logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
level is called view schema This generally describes end user interaction with
because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
The user doesnrsquot need to know the database schema details such as data structure table definition etc user is
only concerned about data which is what returned back to the view level after it has been fetched from database
logical level The whole design of the database such as relationship among data schema of data
Database constraints and security are also implemented in this level of architecture This level is maintained by
This level is also known as physical level This level describes how the data is actually stored in the storage
devices This level is also responsible for allocating space to the data This is the lowest level of the architecture
Schema is of three types Physical schema logical schema
elationship between three tables
Course Student and Section The diagram only shows the design of the database it doesnrsquot show the data
present in those tables Schema is only a structural view(design) of a database as shown in the diagram below
physical schema how the data stored in blocks of storage is
logical schema programmers and database administrators work at
at this level data can be described as certain types of data records gets stored in data structures
however the internal details such as implementation of data structure is hidden at this level (available at
view schema This generally describes end user interaction with
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
Instance The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tab
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
instance of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the ins
database
DBMS languages
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (St
Types of DBMS languages
Data Definition Language (DDL)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform o
To create the database instance ndash CREATE
To alter the structure of database ndash ALTER
To drop database instances ndash DROP
To delete tables in a database instance ndash
To rename database instances ndash RENAME
To drop objects from database such as tables
Data Manipulation Language (DML)
DML is used for accessing and manipulating data in a database The following operations on database comes
under DML
To read records from table(s) ndash SELECT
To insert record(s) into the table(s) ndash INS
The data stored in database at a particular moment of time is called instance of database
schema defines the variable declarations in tables that belong to a particular database the value of these
variables at a moment of time is called the instance of that database
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
the data stored in database is called the instance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
can be used for this purpose one of them is SQL (Structured Query Language)
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
database Lets see the operations that we can perform on database using DDL
CREATE
ALTER
ndash TRUNCATE
RENAME
se such as tables ndash DROP
DML is used for accessing and manipulating data in a database The following operations on database comes
INSERT
The data stored in database at a particular moment of time is called instance of database Database
les that belong to a particular database the value of these
For example lets say we have a single table student in the database today the table has 100 records so today the
of the database has 100 records Lets say we are going to add another 100 records in this table by
tomorrow so the instance of database tomorrow will have 200 records in table In short at a particular moment
tance that changes over time when we add or delete data from the
Database languages are used to read update and store data in a database There are several such languages that
DDL is used for specifying the database schema It is used for creating tables schema indexes constraints etc in
DML is used for accessing and manipulating data in a database The following operations on database comes
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
Update the data in table(s) ndash UPDATE
Delete all the records from the table ndash DELETE
Data Control language (DCL)
DCL is used for granting and revoking user access on a database
To grant access to user ndash GRANT
To revoke access from user ndash REVOKE
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
Data models in DBMS
Data Model is a logical structure of Database
relationship among data constrains etc
Entity Relationship Model ndash ER Model
An Entityndashrelationship model (ER model)
is known as Entity Relationship Diagram (ER Diagram)
can later be implemented as a database The main components of E
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an enti
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
A simple ER Diagram
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
study in multiple colleges at the same time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
DELETE
DCL is used for granting and revoking user access on a database ndash
In practical data definition language data manipulation language and data control languages are not separate
language rather they are the parts of a single database language such as SQL
is a logical structure of Database It describes the design of database to reflect
relationship among data constrains etc
Model
relationship model (ER model) describes the structure of a database with the help of a diagram which
Entity Relationship Diagram (ER Diagram) An ER model is a design or blueprint of a database that
can later be implemented as a database The main components of E-R model are entity set and relationship set
What is an Entity Relationship Diagram (ER Diagram)
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
entities can have attributes In terms of DBMS an entity is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
database Lets have a look at a simple ER diagram to understand this concept
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
and College entity has attributes such as Col_ID amp Col_Name
In practical data definition language data manipulation language and data control languages are not separate
e design of database to reflect entities attributes
describes the structure of a database with the help of a diagram which
An ER model is a design or blueprint of a database that
re entity set and relationship set
An ER diagram shows the relationship among entity sets An entity set is a group of similar entities and these
ty is a table or attribute of a table in database so by
showing relationship among tables and their attributes ER diagram shows the complete logical structure of a
In the following diagram we have two entities Student and College and their relationship The relationship
between Student and College is many to one as a college can have many students however a student cannot
me time Student entity has attributes such as Stu_Id Stu_Name amp Stu_Addr
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
Here are the geometric shapes and their meaning in an E
Rectangle Represents Entity sets
Ellipses Attributes
Diamonds Relationship Set
Lines They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses Multivalued Attributes
Dashed Ellipses Derived Attributes
Double Rectangles Weak Entity Sets
Double Lines Total participation of an entity in a relationship set
Components of a ER Diagram
As shown in the above diagram an ER diagram has three main components
1 Entity
2 Attribute
3 Relationship
Here are the geometric shapes and their meaning in an E-R Diagram
hey link attributes to Entity Sets and Entity sets to Relationship Set
Multivalued Attributes
Total participation of an entity in a relationship set
hown in the above diagram an ER diagram has three main components
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
1 Entity
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
For example In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
for now focus on entities
Weak Entity
An entity that cannot be uniquely identified by its own attribu
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
entity
2 Attribute
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
four types of attributes
1 Key attribute
2 Composite attribute
3 Multivalued attribute
4 Derived attribute
1 Key attribute
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example
be uniquely identified without knowing the bank to which the account belongs so bank acco
An attribute describes the property of an entity An attribute is represented as Oval in an ER diag
A key attribute can uniquely identify an entity from an entity set For example student roll number can unique
identify a student from a set of students Key attribute is represented by oval same as other attributes however
An entity is an object or component of data An entity is represented as rectangle in an ER diagram
am we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college We will read more about relationships later
tes and relies on the relationship with other entity
is called weak entity The weak entity is represented by a double rectangle For example ndash a bank account cannot
be uniquely identified without knowing the bank to which the account belongs so bank account is a weak
An attribute describes the property of an entity An attribute is represented as Oval in an ER diagram There are
A key attribute can uniquely identify an entity from an entity set For example student roll number can uniquely
identify a student from a set of students Key attribute is represented by oval same as other attributes however
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
2 Composite attribute
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
code state country
3 Multivalued attribute
An attribute that can hold multiple values is known as multivalued attribute It is re
ovals in an ER Diagram For example ndash A person can have more than one phone numbers so the phone number
attribute is multivalued
4 Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribu
by dashed oval in an ER Diagram For example
can be derived from another attribute (Date of birth)
E-R diagram with multivalued and derived attributes
3 Relationship
A relationship is represented by diamond shape in ER diagram
are four types of relationships
1 One to One
2 One to Many
3 Many to One
4 Many to Many
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
An attribute that can hold multiple values is known as multivalued attribute It is represented with
A person can have more than one phone numbers so the phone number
A derived attribute is one whose value is dynamic and derived from another attribute It is represented
in an ER Diagram For example ndash Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth)
R diagram with multivalued and derived attributes
A relationship is represented by diamond shape in ER diagram it shows the relationship among entities There
An attribute that is a combination of other attributes is known as composite attribute For example In student
entity the student address is a composite attribute as an address is composed of other attributes such as pin
presented with double
A person can have more than one phone numbers so the phone number
te It is represented
Person age is a derived attribute as it changes over time and
it shows the relationship among entities There
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
1 One to One Relationship
When a single instance of an entity is associated with a single instance of another en
one relationship For example a person has only one passport and a passport is given to one person
2 One to Many Relationship
When a single instance of an entity is associate
one to many relationship For example ndash
many customers
3 Many to One Relationship
When more than one instances of an entity is associated with a single instance of an
many to one relationship For example ndash
in many colleges at the same time
4 Many to Many Relationship
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship For example a can be assigned to many projects and a project can be assigned
to many students
When a single instance of an entity is associated with a single instance of another entity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
When a single instance of an entity is associated with more than one instances of another entity then it is called
ndash a customer can place many orders but a order cannot be placed by
When more than one instances of an entity is associated with a single instance of another entity then it is called
ndash many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
tity then it is called one to
one relationship For example a person has only one passport and a passport is given to one person
d with more than one instances of another entity then it is called
a customer can place many orders but a order cannot be placed by
other entity then it is called
many students can study in a single college but a student cannot study
When more than one instances of an entity is associated with more than one instances of another entity then it is
d many to many relationship For example a can be assigned to many projects and a project can be assigned
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
Types of keys in DBMS
Primary Key ndash A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that table
Super Key ndash A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
Candidate Key ndash A super key with no redundant attribute is known as candidate key
Alternate Key ndash Out of all candidate keys only one gets selected alternate or secondary keys
Composite Key ndash A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
Foreign Key ndash Foreign keys are the columns of a table that points to the primary key of another table They act as a cross-reference between tables
RDBMS Concepts
RDBMS stands for relational database management system A relational model can be represented as a table of
rows and columns A relational database has following major components
1 Table
2 Record or Tuple
3 Field or Column name or Attribute
4 Domain
1 Table
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Table STUDENT
Student_Id Student_Name
101 Chaitanya
102 Ajeet
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
A super key with no redundant attribute is known as candidate key
Out of all candidate keys only one gets selected as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records amp tuples) in a table is called composite key
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
and columns A relational database has following major components
A table is a collection of data represented in rows and columns Each table has a name in database For
the following table ldquoSTUDENTrdquo stores the information of students in database
Student_Name Student_Addr
Chaitanya Dayal Bagh Agra
Ajeet Delhi
A primary is a column or set of columns in a table that uniquely identifies tuples (rows) in that
A super key is a set of one of more columns (attributes) to uniquely identify rows in a table
as primary key remaining keys are known as
A key that consists of more than one attribute to uniquely identify rows (also known as records
s are the columns of a table that points to the primary key of another table They act as
stands for relational database management system A relational model can be represented as a table of
A table is a collection of data represented in rows and columns Each table has a name in database For example
Student_Age
27
26
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc
103 Rahul Gurgaon 24
104 Shubham Chennai 25
2 Record or Tuple
Each row of a table is known as record It is also known as tuple For example the following row is a record that
we have taken from the above table
102 Ajeet Delhi 26
3 Field or Column name or Attribute
The above table ldquoSTUDENTrdquo has four fields (or attributes) Student_Id Student_Name Student_Addr amp
Student_Age
4 Domain
A domain is a set of permitted values for an attribute in table For example a domain of month-of-year can
accept January FebruaryhellipDecember as values a domain of dates can accept all possible valid dates etc We
specify domain of attribute while creating a table
An attribute cannot accept values that are outside of their domains For example In the above table
ldquoSTUDENTrdquo the Student_Id field has integer domain so that field cannot accept values that are not integers for
example Student_Id cannot has values like ldquoFirstrdquo 1011 etc