Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Computer Network: What Is Unicast?

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 57

Computer Network

1. OSI Layer.
2. Subnetting
3. Protocol
4. Topology
5. Switch\Router\Hub
6. Bandwidth
7. Domain Vs workgroup
8. Unicast\Multicast\Broad cast
9. Simplex\Half-duplex\Full-duplex
10. Various Port(Such as HTTP, SMTP .etc……)
11. Private IP\Public IP
12. TCP\IP\UDP
13. Circuit Switching\Packet Switching
14. Encapsulation

** What is Bandwidth ?

Answer: Bandwidth is also defined as the amount of data that can be transmitted in a fixed
amount of time. For digital devices, the bandwidth is usually expressed in bits per second(bps) or
bytes per second. For analog devices, the bandwidth is expressed in cycles per second, or Hertz (Hz).

Or,

In computing, bandwidth is the bit-rate of available or consumed information capacity expressed


typically in metric multiples of bits per second.

** What is Unicast?
Answer: Unicast is a type of communication where data is sent from one computer to
another computer.

In Unicast type of communication, there is only one sender, and one receiver.

Example:

1) Browsing a website. (Webserver is the sender and your computer is the receiver.)

2) Downloading a file from a FTP Server. (FTP Server is the sender and your computer is the
receiver.)
** What is Multicast?

Answer: Multicast is a type of communication where multicast traffic addressed for a


group of devices on the network. IP multicast traffic are sent to a group and only members of
that group receive and/or process the Multicast traffic.

Devices which are interested in a particular Multicast traffic must join to that Multicast group
to receive the traffic. IP Multicast Groups are identified by Multicast IP Addresses (IPv4
Class D Addresses)

In Multicast, the sender transmit only one copy of data and it is delivered and/or processed to
many devices (Not as delivered and processed by all devices as in Broadcast) who are
interested in that traffic.

Example : Multicast Windows Deployment Services (WDS) OS deployment traffic, IP TV


etc

** What is Broadcast?

Answer: Broadcast is a type of communication where data is sent from one computer
once and a copy of that data will be forwarded to all the devices.

In Broadcast, there is only one sender and the data is sent only once. But the Broadcast data is
delivered to all connected devices.

Switches by design will forward the broadcast traffic and Routers by design will drop the
broadcast traffic. In other words, Routers will not allow a broadcast from one LAN to cross
the Router and reach another Network Segment. The primary function of a Router is to divide
a big Broadcast domain to Multiple smaller Broadcast domain.

Example: ARP Request message, DHCP DISCOVER Message

***** simplex, Half-duplex, Full-duplex.


Simplex: Simplex communication is a communication channel that sends information in one
direction only.

Example: Radio.

Half-duplex: In half duplex mode, data can be transmitted in both directions on a signal carrier
except not at the same time.

Example: walkie-talkie.

Full-duplex: Full-duplex data transmission means that data can be transmitted in both directions
on a signal carrier at the same time. For example, on a local area network with a technology that has
full-duplex transmission, one workstation can be sending data on the line while another workstation
is receiving data.
What is a workgroup?

Answer: Workgroup is Microsoft's term for peer-to-peer local area network. Computers
running Microsoft operating systems in the same workgroup may share files, printers, or
Internet connection. Workgroup contrasts with a domain, in which computers rely on
centralized authentication.
Or, In computer networking, a workgroup is a collection of computers on a local area network (LAN)
that share common resources and responsibilities. The term is most commonly associated with
Microsoft Windows workgroups but also applies to other environments.

What is a domain in Windows?

Answer: A Windows domain is a form of a computer network in which all user accounts,
computers, printers and other security principals, are registered with a central database
located on one or more clusters of central computers known as domain controllers.
Authentication takes place on domain controllers.

Or, A group of computers and devices on a network that are administered as a unit with common
rules and procedures. Within the Internet, domains are defined by the IP address. All devices sharing
a common part of the IP address are said to be in the same domain.
&************************

A side-to-side comparison of workgroup and domain:

  Workgroup Domain
Peer-to-peer Windows
Network type Client/server network
computer network
User needs to have separate User can log on at any
Log in log in id and password at each workstation via their account
workstation and access domain resources
Computers are limited to There can be up to 2000
Workstations
maximum 10 computers
Each user controls the One administrator to
Administrator resources and security locally administer the domain and its
on their PC's users and resources.
The computers can be on
All computers must be on the
Location different local networks, i.e.
same local network or subnet.
anywhere in the world.
One can make only limited
changes to a computer's
Each user controls the
settings because network
Computer's settings settings on their own
administrators often want to
computer. No central settings.
ensure consistency among
computers.
Each computer must be
Changes made to one are
changed manually or once
Changes automatically made to all
changed must be transferred
computers
to each computer.
User needs to have separate Domain users must provide a
log in id and password at each password or other credentials
Security
workstation, but once logged each time they access the
in can access the computer. domain.

What is a port and protocol?

Answer: Most common protocols used in computer networks and the internet are TCP
(Transmission Control Protocol), UDP (User Datagram Protocol), and IP (Internet
Protocol). A port in computer networking is a logical access channel for communication
between two devices.
What is the range of port numbers?

Answer: Port numbers range from 0 to 65536, but only port numbers 0 to 1024 are reserved
for privileged services and designated as well-known ports. This list of well-known port
numbers specifies the port used by the server process as its contact port.

What do you mean by port number?


Answer: A port number is a way to identify a specific process to which an Internet or other
network message is to be forwarded when it arrives at a server. For the Transmission Control
Protocol and the User Datagram Protocol, a port number is a 16-bit integer that is put in the
header appended to a message unit.
Or, A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.

What is the range of well known TCP and UDP ports?

Answer: Well known SCTP, TCP and UDP ports, 0 through 999. Links: The well known
ports are assigned by IANA in the range of 0 to 1023.

What is port 22 used for?

Answer: Port 22 Details. Old verson of pcAnywhere uses port 22/udp (no relation to ssh
and port 22/tcp). The real pcAnywhere port is 5632. The value 0x0016 (hex) is 22 decimal;
the value of 0x1600 (hex) is 5632 decimal.

Common TCP/IP Protocols and Ports

Protocol TCP/UDP Port Number Description


File Transfer TCP 20/21 FTP is one of the most commonly used
Protocol (FTP) file transfer protocols on the Internet and
within private networks. An FTP server
(RFC 959) can easily be set up with little
networking knowledge and provides the
ability to easily relocate files from one
system to another. FTP control is
handled on TCP port 21 and its data
transfer can use TCP port 20 as well as
dynamic ports depending on the specific
configuration.
Secure Shell (SSH) TCP 22 SSH is the primary method used to
manage network devices securely at the
(RFC 4250-4256) command level. It is typically used as a
secure alternative to Telnet which does
not support secure connections.
Telnet TCP 23 Telnet is the primary method used to
manage network devices at the command
(RFC 854) level. Unlike SSH which provides a
secure connection, Telnet does not, it
simply provides a basic unsecured
connection. Many lower level network
devices support Telnet and not SSH as it
required some additional processing.
Caution should be used when connecting
to a device using Telnet over a public
network as the login credentials will be
transmitted in the clear.
Simple Mail TCP 25 SMTP is used for two primary functions,
Transfer Protocol it is used to transfer mail (email) from
(SMTP) source to destination between mail
servers and it is used by end users to
(RFC 5321) send email to a mail system.
Domain Name TCP/UDP 53 The DNS is used widely on the public
System (DNS) internet and on private networks to
translate domain names into IP
(RFC 1034-1035) addresses, typically for network routing.
DNS is hieratical with main root servers
that contain databases that list the
managers of high level Top Level
Domains (TLD) (such as .com). These
different TLD managers then contain
information for the second level domains
that are typically used by individual
users (for example, cisco.com). A DNS
server can also be set up within a private
network to private naming services
between the hosts of the internal network
without being part of the global system.
Dynamic Host UDP 67/68 DHCP is used on networks that do not
Configuration use static IP address assignment (almost
Protocol (DHCP) all of them). A DHCP server can be set
up by an administrator or engineer with a
(RFC 2131) poll of addresses that are available for
assignment. When a client device is
turned on it can request an IP address
from the local DHCP server, if there is
an available address in the pool it can be
assigned to the device. This assignment
is not permanent and expires at a
configurable interval; if an address
renewal is not requested and the lease
expires the address will be put back into
the poll for assignment.
Trivial File Transfer UDP 69 TFTP offers a method of file transfer
Protocol (TFTP) without the session establishment
requirements that FTP uses. Because
(RFC 1350) TFTP uses UDP instead of TCP it has no
way of ensuring the file has been
properly transferred, the end device must
be able to check the file to ensure proper
transfer. TFTP is typically used by
devices to upgrade software and
firmware; this includes Cisco and other
network vendors’ equipment.
Hypertext Transfer TCP 80 HTTP is one of the most commonly used
Protocol (HTTP) protocols on most networks. HTTP is the
main protocol that is used by web
(RFC 2616) browsers and is thus used by any client
that uses files located on these servers.
Post Office Protocol TCP 110 POP version 3 is one of the two main
(POP) version 3 protocols used to retrieve mail from a
server. POP was designed to be very
(RFC 1939) simple by allowing a client to retrieve
the complete contents of a server
mailbox and then deleting the contents
from the server.
Network Time UDP 123 One of the most overlooked protocols is
Protocol (NTP) NTP. NTP is used to synchronize the
devices on the Internet. Even most
(RFC 5905) modern operating systems support NTP
as a basis for keeping an accurate clock.
The use of NTP is vital on networking
systems as it provides an ability to easily
interrelate troubles from one device to
another as the clocks are precisely
accurate.
NetBIOS TCP/UDP 137/138/139 NetBIOS itself is not a protocol but is
typically used in combination with IP
(RFC 1001-1002) with the NetBIOS over TCP/IP (NBT)
protocol. NBT has long been the central
protocol used to interconnect Microsoft
Windows machines.
Internet Message TCP 143 IMAP version3 is the second of the main
Access Protocol protocols used to retrieve mail from a
(IMAP) server. While POP has wider support,
IMAP supports a wider array of remote
(RFC 3501) mailbox operations which can be helpful
to users.
Simple Network TCP/UDP 161/162 SNMP is used by network administrators
Management as a method of network management.
Protocol (SNMP) SNMP has a number of different abilities
including the ability to monitor,
(RFC 1901-1908, configure and control network devices.
3411-3418) SNMP traps can also be configured on
network devices to notify a central server
when specific actions are occurring.
Typically, these are configured to be
used when an alerting condition is
happening. In this situation, the device
will send a trap to network management
stating that an event has occurred and
that the device should be looked at
further for a source to the event.
Border Gateway TCP 179 BGP version 4 is widely used on the
Protocol (BGP) public internet and by Internet Service
Providers (ISP) to maintain very large
(RFC 4271) routing tables and traffic processing.
BGP is one of the few protocols that
have been designed to deal with the
astronomically large routing tables that
must exist on the public Internet.
Lightweight TCP/UDP 389 LDAP provides a mechanism of
Directory Access accessing and maintaining distributed
Protocol (LDAP) directory information. LDAP is based on
the ITU-T X.500 standard but has been
(RFC 4510) simplified and altered to work over
TCP/IP networks.
Hypertext Transfer TCP 443 HTTPS is used in conjunction with
Protocol over HTTP to provide the same services but
SSL/TLS (HTTPS) doing it using a secure connection which
is provided by either SSL or TLS.
(RFC 2818)
Lightweight TCP/UDP 636 Just like HTTPS, LDAPS provides the
Directory Access same function as LDAP but over a
Protocol over secure connection which is provided by
TLS/SSL (LDAPS) either SSL or TLS.

(RFC 4513)
FTP over TLS/SSL TCP 989/990 Again, just like the previous two entries,
FTP over TLS/SSL uses the FTP
(RFC 4217) protocol which is then secured using
either SSL or TLS.

** Packet switching
Answer: Packet switching is a method for sending data whereby the data is divided in packets.
Each packet is given a header containing information of the destination.

Packet switching is a method for sending data whereby the data is divided in packets. Each
packet is given a header containing information of the destination. Each packet is forwarded
through the network to the destination using this information. At the destination the data has
to be reassembled from the received packages.

There are two common packet switching methods in use:

 Datagram Packet Switching:


Each packet is forwarded independently based on the destination address. Routing
decisions are made dynamically, so each packet may follow a different route and thus
the packages may arrive out of order.
 Virtual Circuit Packet Switching:
A route is set up prior to packets being sent. The packets will all follow this route.
This makes the routing through the network very easy and the packages will be
received in the correct order.

Packet-switched networks were originally designed to overcome the inherent weakness of


sending data over the analogue circuit switched network. Circuit switching is not very
efficiënt for small messages and the analogue circuits make the data subject to noise and
errors.

There are two major modes of packet switching:

1. Connectionless Packet Switching: Each packet contains complete addressing or


routing information and is routed individually. This can result in out-of-order
delivery and different paths of transmission, depending on the variable loads on
different network nodes (adapters, switches and routers) at any given time. Also
known as datagram switching.

In connectionless packet switching, each packet has the following information


written in its header section:
o The destination address
o The source address
o Total number of pieces
o The sequence number (Seq#) needed to enable reassembly

After reaching the destination through different routes, the packets are rearranged to
form the original message.

2. Connection-Oriented Packet Switching: Data packets are sent sequentially over a


predefined route. Packets are assembled, given a sequence number and then
transported over the network to a destination in order. In this mode, address
information is not required. Also known as virtual circuit switching.

What is Circuit Switching?


Circuit switching is a switching method in which a dedicated communication path
in physical form between two stations within a network is established, maintained
and terminated for each communication session. It has basically three phases as
circuit establishment, data transfer and circuit disconnect.

Circuit switching has two types of transmissions.

Datagram transmissions - Datagram transmissions have individually addressed


frames.
Data-stream transmissions - Data-stream transmissions have a stream of data
for which address checking occurs only once. The routing in circuit switching may
have either static routing or dynamic routing. In case of static routing, this
methodology uses the same approach all the time while dynamic routing allows
alternate routing depending on traffic.

Database
1. Key
a) Primary key
b) Foregin key
c) Super key
d) Candidate key
e) Unique key
f) Composite key

2. ACID properties.
3. ERD
4. Normalization
5. Join
6. DDL\DML
7. SQL
8. Aggregate function
9. Cardinality

Q. Write the ACID Properties?

Answer: ACID Property is the most important part of the database. ACID stands for
Atomicity Consistency Isolation Durability.

Atomicity:  This means that “all or nothing”. When an update occurs to a database either all
or none of the update will become available to anyone beyond the user.  This update to the
database is called a transaction and it either commits or aborts.
Consistency:  It ensures that any changes to values in an instance are consistent with changes
to other values in the same instance.

Isolation:  Isolation is is needed when there are concurrent transactions. Concurrent


transactions are transactions that occur at the same time, such as shared multiple users
accessing shared objects.

An important concept to understanding isolation through transactions is serializability.


Transactions are serializable when the effect on the database is the same whether the
transactions are executed in serial order or in an interleaved fashion.

Durability: Maintaining updates of committed transactions is important. These updates must


never be lost. The ACID property of durability addresses this need. Durability refers to the
ability of the system to recover committed transaction updates if either the system or the
storage media fails.

Q. What is Entity Relationship Diagram?


Answer: An Entity Relationship Diagram (ERD) is a snapshot of data structures. An Entity
Relationship Diagram shows entities (tables) in a database and relationships between tables within
that database. For a good database design it is essential to have an Entity Relationship Diagram.

 Normalization:
Normalization is a technique which is used to organize the data in the database. It is a
systematic approach to remove the data redundancy. Normalization is mainly used for two
purpose,

 To remove data redundancy.


 Ensuring data dependencies is proper.

Without normalization 3 anomalies occurred and it becomes difficult to handle and update
data. To understand these anomalies let’s take an Student table

ID Name Address Subject


201 Akshay Jaipur Maths
202 Charu Bombay Bio
203 Disha Banglore Physics
204 Eva Noida Maths

1. Updation Anamoly – To update address of a student who occurs twice or more than
twice in a table, we will have to updateAddress column in all the rows, else data will
become inconsistent.
2. Insertion Anamoly – Suppose for a new admission, we have a Student id, name and
address of a student but if student has not opted for any subject yet then we have to
insertNULL there, leading to Insertion Anamoly.
3. Deletion Anamoly – If id 401 has only one subject and temporarily he drops it, when
we delete that row, entire student record will be deleted along with i

 Normalization Form:

Normalization Rules are divided into 4 normal forms.

1. First Normal Form


2. Second Normal Form
3. Third Normal Form
4. BCNF

First Normal Form:

As per First Normal Form, no two rows of data must contain repeating data i.e., whenever we
search for a particular result the multiple columns cannot be used to fetch the same row.

Each table should be organized into rows, and each row should have a primary key that
distinguishes it as unique.

For example, consider a table not in first normal form

Student Age Subject


Akshay 15 Maths, Physics
Charu 14 Biology
Disha 17 Maths

Free Ebook: Step by Step Guide to Master SQL

GET EBOOK

Student table in 1NF will be:

Student Age Subject


Akshay 15 Maths
Akshay 15 Physics
Charu 14 Biology
Disha 17 Maths

 
Using the First Normal Form, data redundancy increases, as there will be many columns with
same data in multiple rows but each row as a whole will be unique.

Second Normal Form:

As per the Second Normal Form there must not be any partial dependency of any column on
primary key. It means that for a table that has concatenated primary key, each column in the
table that is not part of the primary key must depend upon the entire concatenated key for its
existence.

 Meet all the requirements of the first normal form.


 Remove subsets of data that apply to multiple rows of a table and place them in
separate tables.
 Create relationships between these new tables and their predecessors through the use
of foreign keys.

For example:

New student table following 2NF will be:

Student Age
Akshay 15
Charu 14
Disha 17

In Student Table the candidate key will be Student column, because all other column i.e Age
is dependent on it.

Student Subject
Akshay Maths
Akshay Physics
Charu Biology
Disha Maths

In Subject Table the candidate key will be {Student, Subject} column. Now, both the above
tables qualifies for Second Normal Form and will never suffer from Update Anomalies.
Third Normal Form:

 A relation is in third normal form (3NF) if it is in second normal form and it contains
no transitive dependencies.
 Consider relation R containing attributes A, B and C. R(A, B, C)
 If A → B and B → C then A → C
 Transitive Dependency: Three attributes with the above dependencies.

For example:

Student_details table

ID Name Subject DOB Address Mobile No. City

New Student_detail table:

ID Name Subject

Address Table:

ID Address DOB Mobile No. City

The advantage of removing transtive dependency is,

 Amount of data duplication is reduced.


 Data integrity achieved.

Boyce and Codd Normal Form (BCNF):

This is a higher version of third normal form. This form deals with certain type of anamoly
that is not handled by 3NF. A 3NF table which does not have multiple overlapping candidate
keys is said to be in BCNF. For a table to be in BCNF, following conditions must be
satisfied:

 R must be in 3rd Normal Form


 and, for each functional dependency ( X -> Y ), X should be a super Key.
 What is RDMS?

 RDMS is an information management system which is oriented on a data model. Here


all the information is properly stored as tables. RDMS Example systems are SQL
Server, Oracle, MySQL, MariaDB and SQLite.
 RDBMS full form
RDBMS full form is for Relational Database Management System. It arranges
information into allied rows and columns.
 Basic Features of RDMS:

• Offers information to be saved in the tables


• Numerous users can access it together which is managed by a single user
• Virtual tables are available for storing the insightful data
• In order to exclusively find out the rows, the primary key is used
• The data are always saved in rows and columns
• To retrieve the information the indexes are used
• Columns are being shared between tables using the keys

 RDMS Advantages

1. Data is only stored once so multiple documentation changes are not required
2. Better safety measures
3. The table arrangement is straightforward and simple for database users to
appreciate and use.
4. RDBMSs permit numerous database users to admittance a database concurrently.
5. RDBMS agree to the database manager to limit admission to certified users, and
gift rights to entity users depending on the kinds of database work they do
6. RDBMSs offer admission to the database via a server daemon, a dedicated software
program that responds to requirements on a set of connections, and enables database
users to connect and make use of the database.

SQL Features
 High Performance.
 High Availability.
 Scalability and Flexibility
 Robust Transactional Support.
 High Security.
 Comprehensive Application Development.
 Management Ease.
 Open Source.

SQL Data Types


« Previous
Next »

Each DBMS defines its own SQL types.

Typical SQL
SQL type identifier     Description
datatype
Character string of fixed
SQL_CHAR CHAR(n)
string length n.
Variable-length character
SQL_VARCHAR VARCHAR(n) string with a maximum
string length n.
Variable length character
SQL_LONGVARCHAR LONG VARCHAR data. Maximum length is
data source–dependent.[9]
Unicode character string of
SQL_WCHAR WCHAR(n)
fixed string length n
Unicode variable-length
SQL_WVARCHAR VARWCHAR(n) character string with a
maximum string length n
Unicode variable-length
LONGWVARCHA character data. Maximum
SQL_WLONGVARCHAR
R length is data source–
dependent
Signed, exact, numeric
SQL_DECIMAL DECIMAL(p,s) value with a precision of at
least p and scale s. 
Signed, exact, numeric
SQL_NUMERIC NUMERIC(p,s) value with aprecision p and
scale s
Exact numeric value with
SQL_SMALLINT SMALLINT
precision 5 and scale 0
Exact numeric value with
SQL_INTEGER INTEGER
precision 10 and scale 0
Signed, approximate,
SQL_REAL REAL numeric value with a
binary precision
Signed, approximate,
numeric value with a
SQL_FLOAT FLOAT(p)
binary precision of at
least p.
Signed, approximate,
DOUBLE
SQL_DOUBLE numeric value with a
PRECISION
binary precision 53
SQL_BIT BIT Single bit binary data.
SQL_TINYINT TINYINT Exact numeric value with
precision 3 and scale 0
Exact numeric value with
precision 19 (if signed) or
SQL_BIGINT BIGINT
20 (if unsigned) and scale
0
Binary data of fixed
SQL_BINARY BINARY(n)
length n.
Variable length binary data
of maximum length n. The
SQL_VARBINARY VARBINARY(n)
maximum is set by the
user.
Variable length binary
LONG
SQL_LONGVARBINARY data. Maximum length is
VARBINARY
data source–dependent.
Year, month, and day
fields, conforming to the
SQL_TYPE_DATE DATE
rules of the Gregorian
calendar.
Hour, minute, and second
fields, with valid values for
hours of 00 to 23, valid
values for minutes of 00 to
SQL_TYPE_TIME TIME(p)
59, and valid values for
seconds of 00 to 61.
Precision p indicates the
seconds precision.
Year, month, day, hour,
minute, and second fields,
SQL_TYPE_TIMESTAMP TIMESTAMP(p) with valid values as
defined for the DATE and
TIME data types.
Year, month, day, hour,
minute, second, utchour,
and utcminute fields. The
SQL_TYPE_UTCDATETIME UTCDATETIME
utchour and utcminute
fields have 1/10
microsecond precision.
Hour, minute, second,
utchour, and utcminute
SQL_TYPE_UTCTIME UTCTIME fields. The utchour and
utcminute fields have 1/10
microsecond precision..
Number of months
INTERVAL
SQL_INTERVAL_MONTH between two dates; p is the
MONTH(p)
interval leading precision.
Number of years between
INTERVAL
SQL_INTERVAL_YEAR two dates; p is the interval
YEAR(p)
leading precision.
SQL_INTERVAL_YEAR_TO_MONTH INTERVAL Number of years and
months between two
YEAR(p) TO
dates; p is the interval
MONTH
leading precision.
Number of days between
INTERVAL
SQL_INTERVAL_DAY two dates; p is the interval
DAY(p)
leading precision.
Number of hours between
INTERVAL
SQL_INTERVAL_HOUR two date/times; p is the
HOUR(p)
interval leading precision.
Number of minutes
INTERVAL between two
SQL_INTERVAL_MINUTE
MINUTE(p) date/times; p is the interval
leading precision.
Number of seconds
between two
INTERVAL date/times; p is the interval
SQL_INTERVAL_SECOND
SECOND(p,q) leading precision and q is
the interval seconds
precision.
Number of days/hours
INTERVAL between two
SQL_INTERVAL_DAY_TO_HOUR
DAY(p) TO HOUR date/times; p is the interval
leading precision.
Number of
INTERVAL days/hours/minutes
SQL_INTERVAL_DAY_TO_MINUTE DAY(p) TO between two
MINUTE date/times; p is the interval
leading precision.
Number of
days/hours/minutes/second
INTERVAL s between two
SQL_INTERVAL_DAY_TO_SECOND DAY(p) TO date/times; p is the interval
SECOND(q) leading precision and q is
the interval seconds
precision.
Number of hours/minutes
INTERVAL
between two
SQL_INTERVAL_HOUR_TO_MINUTE HOUR(p) TO
date/times; p is the interval
MINUTE
leading precision.
Number of
hours/minutes/seconds
INTERVAL between two
SQL_INTERVAL_HOUR_TO_SECOND HOUR(p) TO date/times; p is the interval
SECOND(q) leading precision and q is
the interval seconds
precision.
SQL_INTERVAL_MINUTE_TO_SECON INTERVAL Number of
D MINUTE(p) TO minutes/seconds between
SECOND(q) two date/times; p is the
interval leading precision
and q is the interval
seconds precision.
SQL_GUID GUID Fixed length GUID.

JOINS
Join is used to combine rows of two or more tables by using common values.

Example:

Let us consider two tables first is Student details

Name Roll No. Marks


Akshay 1 57
Charu 2 68
Disha 3 52
Eva 4 68
Himanshu 5 75
Jitesh 6 88

Another table is Personal Detail.

Name City Phone No Email Id


Akshay Jaipur 9543846521 Akshay21@gmail.com
Disha Bombay 8532465892 Disha@gmail.com
Jitesh Banglore 9684365125 Jitesh1990@gmail.com

Let us join the two tables.

SELECT Name, City, Marks, Phone_no

FROM Student_detail, Personal_detail

WHERE Student_details.Name=Personal_detail.Name;

Name City Marks Phone No


Akshay Jaipur 57 9543846521
Disha Bombay 52 8532465892
Jitesh Banglore 88 9684365125

There are different types of Joins available in SQL:

1. Inner Join
2. Left Join
3. Right Join
4. Full Join

Inner Join:

It returns a value when there is a match in both the tables.

Left Join:

It returns all the values of the left table and matched the rows from the right table.

Syntax:

SELECT column_name

FROM table1

LEFT JOIN table2

ON table1.column_name=table2.column_name;

Example:

SELECT Student_details.Name, Address, Roll_no, Email_id

FROM Student_details

LEFT JOIN Personal_details

ON Student_details.Name= Personal_details.Name;

Name Roll No. Address Email Id


Akshay 1 Jaipur Akshay21@gmail.com
Charu 2 NULL NULL
Disha 3 Bombay Disha@gmail.com
Eva 4 NULL NULL
Himanshu 5 NULL NULL
Jitesh 6 Banglore Jitesh1990@gmail.com

Right Join:

It returns all the values of the right table and matched the rows from the left table.

Syntax:

SELECT column_name

FROM table1

RIGHT JOIN table2

ON table1.column_name=table2.column_name;

Example:

SELECT Personal_details.Name, Address, Roll_no, Email_id

FROM Student_details

RIGHT JOIN Personal_details

ON Student_details.Name= Personal_details.Name;

Name Address Roll NO. Email Id


Akshay Jaipur 1 Akshay21@gmail.com
Disha Bombay 3 Disha@gmail.com
Jitesh Banglore 6 Jitesh1990@gmail.com

FULL Join:

Full join returns all the rows from the left table and the right table.

Syntax:

SELECT column_name

FROM table1

FULL OUTER JOIN table2

ON table1.column_name=table2.column_name;
Example:

SELECT Student_details.Name, Roll_no, Address

FROM Student_details

FULL OUTER JOIN Personal_details

ON Student_details.Name= Personal_details.Name;

Name Roll No. Address


Akshay 1 Jaipur
Charu 2 NULL
Disha 3 Bombay
Eva 4 NULL
Himanshu 5 NULL
Jitesh 6 Banglore

SQL Functions
SQL(Structured Query Language) has got a huge number of functions. This article will give a
description of them. The SQL functions are as follows:

1. Aggregate Functions (Transact-SQL)


Aggregate functions perform a computation on a group of values and give back a distinct one.
Apart from for COUNT, these functions pay no attention to null values. They are commonly
utilized with the GROUP BY clause of the SELECT statement. They are all predestined.
They give back the equivalent value every time they are called by a precise group of inputs.

Aggregate functions are utilized as expressions as follows:


• The decide on file of a SELECT report
• A HAVING clause.

It Offers  The Subsequent Functions:

• AVG (Transact-SQL)
Returns the average of the inputs. Ignores the Null ones
• CHECKSUM_AGG (Transact-SQL)
Gives back the checksum. Ignores the Null ones. OVER clause may follow.
• COUNT (Transact-SQL)
Returns the quantity of values in a set. Returns int.
• COUNT_BIG (Transact-SQL)
Returns the number of items in a group. Returns bigint.
• GROUPING (Transact-SQL)
Returns 1 if aggregated or 0 if not .
• MAX (Transact-SQL)

Returns the highest term in the statement.


• MIN (Transact-SQL)
Returns the minimum value in the expression.
• STDEV (Transact-SQL)
Returns the statistical standard deviation in the statement
• STDEVP (Transact-SQL)
Returns the statistical standard deviation for the population
• SUM (Transact-SQL)
Returns the sum of all the values
• VAR (Transact-SQL)
Returns the statistical variance
• VARP (Transact-SQL)
Returns The Statistical Variance For The Population

2. Analytic Functions (Transact-SQL)

Analytic functions calculate a collective value depending on a collection of rows. But,


different aggregate functions return manifold rows for every collection.
• CUME_DIST (Transact-SQL)
Analyses the increasing circulation of a term in a group of inputs
• FIRST_VALUE (Transact-SQL)
Returns the first one in an arranged group
• LAG (Transact-SQL)
Allows data from a preceding line in the equivalent output set devoid of the self-join
• LAST_VALUE (Transact-SQL)
Gives back the last value in an arranged collection of inputs
• LEAD (Transact-SQL)

Accesses information from a succeeding row in the identical outcome group devoid of
the self-join .

• PERCENTILE_CONT (Transact-SQL)
Finds out a percentile depending on a nonstop sharing of the column value
• PERCENTILE_DISC (Transact-SQL)
Calculates a certain percentile for sorted values in an entire
• PERCENT_RANK (Transact-SQL)
Computes the relative rank of a row within a group of rows.

3. Collation Functions (Transact-SQL)


It returns the characteristics of a certain collation in the SQL Server.
• COLLATIONPROPERTY (Transact-SQL)
It returns the characteristics of a certain collation in the SQL Server.

• TERTIARY_WEIGHTS (Transact-SQL)
Gives back a binary string for every value in a non-Unicode string statement

4. Configuration Functions (Transact-SQL)


The subsequent scalar functions give back information regarding the present formation
settings:
• DATEFIRST
• LANGUAGE
• OPTIONS
• VERSION
• DBTS
• MAX_PRECISION
• REMSERVER
• TEXTSIZE
• SERVICENAME
• LANGID
• MAX_CONNECTIONS
• SERVERNAME
• SPID
• NESTLEVEL
• LOCK_TIMEOUT
All of these functions are non-predestined. They always don’t give back equivalent outputs
each time they are brought, although with the identical group of inputs.

5. Conversion Functions (Transact-SQL)


The subsequent functions carry on the casting of data type and their converting.
• CAST and CONVERT (Transact-SQL)
• TRY_PARSE (Transact-SQL)
• TRY_CAST (Transact-SQL)
• PARSE (Transact-SQL)
• TRY_CONVERT (Transact-SQL)

6. Cryptographic Functions (Transact-SQL)


These functions carry out the encryption, decryption, signing, and the proofing of digital
signatures.

Symmetric Encryption and Decryption


• SYMKEYPROPERTY
• ENCRYPTBYKEY
• DECRYPTBYKEYAUTOASYMKEY
• ENCRYPTBYPASSPHRASE
• KEY_GUID
• KEY_ID
• DECRYPTBYKEY
• KEY_NAME
• DECRYPTBYPASSPHRASE

Asymmetric
• ASYMKEY_ID
• ENCRYPTBYCert
• DECRYPTBYASYMKEY
• ENCRYPTBYASYMKEY
• ASYMKEYPROPERTY
• DECRYPTBYCERT

Signing and Signature Proof


• SIGNBYCERT
• IS_OBJECTSIGNED
• VERIGYSIGNEDBYCERT
• SIGNBYASYMKEY
• VERIFYSIGNEDBYASMKEY

Symmetric Decryption with Automatic Key Handling


• DecryptByKeyAutoCert
Encryption Hashing
• HASHBYTES
Copying Certificates
• CERTENCODED (Transact-SQL)
• CERTPRIVATEKEY (Transact-SQL)

7. Cursor Functions (Transact-SQL)


The following scalar functions return information about cursors:
• CURSOR_ROWS
• FETCH_STATUS
• CURSOR_STATUS

All these functions are also non-predestined. This means they do not every time give back the
same outputs

8. Data Type Functions (Transact-SQL)


These functions return data about different data types.
• SQL_VARIANT_PROPERTY (Transact-SQL)
• IDENT_CURRENT (Transact-SQL)
• DATALENGTH (Transact-SQL)
• IDENT_INCR (Transact-SQL)
• IDENTITY (Function) (Transact-SQL)
• IDENT_SEED (Transact-SQL)
9. Date and Time Data Types and Functions
These are functions that do the following
• Get System Date and Time
• Get Date and Time Parts
• Get Date and Time Values from Their Parts
• Get Date and Time Difference
• Modify Date and Time Values
• Set or Get Session Format Functions
• Validate Date and Time Values

10. JSON Functions (Transact-SQL)


They are used to confirm or modify JSON text or to take out straightforward or composite
values.
• JSON_MODIFY
It modernizes the value of a character in a JSON string
• JSON_VALUE
From the JSON string, it takes out a scalar value
• ISJSON
Tests if a string has a valid JSON.

• JSON_QUERY
Takes out an object from the JSON string.

11. Logical Functions (Transact-SQL)


These functions process logical operations. The two functions are:
• CHOOSE (Transact-SQL)
• IIF (Transact-SQL)

12. Mathematical Functions (Transact-SQL)


These functions do a computation, generally depending on inputs like arguments and numeric
value. All of them, apart from RAND, are predestined.

13. Metadata Functions (Transact-SQL)


These functions give data about the different data centers and their objects. Some of these
functions are
• FILE_ID
• SCHEMA_ID
• OBJECT_DEFINITION
• APPLOCK_MODE
• COLUMNPROPERTY
• INDEX_COL
• FULLTEXTCATALOGPROPERTY
• SERVERPROPERTY, etc.

14. Replication Functions (Transact-SQL)


These functions output data for administering and maintaining the production of replicas.

15. Rowset Functions (Transact-SQL)


The output of these functions is objects are ones that replace the reference tables. They are
always non-predestined. Some of these functions are:
• OPENXML
• OPENDATASOURCE
• OPENROWSET
• OPENQUERY
• OPENJSON

16. Security Functions (Transact-SQL)


These functions are for giving out values which are utilized in monitoring the security issues.
Some of these functions are:
• CERTPRIVATEKEY (Transact-SQL)
• DATABASE_PRINCIPAL_ID (Transact-SQL)
• HAS_PERMS_BY_NAME (Transact-SQL)
• SYSTEM_USER (Transact-SQL)
• IS_SRVROLEMEMBER (Transact-SQL)
• PERMISSIONS (Transact-SQL)
• SESSION_USER (Transact-SQL)
• PWDCOMPARE (Transact-SQL)

17. String Functions (Transact-SQL)


The string functions operate only on the string inputs and outputs are either string or a
number. They are all predestined. Some of the string functions are:
• ASCII
• CONCAT
• FORMAT
• LOWER
• RTRIM
• UPPER
• SUBSTRING
• STRING_SPLIT
• REPLICATE
• RIGHT
• QUOTENAME
• SPACE
• NCHAR
18. System Functions (Transact-SQL)
They work on and give back data about objects and configurations in the SQL Server. Some
of them are:
• ERROR_SEVERITY
• GET_FILESTREAM_TRANSACTION_CONTEXT
• @@ROWCOUNT
• $PARTITION
• ERROR_PROCEDURE
• FORMATMESSAGE
• @@ERROR
• BINARY_CHECKSUM
• ISNULL
• CONTEXT_INFO
• NEWSEQUENTIALID
• HOST_NAME
• COMPRESS
• CURRENT_TRANSACTION_ID
• MIN_ACTIVE_ROWVERSION
• CONNECTIONPROPERTY
• CURRENT_REQUEST_ID
• GETANSINULL
• NEWID
• @@TRANCOUNT
• ERROR_STATE
• @@PACK_RECEIVED
• @@IDENTITY

19. System Statistical Functions (Transact-SQL)


These functions output the statistical data regarding the system. All these functions are non-
predestined. Some of these functions are:
• CONNECTIONS
• PACK_SENT
• TOTAL_ERRORS
• IO_BUSY
• TOTAL_WRITE
• TIMETICKS
• TOTAL_READ
• fn_virtualfilestats
• PACKET_ERRORS
• IDLE
• CPU_BUSY
• PACK_RECEIVED

20. Text and Image Functions (Transact-SQL)


These functions work on texts and also images and then give outputs on them. They are also
non-predestined. Some of them are:
• PATINDEX
• TEXTPTR
• TEXTVALID

21. Trigger Functions (Transact-SQL)


These functions are used for testing certain alterations in the data values. Some of them are:
• COLUMNS_UPDATED
• EVENTDATA
• TRIGGER_NESTLEVEL
• UPDATE()

22. Collation (Transact-SQL)


They are used for specifying the collation of the server. They are:
• COLLATE
• SQL Server Collation Name
• Windows Collation Name
• Collation Precedence (Transact-SQL)

23. Control-of-Flow Language (Transact-SQL)


The keywords used for this function are:
• BEGIN…END
• TRY…CATCH
• WHILE
• GOTO label
• RETURN
• CONTINUE
• IF…ELSE
• THROW
• WAITFOR
• BREAK

24. Cursors (Transact-SQL)


These processes the output set by processing a single row at a single time.They perform
operations like:
• CREATE PROCEDURE
• FETCH
• SET
• DECLARE CURSOR
• DELETE
• CLOSE
• DECLARE @local_variable
• UPDATE
• DEALLOCATE
• OPEN
They also carry on :
• sp_describe_cursor_tables
• sp_describe_cursor
• @@CURSOR_ROWS
• @@FETCH_STATUS
• sp_describe_cursor_columns
• CURSOR_STATUS
• sp_cursor_list

25. Data Definition Language (DDL) Statements


(Transact-SQL)
They explain the data structures. Some of these functions are:
• ALTER Statements (Transact-SQL)
• UPDATE STATISTICS (Transact-SQL)
• DISABLE TRIGGER (Transact-SQL)
• CREATE Statements (Transact-SQL)
• DROP Statements (Transact-SQL)
• ENABLE TRIGGER (Transact-SQL)
• TRUNCATE TABLE (Transact-SQL)

26. Data Manipulation Language (DML) Statements


(Transact-SQL)
It is used for working and recovering data by using add, query and remove information. Some
of these statements are:
• INSERT (Transact-SQL)
• UPDATE (Transact-SQL)
• READTEXT (Transact-SQL)
• BULK INSERT (Transact-SQL)
• WRITETEXT (Transact-SQL)
• SELECT (Transact-SQL)
• DELETE (Transact-SQL)
• MERGE (Transact-SQL)
• UPDATETEXT (Transact-SQL)

27. Data Types (Transact-SQL)


It tells the kind of information any variable or expression carries. Some of the data type
functions are :
• bigint
• tinyint
• int
• smallint
• money
• numeric
• decimal
• smallmoney
• bit
• real
• float
• smalldatetime
• time
• datetime2
• datetimeoffset
• datetime
• date
• char
• text
• ntext
• nvarchar
• image
• varbinary
• binary
• table
• Spatial Types
• uniqueidentifier
• sql_variant
• timestamp
• xml
• hierarchyid

28. Expressions (Transact-SQL)


A collection of a certain number of operators and symbols form an expression. An expression
can be a variable or a constant or a column too.

29. Language Elements (Transact-SQL)


The language elements include:
• Slash Star Comment (Transact-SQL)
• CREATE DIAGNOSTICS SESSION (Transact-SQL)
• NULL and UNKNOWN (Transact-SQL)
• (Comment) (Transact-SQL)
• Transactions (SQL Data Warehouse)
• USE (Transact-SQL)

30. Management Commands


The commands for managing the SQL servers include the following:
• KILL QUERY NOTIFICATION SUBSCRIPTION
• RECONFIGURE
• CHECKPOINT
• KILL
• KILL STATS JOB
• SHUTDOWN
• DBCC

31. Operators (Transact-SQL)


It tells about the work done on the expressions. The operators of the SQL server are:
• Compound Operators
• Bitwise Operators
• Set Operators
• Logical Operators
• String Concatenation Operator
• Arithmetic Operators
• Comparison Operators
• Unary Operators
• Scope Resolution Operator
• Assignment Operator

32. Predicates (Transact-SQL)


They are used in the search situations where Boolean terms are used mostly in where, from
and having clauses. They are:
• IS [NOT] NULL
• FREETEXT
• CONTAINS

33. Security Statements


The expressions for the security of the SQL server are:
• EXECUTE AS Clause
• OPEN SYMMETRIC KEY
• SETUSER
• REVERT
• REVOKE
• DENY
• GRANT
• CLOSE SYMMETRIC KEY
• EXECUTE AS
• OPEN MASTER KEY
• ADD SIGNATURE
• CLOSE MASTER KEY

34. Service Broker Statements


SQL Server offers the below mentioned Service Broker statements.
• SEND
• BEGIN CONVERSATION TIMER
• END CONVERSATION
• MOVE CONVERSATION
• GET CONVERSATION GROUP
• BEGIN DIALOG CONVERSATION
• GET TRANSMISSION_STATUS

35. SET Statements (Transact-SQL)


These functions alter the existing session for taking care of data and some of them are as
follows:
Date and time statements
• SET DATEFIRST
• SET DATEFORMAT
Locking statements
• SET DEADLOCK_PRIORITY
• SET LOCK_TIMEOUT
Miscellaneous statements
• SET CONCAT_NULL_YIELDS_NULL
• SET CURSOR_CLOSE_ON_COMMIT
• SET FIPS_FLAGGER
• SET IDENTITY_INSERT
• SET LANGUAGE
• SET OFFSETS
• SET QUOTED_IDENTIFIER
Transactions statements
• SET IMPLICIT_TRANSACTIONS
• SET REMOTE_PROC_TRANSACTIONS
• SET TRANSACTION ISOLATION LEVEL
• SET XACT_ABORT
Query Execution Statements
• SET ARITHABORT
• SET ARITHIGNORE
• SET FMTONLY
• SET NOCOUNT
• SET NOEXEC
• SET NUMERIC_ROUNDABORT
• SET PARSEONLY
• SET QUERY_GOVERNOR_COST_LIMIT
• SET ROWCOUNT
• SET TEXTSIZE
Statistics statements
• SET FORCEPLAN
• SET SHOWPLAN_ALL
• SET SHOWPLAN_TEXT
• SET SHOWPLAN_XML
• SET STATISTICS IO
• SET STATISTICS XML
• SET STATISTICS PROFILE
• SET STATISTICS TIME
ISO Settings statements
• SET ANSI_DEFAULTS
• SET ANSI_NULL_DFLT_OFF
• SET ANSI_NULL_DFLT_ON
• SET ANSI_NULLS
• SET ANSI_PADDING
• SET ANSI_WARNINGS

36. SQL Server Utilities Statements


It offers commands acknowledged by sqlcmd,osqland code editor but not Transact-SQL
statements. They improve readability and operation. They include:
• (Backslash) (Transact-SQL)
• GO (Transact-SQL)

37. System Tables (Transact-SQL)


They explain about the system tables. They cannot be modified in a straight line by simple
update and delete terms. The tables may include columns which are documented or which are
not.

38. System Views (Transact-SQL)


These functions showcase the metadata. And some of the functions are :
• Catalog Views
• Information Schema Views
• Compatibility Views
• Replication Views
• Dynamic Management Views and Functions

39. Transaction Statements (Transact-SQL)


A transaction is a solitary piece of job. If it is doing well, all every data alteration are
dedicated and turn out to be an everlasting fraction of the database. If a transaction comes
across failures and should be rejected, then every data alteration gets deleted.

40. Variables (Transact-SQL)


For working on the variables, the functions in SQL are:
• Declare @local_variable
• SET @local_variable
• SELECT @local_variable

41. XML Statements (Transact-SQL)


SQL Server offers the below mentioned XML statements.
• WITH XMLNAMESPACES
• xml_schema_namespace
Cardinality
For arranging and proper organizing of the information stored, we use cardinality. This
arrangement tool is utilized in the entity relationship diagrams representing relationships
between different entities in the table. The cardinality is of different types and they are :

One to one: This cardinality connects one single object with another single object.
One to many: This cardinality connects one single object with many single objects.
Many to many: This cardinality connects many single objects with many other single
objects.
Many to one: This cardinality connects many objects with one single object

Cardinality
The number of times an entity of an entity set participates in a relationship set is known
as cardinality. Cardinality can be of different types:

one to one: When each entity in each entity set can take part only once in the relationship,
the cardinality is one to one. Let us assume that a male can marry to one female and a female
can marry to one male. So the relationship will be one to one.

Using Sets, it can be represented as:

 many to one: When entities in one entity set can take part only once in the relationship
set and entities in other entity set can take part more than once in the relationship set,
cardinality is many to one. Let us assume that a student can take only one course but one
course can be taken by many students. So the cardinality will be n to 1. It means that for one
course there can be n students but for one student, there will be only one course.

Using
Sets, it can be represented as:

In this case, each student is taking only 1 course but 1 course has been taken by many
students.

many to many: When entities in all entity sets can take part more than once in the
relationship cardinality is many to many. Let us assume that a student can take more than
one course and one course can be taken by many students. So the relationship will be many to
many.

Using sets, it can be represented as:


In this example, student S1 is enrolled in C1 and C3 and Course C3 is enrolled by S1, S3 and
S4. So it is many to many relationships.

Data structure
1. Data structure & classification
2. Linked list & classification
3. Array & classification
4. Prefix\Infix\Postfix
5. Preorder\Inorder\Postorder
6. BFS\DFS\Stack\Quee
7. Complexity analysis
8. Asymptotic Notation
9. Tree\Binary Tree\Complete Tree\Extended Tree\Full Tree
10. Expression Convertion

What is data structure?

A data structure is a specialized format for organizing and storing data. General data structure types
include the array, the file, the record, the table, the tree, and so on. Any data structure is designed
to organize data to suit a specific purpose so that it can be accessed and worked with in appropriate
ways.

Based on the organizing method of a data structure, data structures are divided into two types.

1. Linear Data Structures


2. Non - Linear Data Structures
Linear Data Structures

If a data structure is organizing the data in sequential order, then that data structure is called
as Linear Data Structure.

Example

1. Arrays
2. List (Linked List)
3. Stack
4. Queue

Non - Linear Data Structures

If a data structure is organizing the data in random order, then that data structure is called as
Non-Linear Data Structure.

Example

1. Tree
2. Graph
3. Dictionaries
4. Heaps
5. Tries, Etc.,

What's a Linked List?

A linked list is a linear data structure where each element is a separate object.

Each element (we will call it a node) of a list is comprising of two items - the data and a
reference to the next node. The last node has a reference to null. The entry point into a linked
list is called the head of the list. It should be noted that head is not a separate node, but the
reference to the first node. If the list is empty then the head is a null reference.

Single Linked List

The formal definition of a single linked list is as follows...

Single linked list is a sequence of elements in which every element has link to its next
element in the sequenc

In a single linked list we perform the following operations...


1. Insertion
2. Deletion
3. Display

Circular Linked List


Circular linked list is a sequence of elements in which every element has link to its next element in
the sequence and the last element has a link to the first element in the sequence. That means
circular linked list is similar to the single linked list except that the last node points to the first
node in the list.

Operations: In a circular linked list, we perform the following operations...

1. Insertion
2. Deletion
3. Display

Double Linked List


Double linked list is a sequence of elements in which every element has links to its previous element
and next element in the sequence.

In a double linked list, we perform the following operations...

1. Insertion
2. Deletion
3. Display

What is stack?

Answer: See Power of IT.

What is queue?

Answer: See Power of IT.

What is Breadth-first search?

Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It
starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a 'search key')
and explores the neighbor nodes first, before moving to the next level neighbors.

What is Depth-first search?

Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures.
One starts at the root (selecting some arbitrary node as the root in the case of a graph) and explores
as far as possible along each branch before backtracking.
What is binary tree?

A binary tree is a tree data structure in which each node has at most two children, which are
referred to as the left child and the right child

What is full binary tree?

A full binary tree (sometimes proper binary tree or 2-tree) is a tree in which every node other than
the leaves has two children.

What is extended binary tree?

A binary tree can be converted into Full Binary tree by adding dummy nodes to existing
nodes wherever required.

The full binary tree obtained by adding dummy nodes to a binary tree is called as Extended
Binary Tree.

In above figure, a normal binary tree is converted into full binary tree by adding dummy
nodes (In pink colour

What is Complete binary tree?

A complete binary tree is a binary tree in which every level, except possibly the last, is completely
filled, and all nodes are as far left as possible.

What is Array?
An array is a variable which can store multiple values of same data type at a time.

What is Linear Array?

Linear data structures are in which all the data are arranged in sequence manner.for example:linked
list,stack queue.

What is Non-linear Array?

Non linear data structure are in which all the data are arranged in random manner.for example
:trees,graphs.

What is complete binary tree?

A complete binary tree is a binary tree in which every level, except possibly the last, is completely
filled, and all nodes are as far left as possible.

What is complexity of the algorithm?

Complexity of an algorithm is a measure of the amount of time and/or space required by an


algorithm for an input of a given size (n).

What is space complexity?

Space complexity is a measure of the amount of working storage an algorithm needs. That means
how much memory, in the worst case, is needed at any point in the algorithm.

What is time complexity? The time complexity of an algorithm quantifies the amount of time
taken by an algorithm to run as a function of the length of the string representing the input. The
time complexity of an algorithm is commonly expressed using big O notation, which excludes
coefficients and lower order terms.

What is the Asymptotic Notations?

Asymptotic Notations are languages that allow us to analyze an algorithm's running time by
identifying its behavior as the input size for the algorithm increases. This is also known as an
algorithm's growth rate.

What is Postfix Notation? Postfix notation is a notation for writing arithmetic expressions in
which the operands appear before their operators. Using Stacks. Homework #5. Postfix notation is a
notation for writing arithmetic expressions in which the operands appear before their operators.

What is Infix Notation?

Infix notation is the notation commonly used in arithmetical and logical formulae and statements. It
is characterized by the placement of operators between operands – "infixed operators" – such as the
plus sign in "2 + 2".

What is Prefix Notation?


Polish notation (PN), also known as normal Polish notation (NPN), Łukasiewicz notation, Warsaw
notation, Polish prefix notation or simply prefix notation, is a form of notation for logic, arithmetic,
and algebra. Its distinguishing feature is that it places operators to the left of their operands.

What is Reverse Polish Notation?

Reverse Polish notation (RPN) is a mathematical notation in which every operator follows all of its
operands, in contrast to Polish notation (PN), which puts the operator before its operands. It is also
known as postfix notation. It does not need any parentheses as long as each operator has a fixed
number of operands.

Postfix Expression Evaluation:


A postfix expression is a collection of operators and operands in which the operator is placed
after the operands. That means, in a postfix expression the operator follows the operands.

Postfix Expression has following general structure...

Operand1 Operand2 Operator

Example

Postfix Expression Evaluation using Stack Data Structure


A postfix expression can be evaluated using the Stack data structure. To evaluate a postfix
expression using Stack data structure we can use the following steps...

1. Read all the symbols one by one from left to right in the given Postfix Expression
2. If the reading symbol is operand, then push it on to the Stack.
3. If the reading symbol is operator (+ , - , * , / etc.,), then perform TWO pop
operations and store the two popped oparands in two different variables
(operand1 and operand2). Then perform reading symbol operation using
operand1 and operand2 and push result back on to the Stack.
4. Finally! perform a pop operation and display the popped value as final result.

Example
Consider the following Expression...
Expression Conversion:
Any expression can be represented using three types of expressions (Infix, Postfix and
Prefix). We can also convert one type of expression to another type of expression like Infix to
Postfix, Infix to Prefix, Postfix to Prefix and vice versa.

To convert any Infix expression into Postfix or Prefix expression we can use the following
procedure...

1. Find all the operators in the given Infix Expression.


2. Find the order of operators evaluated according to their Operator precedence.
3. Convert each operator into required type of expression (Postfix or Prefix) in the same
order.

Example
Consider the following Infix Expression to be converted into Postfix Expression...

D=A+B*C

 Step 1: The Operators in the given Infix Expression : = , + , *


 Step 2: The Order of Operators according to their preference : * , + , =
 Step 3: Now, convert the first operator * ----- D = A + B C *
 Step 4: Convert the next operator + ----- D = A BC* +
 Step 5: Convert the next operator = ----- D ABC*+ =

Finally, given Infix Expression is converted into Postfix Expression as follows...

DABC*+=

Infix to Postfix Conversion using Stack Data


Structure
To convert Infix Expression into Postfix Expression using a stack data structure, We can use
the following steps...

1. Read all the symbols one by one from left to right in the given Infix Expression.
2. If the reading symbol is operand, then directly print it to the result (Output).
3. If the reading symbol is left parenthesis '(', then Push it on to the Stack.
4. If the reading symbol is right parenthesis ')', then Pop all the contents of stack
until respective left parenthesis is poped and print each poped symbol to the
result.
5. If the reading symbol is operator (+ , - , * , / etc.,), then Push it on to the Stack.
However, first pop the operators which are already on the stack that have higher
or equal precedence than current operator and print them to the result.
Example
Consider the following Infix Expression...

(A+B)*(C-D)

The given infix expression can be converted into postfix expression using Stack data
Structure as follows...

Infix, Postfix and Prefix


Infix, Postfix and Prefix notations are three different but equivalent ways of writing
expressions. It is easiest to demonstrate the differences by looking at examples of operators
that take two operands.
Infix notation: X + Y
Operators are written in-between their operands. This is the usual way we write
expressions. An expression such as A * ( B + C ) / D is usually taken to mean
something like: "First add B and C together, then multiply the result by A, then divide
by D to give the final answer."

Infix notation needs extra information to make the order of evaluation of the operators
clear: rules built into the language about operator precedence and associativity, and
brackets ( ) to allow users to override these rules. For example, the usual rules for
associativity say that we perform operations from left to right, so the multiplication by
A is assumed to come before the division by D. Similarly, the usual rules for
precedence say that we perform multiplication and division before we perform
addition and subtraction. (see CS2121 lecture).

Postfix notation (also known as "Reverse Polish notation"): X Y +


Operators are written after their operands. The infix expression given above is
equivalent to A B C + * D /
The order of evaluation of operators is always left-to-right, and brackets cannot be
used to change this order. Because the "+" is to the left of the "*" in the example
above, the addition must be performed before the multiplication.
Operators act on values immediately to the left of them. For example, the "+" above
uses the "B" and "C". We can add (totally unnecessary) brackets to make this explicit:

( (A (B C +) *) D /)
Thus, the "*" uses the two values immediately preceding: "A", and the result of the
addition. Similarly, the "/" uses the result of the multiplication and the "D".
Prefix notation (also known as "Polish notation"): + X Y
Operators are written before their operands. The expressions given above are
equivalent to / * A + B C D
As for Postfix, operators are evaluated left-to-right and brackets are superfluous.
Operators act on the two nearest values on the right. I have again added (totally
unnecessary) brackets to make this clear:
(/ (* A (+ B C) ) D)
Although Prefix "operators are evaluated left-to-right", they use values to their right,
and if these values themselves involve computations then this changes the order that
the operators have to be evaluated in. In the example above, although the division is
the first operator on the left, it acts on the result of the multiplication, and so the
multiplication has to happen before the division (and similarly the addition has to
happen before the multiplication).
Because Postfix operators use values to their left, any values involving computations
will already have been calculated as we go left-to-right, and so the order of evaluation
of the operators is not disrupted in the same way as in Prefix expressions.

In all three versions, the operands occur in the same order, and just the operators have to be
moved to keep the meaning correct. (This is particularly important for asymmetric operators
like subtraction and division: A - B does not mean the same as B - A; the former is
equivalent to A B - or - A B, the latter to B A - or - B A).

Examples:

Infix Postfix Prefix


Notes
multiply A and B,
A * B + C / D A B * C D / + + * A B / C D divide C by D,
add the results
add B and C,
A * (B + C) / D A B C + * D / / * A + B C D multiply by A,
divide by D
divide C by D,
A * (B + C / D) A B C D / + * * A + B / C D add B,
multiply by A

Converting between these notations


The most straightforward method is to start by inserting all the implicit brackets that show the
order of evaluation e.g.:
Infix Postfix Prefix
( (A * B) + (C / D) ) ( (A B *) (C D /) +) (+ (* A B) (/ C D) )
((A * (B + C) ) / D) ( (A (B C +) *) D /) (/ (* A (+ B C) ) D)
(A * (B + (C / D) ) ) (A (B (C D /) +) *) (* A (+ B (/ C D) ) )
You can convert directly between these bracketed forms simply by moving the operator
within the brackets e.g. (X + Y) or (X Y +) or (+ X Y). Repeat this for all the operators in
an expression, and finally remove any superfluous brackets.

You can use a similar trick to convert to and from parse trees - each bracketed triplet of an
operator and its two operands (or sub-expressions) corresponds to a node of the tree. The
corresponding parse trees are:

/ *
+ / \ / \
/ \ * D A +
/ \ / \ / \
* / A + B /
/ \ / \ / \ / \
A B C D B C C D

((A*B)+(C/D)) ((A*(B+C))/D) (A*(B+(C/D)))

Expression Conversion:
Any expression can be represented using three types of expressions (Infix, Postfix and
Prefix).We can also convert one type of expression to another type of expression like Infix to
Postfix, Infix to Prefix, Postfix to Prefix and vice versa.

To convert any Infix expression into Postfix or Prefix expression we can use the following
procedure...

1. Find all the operators in the given Infix Expression.


2. Find the order of operators evaluated according to their Operator precedence.
3. Convert each operator into required type of expression (Postfix or Prefix) in the same
order.

Example
Consider the following Infix Expression to be converted into Postfix Expression...

D=A+B*C

 Step 1: The Operators in the given Infix Expression : = , + , *


 Step 2: The Order of Operators according to their preference : * , + , =
 Step 3: Now, convert the first operator * ----- D = A + B C *
 Step 4: Convert the next operator + ----- D = A BC* +
 Step 5: Convert the next operator = ----- D ABC*+ =

Finally, given Infix Expression is converted into Postfix Expression as follows...

DABC*+=

Infix to Postfix Conversion using Stack


Data Structure
To convert Infix Expression into Postfix Expression using a stack data structure, We can use
the following steps...

1. Read all the symbols one by one from left to right in the given Infix Expression.
2. If the reading symbol is operand, then directly print it to the result (Output).
3. If the reading symbol is left parenthesis '(', then Push it on to the Stack.
4. If the reading symbol is right parenthesis ')', then Pop all the contents of stack
until respective left parenthesis is poped and print each poped symbol to the
result.
5. If the reading symbol is operator (+ , - , * , / etc.,), then Push it on to the Stack.
However, first pop the operators which are already on the stack that have higher
or equal precedence than current operator and print them to the result.

Example
Consider the following Infix Expression...

(A+B)*(C-D)

The given infix expression can be converted into postfix expression using Stack data
Structure as follows...
The final Postfix Expression is as follows...

AB+CD-*

The final Postfix Expression is as follows...

AB+CD-*
Security
1. Antivirus
2. Firewall & Types of firewall
3. DOS\DDOS
4. DOS Attack
5. Phishing
6. Pharming
7. Session hijacking
8. Password Policy

What Is Anti-Virus?

Anti-virus is a security program you install on your computer or mobile device to protect it from
getting infected by malware.

Or, Antivirus software often referred to as antivirus or AV is a software program (or a set of
programs) designed to search for, detect, block and remove malicious software- viruses, trojans,
worms, adware etc.

1. Avast! Free Antivirus

2. Panda Cloud Antivirus

3. Microsoft Security Essentials

4. Avira AntiVir Personal Edition

5. AVG Anti-Virus Free Edition

6. Comodo Antivirus

7. Immunet Protect FREE

8. PC Tools AntiVirus Free

9. Malwarebytes

10. ClamWin Free Antivirus

What is DOS (Disk Operating System)?


DOS (Disk Operating System) is an operating system that runs from a hard disk drive. The term can
also refer to a particular family of disk operating systems, most commonly MS-DOS (Microsoft Disk
Operating System)

MS-DOS (Microsoft Disk Operating System) is a single-user, single-tasking computer operating


system that uses a command line interface. In spite of its very small size and relative simplicity, it is
one of the most successful operating systems that has been developed to date.

What is DDoS - Distributed Denial of Service?

DDoS is a type of DOS attack where multiple compromised systems, which are often infected with a
Trojan, are used to target a single system causing a Denial of Service (DoS) attack.

What is a DDoS Attack?

A Distributed Denial of Service (DDoS) attack is an attempt to make an online service unavailable by
overwhelming it with traffic from multiple sources

What is Phishing?

Phishing is a cybercrime in which a target or targets are contacted by email, telephone or text
message by someone posing as a legitimate institution to lure individuals into providing
sensitive data such as personally identifiable information, banking and credit card details, and
passwords.

What is session hijacking

In computer science, session hijacking, sometimes also known as cookie hijacking is the exploitation
of a valid computer session—sometimes also called a session key—to gain unauthorized access to
information or services in a computer system.

The session hijacking is a type of web attack.

What is Pharming?
Pharming is a scamming practice in which malicious code is installed on a personal
computer or server, misdirecting users to fraudulent Web sites without their knowledge or
consent. Pharming has been called "phishing without a lure

How to prevent Session Hijacking?

As we’ve seen earlier, the method often used to steal session id is by installing a malicious
code on the client website and then the cookie is stealing. The best way to prevent session
hijacking is enabling the protection from the client side. It is recommended that taking
preventive measures for the session hijacking on the client side. The users should have
efficient antivirus, anti-malware software, and should keep the software up to date.

There is a technique that uses engines which fingerprints all requests of a session. In addition
to tracking the IP address and SSL session id, the engines also track the http headers. Each
change in the header adds penalty points to the session and the session gets terminated as
soon as the points exceeds a certain limit. This limit can be configured. This is effective
because when intrusion occurs, it will have a different http header order.

These are the recommended preventive measures to be taken from both the client and server
sides in order to prevent the session hijacking attack.

 To use SSL/HTTPS encryption for the entire web site, and you have the best guarantee that
no man in the middle attacks will be able to sniff an existing client session cookie?
 To use some sort of encryption on the session value itself that is stored in your session
cookie?
 Encrypting the session value will have zero effect. The session cookie is already an arbitrary
value, encrypting it will just generate another arbitrary value that can be sniffed.
 The only real solution is HTTPS. first make sure your login page is HTTPS. When a user logs in,
set a secure cookie (meaning the browser will only transmit it over an SSL link) in addition to
the regular session cookie. Then, when a user visits one of your "sensitive" areas, redirect
them to HTTPS, and check for the presence of that secure cookie. A real user will have it, a
session hijacker will not.
 HTTPS will prevent the sniffing only. But if you have a XSS, or the session IDs can be guessed
easily, or you are vulnerable to session fixation, or your session ID storage is weak (SQL
injection?),
 The SSL only helps with sniffing attacks. If an attacker has access to your machine I will
assume they can copy your secure cookie too.

What is Password Policy

A password policy is a set of rules designed to enhance computer security by encouraging users
to employ strong passwords and use them properly. A password policy is often part of an
organization's official regulations and may be taught as part of security awareness training.

Password Policy Enforcement

Password enforcement options include:

1. A configurable limit on failed authentication attempts.


2. A counter to track the number of failed authentication attempts.
3. A time frame in which the limit of consecutive failed authentication attempts must
happen before action is taken.
4. The action to be taken when the limit is reached. The action will either be nothing, or
the account will be locked.
5. An amount of time the account is locked (if it is to be locked) This can be indefinite.
6. Password expiration.
7. Expiration warning
8. Grace authentications
9. Password history
10. Password minimum age
11. Password minimum length
12. Password Change after Reset
13. Safe Modification of Password
14. Password Policy for LDAP Directories

Bank Related IT
MICR is an acronym for Magnetic Ink Character Recognition; it refers to the formulation of
toner used to print the specialized font at the bottom of checks and other negotiable
documents.

RTGS (real time gross settlement) and NEFT (national electronic funds transfer) are
electronic payment systems that allow individuals to transfer funds between banks. Both
these systems are maintained by the Reserve Bank of India. It is applicable only for money
transfer within the country.

Agent Banking means providing limited scale banking and financial services to the
underserved population through engaged agents under a valid agency agreement, rather
than a teller/ cashier. It is the owner of an outlet who conducts banking transactions on
behalf of a bank.

Online banking, also known as internet banking, e-banking or virtual banking, is an


electronic payment system that enables customers of a bank or other financial institution to
conduct a range of financial transactions through the financial institution's website.

What is the definition of electronic banking?

Electronic banking, also known as electronic funds transfer (EFT), is simply the use of
electronic means to transfer funds directly from one account to another, rather than by check
or cash. You can use electronic funds transfer to: have your paycheck deposited directly into
your bank or credit union checking account.

What is an example of an electronic funds transfer?

An electronic funds transfer (EFT) is a transaction that takes place over a computerized
network, either among accounts at the same bank or to different accounts at separate financial
institutions.

What is a POS?

A retail point of sale system typically includes a cash register (which in recent times
comprises a computer, monitor, cash drawer, receipt printer, customer display and a barcode
scanner) and the majority of retail POS systems also include a debit/credit card reader.

What does a PoS system stand for?

POS stands for Point Of Sale. This is a rather broad definition that can include
merchandising aids, displays and the methods used to enable transactions. ... The heart of any
POS system is the computer (or computers) that runs the POS software.

A payment gateway is a merchant service provided by an e-commerce application service


provider that authorizes credit card or direct payments processing for e-businesses, online retailers,
bricks and clicks, or traditional brick and mortar.

What is an ATM machine?


An automated teller machine (ATM) is an electronic banking outlet, which allows
customers to complete basic transactions without the aid of a branch representative or teller.
Anyone with a credit card or debit card can access most ATMs.

What is the ATM stand for?

ATM stands for Automated Teller Machine. It's a specialized computer that makes it
convenient to manage your money. For example, almost all ATMs allow you to withdraw
money, and many allow you to make deposits.

What do you mean by mobile banking?

Mobile banking refers to the use of a smartphone or other cellular device to perform online
banking tasks while away from your home computer, such as monitoring account balances,
transferring funds between accounts, bill payment and locating an ATM.

Bangladesh Electronic Funds Transfer Network (BEFTN) Bangladesh Electronic Funds


Transfer Network(BEFTN) is a system of transferring money from one bank account directly to
another bank without money changing hands.

What do you mean by plastic money?

Plastic money is a term that is used predominantly in reference to the hard plastic cards we
use everyday in place of actual bank notes. They can come in many different forms such as
cash cards, credit cards, debit cards, pre-paid cash cards and store cards.

Credit Card is a small plastic card issued by a bank, business, etc., allowing the holder to
purchase goods or services on credit.

A debit card (also known as a bank card or check card) is a plastic payment card that can be
used instead of cash when making purchases. It is similar to a credit card, but unlike a credit card,
the money comes directly from the user's bank account when performing a transaction.

Paypal is an electronic commerce (e-commerce) company that facilitates payments between


parties through online funds transfers. PayPal allows customers to establish an account on its
website, which is connected to a user's credit card or checking account.

You might also like