Professional Documents
Culture Documents
DBMS Practicle
DBMS Practicle
DBMS Practicle
Normalization is a process of organizing the data in database to avoid data redundancy, insertion
anomaly, update anomaly & deletion anomaly.
Anomalies in DBMS
Data modification anomalies can be categorized into three types:
Insertion Anomaly: Insertion Anomaly refers to when one cannot insert a new tuple into
a relationship due to lack of data.
Deletion Anomaly: The delete anomaly refers to the situation where the deletion of data
results in the unintended loss of some other important data.
Up-dation Anomaly: The update anomaly is when an update of a single data value
requires multiple rows of data to be updated.
An attribute that is not part of any candidate key is known as non-prime attribute.
A table is in 3NF if it is in 2NF and for each functional dependency X-> Y at least one of
the following conditions hold:
An attribute that is a part of one of the candidate keys is known as prime attribute.
An attribute that is not part of any candidate key is known as non-prime attribute.
Boyce Codd normal form (BCNF)
It is an advance version of 3NF that’s why it is also referred as 3.5NF. BCNF is stricter than 3NF.
A table complies with BCNF if it is in 3NF and for every functional dependency X->Y, X
should be the super key of the table.
Types of Joins:
Inner Join
Inner Join is a join that can be used to return all the values that have matching values in both the
tables.
Syntax:
Theta Join
Theta join combines tuples from different relations provided they satisfy the theta condition. The
join condition is denoted by the symbol θ.
Notation
R1 ⋈θ R2
Equi Join
Equi Join is an inner join that uses the equivalence condition for fetching the values of two tables.
Select employee.empId, employee.empName, department.deptName
Outer Join
Outer Join is a join that can be used to return the records in both the tables whether it has
matching records in both the tables or not.
1. Left-Outer Join
2. Right-Outer Join
3. Full-Outer Join
LEFT JOIN (R S)
This join returns all the rows of the table on the left side of the join and matches rows for the
table on the right side of the join. For the rows for which there is no matching row on the right
side, the result-set will contain null. LEFT JOIN is also known as LEFT OUTER JOIN.
Syntax:
Select employee.empId, employee.empName, department.deptName
Syntax:
Syntax:
The following SQL statement returns the cities (only distinct values) from both the "Customers"
and the "Suppliers" table:
Example
SELECT City FROM Customers
UNION
SELECT City FROM Suppliers
ORDER BY City;
Conditions:
Both SELECT statements should have an equal number of fields in the same order.
The data types of these fields should either be the same or compatible with each other.
Union All:
Union All operation is also similar to the union operation. The only difference is that it
allows duplicate values in the result set.
Syntax:
SELECT color_name FROM colors_a UNION ALL SELECT color_name FROM colors_b;
Computer networking:
Open system:
A system which is connected to the network and is ready for communication.
Closed system:
A system which is not connected to the network and can’t be communicated with.
Computer Network:
An interconnection of multiple devices, also known as hosts, that are connected using multiple
paths for the purpose of sending/receiving data or media.
Switches
Switches work as a controller which connects computers, printers, and other hardware devices to
a network in a campus or a building.
Routers
Routers help you to connect with multiple networks. It enables you to share a single internet
connection with multiple devices and saves money.
Servers:
Servers are computers that hold shared programs, files, and the network operating system.
Clients:
Clients are computer devices which access and uses the network as well as shares network
resources.
Transmission Media:
Transmission media is a carrier used to interconnect computers in a network, such as coaxial
cable, twisted-pair wire, and optical fiber cable. It is also known as links, channels, or lines.
Shared Data:
Shared data are data which is shared between the clients such as data files, printer access
programs, and email.
Hub:
Hub is a device that splits network connection into multiple computers.
Protocol:
A protocol is the set of defined rules that allows two entities to communicate across the network.
Network Topology:
The arrangement of a network that comprises nodes and connecting lines via sender and receiver
is referred to as network topology. Common examples include: Bus, Star, Mesh, Ring, and Daisy
chain.
Mesh Topology:
In a mesh topology, every device is connected to another device via a particular channel.
Star Topology:
In star topology, all the devices are connected to a single hub through a cable.
Bus Topology:
Bus topology is a network type in which every computer and network device is connected to a
single cable. It transmits the data from one end to another in a single direction.
Ring Topology:
In this topology, it forms a ring connecting devices with exactly two neighboring devices.
Tree Topology :
This topology is the variation of the Star topology. This topology has a hierarchical flow of data.
In Tree Topology, SAC (Standard Automatic Configuration ) protocols like DHCP and SAC are
used.
Hybrid Topology :
It is used when the nodes are free to take any form. It means these can be individuals such as
Ring or Star topology or can be a combination of various types of topologies.
OSI Model
The Open Systems Interconnection (OSI) model describes seven layers that computer systems
use to communicate over a network. It was the first standard model for network communications,
adopted by all major computer and telecommunication companies in the early 1980s