Vedanta Let’s Log in Computer Science | Book 10
Artificial Intelligence (AI)
Artificial Intelligence is a way of making a
computer, a computer-controlled robot, or a
software think intelligently, in a similar manner
the intelligent humans think.
This means, now the computer can work like
humans to identify objects, animals, places, detect
a face, and talk to us. They can also suggest and
recommend like human experts in their respective Artificial Intelligence
field. Artificial Intelligence is the study and research of developing such software
that can learn, and work like the human brain.
AI technology is improving performance and productivity by automating processes
or tasks that once required human intelligence. Some of the widely used examples
of AI are speech recognition (like Siri, Microsoft Cortana, Amazon echo, Google
Home), spam email filter, self-driving cars, face recognition, etc.
Virtual Reality (VR)
In virtual reality, you experience a simulated environment that does not actually
exist, created through computer-based technologies that can give you a feel of
the near-real world with all or some of your senses experiencing the virtually
simulated environment. You can also interact with virtual objects within the
virtual environment. You can swim with whales in oceans, fight with aliens, fly
aeroplanes, visit distance places without being there, and much more within
the VR.
Virtual Reality Enjoying with Virtual Reality
These days, you can find various types of the head-mounted display to experience
virtual reality. You can also experience virtual reality in specialized cinema halls
as well.
101 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Big Data
Big data is a term that describes the large volume of data – both structured and
unstructured – that inundates a business on a day-to-day basis. But it’s not the
amount of data that is important. It is what organizations do with the data that
matters. Big data can be analyzed for insights that lead to better decisions and
strategic business moves.
The importance of big data does not revolve around how much data you have,
but what you do with it. You can take data from any source and analyze it to find
answers that enable cost reductions, time reductions, new product development
and optimized offerings, and smart decision making. Apache Hadoop is one of the
most popular software frameworks for Big data analytics.
Benefits of Big Data and Data Analytics
Big data makes it possible for you to gain more complete answers because you
have more information.
More complete answers mean more confidence in the data—which means a
completely different approach to tackling problems.
E-Governance
E-Governance is a set of services provided by the government to the public
via electronic media especially using internet. Examples of such services
include paying their taxes online, requesting various services providing
information to the public via government through government’s websites.
The basic purpose of e-governance is to simplify processes for all, i.e.
government, citizens, businesses, etc. at National, Province and Local
levels. E-governance expands to electronic governance, is the integration of
Information and Communication Technology (ICT) in all the processes, to
enhance government ability to address the needs of the general public.
Benefits of E-governance
Increased convenience for public and businesses to services of government
Reduction in the overall cost of transaction as services can be rendered
anywhere
Corruption will be reduced as there will be direct interaction with the system
and public without any intermediaries
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 102
Vedanta Let’s Log in Computer Science | Book 10
High transparency
Direct participation of constituents
Expanded reach of government to all public irrespective of remoteness
Through e-governance, the government plans to raise the coverage and quality of
information and services provided to the general public, by the use of ICT in an
easy, economical and effective manner.
Mobile Computing
Mobile devices like smartphones, tablets, e-readers, wearable devices that have
computing power, battery-powered, portable, and wirelessly connected to network
have changed the way, we used to access the computing resources in the past.
Due to advancement in technologies, such mobile devices have integrated various
features like cameras, biometrics, sensors, etc. Mobile computing is a generic term
that refers to a variety of devices that allow people to access data and information
from wherever they are. Sometimes referred to as "human-computer interaction,"
mobile computing transports data, voice, and video over a network via a mobile
device.
Components of Mobile Computing
i) Mobile Hardware
Mobile hardwares are generally small
in size and highly portable with the ability to
process data and give output based on inputs
given from keypad, touch, voices or sensors.
These devices are equipped with sensors, full-
duplex data transmission and have the ability Mobile Computing
to operate on wireless networks such as IR, WiFi, Cellular and Bluetooth.
ii) Mobile Software
Mobile Software is the software program which is developed specifically
to be run on mobile hardware. This is usually the operating system in mobile
devices. These operating systems provide features such as touchscreen, cellular
connectivity, Bluetooth, Wi-Fi, GPS mobile navigation, camera, video camera,
speech recognition, voice recorder, music player, near field communication and
sensors. The device sensors and other hardware components can be accessed via
the OS.
103 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
iii) Mobile Communication
Mobile Communication refers to the exchange of data and voice using existing
wireless networks. The data being transferred are the applications including File
Transfer (FT), the interconnection between Wide-Area-Networks (WAN), facsimile
(fax), electronic mail, access to the internet and the World Wide Web. The wireless
networks utilized in communication are IR, Bluetooth, W-LANs, Cellular, W-Packet
Data networks and satellite communication system. It is the mobile communication
infrastructure which takes care of seamless and reliable communication between
mobile devices.
Principles of Mobile Computing
The following factors have been identified as the Principles of Mobile Computing.
i) Portability
Devices/nodes connected within the mobile computing system should facilitate
mobility. These devices may have limited device
capabilities and limited power supply but should
have a sufficient processing capability and physical
portability to operate in a movable environment.
ii) Connectivity Mobile Communication
This defines the quality of service (QoS) of
the network connectivity. In a mobile computing
system, the network availability is expected to be
maintained at a high level with a minimal amount of
lag/downtime without being affected by the mobility
of the connected nodes.
iii) Interactivity
The nodes belonging to a mobile computing system are connected with one
another to communicate and collaborate through active transactions of data.
iv) Individuality
A portable device or a mobile node connected to a mobile network often denote
an individual; a mobile computing system should be able to adopt the technology to
cater the individual needs and also to obtain contextual information of each node.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 104
Vedanta Let’s Log in Computer Science | Book 10
Internet of Things (IoT)
With the advancement in technology, computer-like device can be integrated
with any electronic devices enabling these devices to share and communicate
data to intended users and systems. Devices that can sense or read the values
of their surrounding
environment are more
likely to have application
for sharing/communicating
information. Such devices
when connected with
server to communicate data
from their surrounding
are called Internet of
Things (IoT). Simply, you
have things (devices) that
can collect data and are
capable to send these data
via Internet to Server or
any intended users. For
example, a car with a GPS
sensor (thing) continuously Internet of Things (Smart Home)
transmitting its location information to any user via Internet. A temperature sensor
(thing) that is reading the temperature of a particular location and transmitting
that data via Internet to a Web Server so that anyone from the world can know the
temperature of that location/place.
Over the past few years, IoT has become one of the most important technologies
of the twenty-first century. Now that we can connect everyday objects—kitchen
appliances, cars, thermostats, baby monitors—to the internet via embedded
devices, seamless communication is possible between people, processes, and things.
Using low-cost computing, the cloud, big data, analytics, and mobile
technologies, physical things can share and collect data with minimal human
intervention. In this hyper-connected world, digital systems can record, monitor,
and adjust each interaction between connected things. The physical world meets
the digital world—and they cooperate.
105 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
POINTS TO REMEMBER
Cloud Computing is a type of Internet-based computing.
Cloud Computing provides online resources (software, platform, infrastructure) on-
demand basis.
Google Drive is an example of cloud storage.
Public clouds are owned and operated by a third-party cloud service providers.
Hybrid clouds combine public and private clouds
AI is an emerging branch in computer science, which interprets the means and
method of making computers think like human beings.
Siri on the iPhone and Microsoft's Cortana on Windows 8 and Windows 10 are the
examples of AI.
Amazon, Microsoft, Google, etc. are providing very large server farms and data
centres over the Internet to multiple customers.
Public clouds are ideal for small and medium-sized businesses who can’t afford to
fully develop their own infrastructure.
Some of the cloud providers are Amazon AWS, Microsoft Azure, iCloud, Google Cloud,
IBM Cloud, VMware Cloud, Oracle Cloud and Alibaba Cloud.
There are three basic types of cloud computing services.
Virtual Reality (VR) is the use of computer technology to create a simulated
environment.
Big data is a term that describes the large volume of data.
E-Governance is a set of services provided by the government to the public via
electronic media especially using Internet.
Mobile computing is a generic term that refers to a variety of devices that allow
people to access data and information from wherever they are.
Office Online is a completely free, web-based version of Microsoft Office.
Google Drive is a file storage and synchronization service developed by Google.
Apple iCloud is a cloud computing solution by Apple Computer Inc. that provides
cloud storage and apps for desktop and mobile devices.
IoT has become one of the most important technologies of the 21st century.
IoT is a system of the interrelated computing device to exchange information over a
network without human-to-human or human to computer interaction.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 106
Vedanta Let’s Log in Computer Science | Book 10
xercise
1. Answer the following questions:
a) Define cloud computing with examples and write any two services of it.
b) Define Artificial Intelligence with examples.
c) What is Virtual Reality?
d) What is Big data?
e) Define E-governance.
f) What is G2G?
g) What is mobile computing?
h) What is IoT and how does it work?
i) What is cloud computing?
j) What are the three types of cloud computing?
k) What is a cloud service? Give any two examples.
2. Fill in the blanks.
a) .................is a type of Internet-based computing.
b) Companies offering cloud computing services are called ...........
c) ...........is the examples of Services over Cloud.
d) ..........provides Bluemix for software development and testing on its cloud.
e) Some of the examples of AI are .................
f) ..............is a completely free, web-based version of Microsoft Office.
g) ................has become one of the most important technologies of the 21st century.
3. Write the full form of the following:
i) AI ii) VR iii) E-Governance iv) G2C v) G2B
x) IaaS
vi) G2G vii) PDA viii) IoT ix) ATM
xi) PaaS xii) SaaS xiii) GCE
107 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Project Work
1) Prepare a presentation file on the topic “Examples of Services over Cloud" and present
in your class.
2) Identify some of the examples of AI application that you have seen or heard about and
prepare a presentation to showcase these examples.
3) Explain three “Basic types of cloud computing services " in a sheet of chart paper
with figures.
4) Prepare a presentation file on the topic “Sophia Robot in Nepal” and present in your
class.
5) Prepare a presentation file on the topic “Internet of Things (IoT) with example” and
demonstrate in your class.
6) Prepare a presentation file on the topic “E-Governance” and present in your class.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 108
Vedanta Let’s Log in Computer Science | Book 10
Unit Number System
1.6
Introduction
Number system plays a great role in computing and electronics. History of number
starts from the ancient time when there were no devices of counting and calculating
numbers. Decimal system was discovered by great Hindu philosophers: since then,
we are using it as our daily need. Binary number system, developed by Francis
Bacon in 1623 AD, which is one of the many number systems, is the mother tongue
of computing.
Bit
Contraction BInary digiT. A bit is the basic unit of information in the binary
numbering system, representing either 0 (for OFF, 0v) or 1 (for ON, 5v). Bits
can be grouped together to make up larger storage units, the most common
being the 8-bit equal to byte.
Nibbles
Combination of 4 bits is known as one Nibble. (1010 or 1110)
Bytes
Two nibbles or 8 bits make a byte. A group of 8 bits that in computer storage
terms usually holds a single character, such as a number, letter, or other
symbol.
Example:
8 bits = 1 byte
1024 bytes = 1 KB (Kilobyte)
1024 KB = 1 MB (Megabyte)
1024 MB = 1 GB (Gigabyte)
1024 GB = 1 TB (Terabyte)
1024 TB = 1 PB (Petabyte)
1024 PB = 1 EB (Exabyte)
109 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
1024 EB = 1 ZB (Zettabyte) Decimal BCD
1024 ZB = 1 YB (Yottabyte) Digits Equivalent
Although many coding schemes have been developed 0 0000
over the years, the most popular of these use a Binary 1 0001
Coded Decimal (BCD) approach. With BCD, it is 2 0010
possible to convert each decimal number into its binary 3 0011
equivalent rather than convert the entire decimal value 4 0100
into a pure binary form. Eg. 202 in BCD = 0010 0000 5 0101
0010 or 001000000010. All decima1l0digits are represented 6 0110
in BCD by 4 bits. 7 0111
202 8 1000
In addition to the four numeric place positions, there are 9 1001
three zone bit positions in a 7-bit code, and four zone 8421
bit positions in a 8-bit code. American Standard Code Place value
for Information Interchange (ASCII) is widely used in
data communications and is the code used to represent data internally in personal
computers. Another popular 8-bit codes in common use is the Extended Binary
Coded Decimal Interchange Code (EBCDIC). This code is used in IBM mainframe
models and in similar machines produced by other manufactures.
NUMBER SYSTEM
Binary Octal Decimal Hexadecimal
01 0 to 7 0 to 9 0 to 9 - A to F
Base 2 Base 8 Base 10 Base 16
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 110
Vedanta Let’s Log in Computer Science | Book 10
Binary Number System
Example: 202 Binary 11001010
11001010 = 10 number On On Off Off On Off On Off
MSB LSB Power of 27 26 25 24 23 22 21 20
base
Decimal 128 84 32 16 8 4 2 1
equivalent
This is the system of numbers in which only 2 digits (0 and 1) are used. The computer
circuits only have to handle 2 binary digits (bits) rather than 10. A switch is either
open (0 state) or close (1 state); a transistor either is not conducting (0) or is
conduction (1). In binary number representation, the extreme left bit is called the
Most Significant Bit (MSB) and the extreme right bit is called Least Significant
Bit (LSB). This system of numbering was invented by Francis Bacon in 1623 AD.
Finally, the binary system is used because every thing that can be done with a base
of 10 can also be done in binary.
Octal Number System
This is the system of numbering with 8 digits (0,1,2,3,4,5,6,7). The largest single
digit is 7. Each position in an octal number represents a power of the base (8).
Therefore, decimal equivalent of octal number 2067 (written as 2067 ).
8
Decimal Number System
This is the most popular system of numbering for human beings. In this system
10 digits are used. This system was invented by Hindu philosophers. The value of
decimal number say 642 is estimated as follows
642 = 2 × 100 = 2
4 x 10 1 = 40
6 x 10 2 = 600 add
642 decimal system is based in (10)
So it is proved that
Hexadecimal Number System
In hexadecimal number system, the base is 16. Hence, there are 16 symbols or digits.
The first 10 digits are the same digits of decimal number system – 0,1,2,3,4,5,6,7,8
and 9. The remaining six digits are denoted by the symbols A,B,C,D,E, and F
111 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
representing decimal values 10,11,12,13,14, and 15 respectively. Hence, the largest
single digit is F or 15. Each position in hexadecimal number system represents a
power of the base (16). Therefore, decimal equivalence of hexadecimal number 2BF
(written as 2BF ).
16
Binary Subtraction
The complete table for binary subtraction is as follows:
Subtraction of binary numbers Result
0–0 0
1–0 1
0–1 1 with the borrow form the next column
1–1 0
If the subtrahend (the lower digit) is larger than the minuend (the upper digit), it is
necessary to borrow from the column to the left. Hence, in decimal 10 is borrowed.
in binary 2 is borrowed, in octal 8 is borrowed, and in hexadecimal 16 is borrowed.
Example – 1: 11011 – 00111
Borrow 2
11011 minuend
– 00111 subtrahend
10100 result
In the above example the first and the second column, there is no need to borrow
where 1 is subtract from 1 and result is 0. In third column, we have to subtract 1
from 0. A borrow is necessary to perform this subtraction. Hence, a 1 is borrowed
from the fourth column that becomes 2 (binary 10) in the third column because
the base is 2. The fourth column now becomes 0; hence, it has nothing to borrow.
In the fifth column 0 is subtracted form 1 and the result is 1. Hence, the result of
subtraction is 10100 .
2
Example – 2: 1011100 – 0111000
Borrow 2
1011100 minuend
– 0111000 subtrahend
0100100 result
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 112
Vedanta Let’s Log in Computer Science | Book 10
Example – 3: Example – 4:
1010001
101010 -111111
-11001 010010
10001
Subtraction Using 1’s Complement Method
In modern computer, there is no any separate circuit for subtraction. It is performed
by the addition circuit, using the method called “complement”.
Rules for this method is as follow: first, let’s take a problem, 1001-101, which gives
0100 as result.
i. Make both numbers having same number of digits.
i.e. 1001 and 0101
ii. Find complement (i.e. 1 for 0 and 0 for 1) of each digit for the number to be
subtracted.
For example:
The following tables give some binary numbers and their 1’s complements.
Binary Number Binary Complement
10
10 01
101 010
1101 0010
1001 0110
1111 0000
iii. Add the complemented number and the first number (minuend).
Example:
Minuend number 1001
Subtrahend number + 1010
Result 10011
iv. Add 1 to the result, for example:
Result 10011
113 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
+1
10100
v. Remove any overflow digit from the result. For example, our subtraction was
of 4 digits but there are 5 digits in our result. So, remove the first MSD (Most
Significant Digit), which is result. For Example:
Result is 1 0 1 0 0
Overflow digit is 1. So the result is 0100.
Binary Multiplication
Multiplication in binary number system also follows the same general rules
as multiplication in decimal number system. The complete table for binary
multiplication is as follows:
Rule: 0x0=0 Multiplicand
Example – 1: 0x1=0 Multiplier
1x0=0 Partial Product
Example – 2: 1x1=1 Partial Product
Partial Product
1010 x 101 Final Product
1010
x101
1010
0000
1010
110010
1010 x 1001
1010
× 1001
1010
0000
0000
1010
1011010
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 114
Vedanta Let’s Log in Computer Science | Book 10
Example – 3: 1111 x 111
1111
×111
1111
1111
1111
1101001
Binary Division
Once again, division in binary number system is very simple. As in decimal
number system (or in any others number system), division by zero is meaningless.
A computer deals with this problem by raising an error condition called ‘Divide by
zero’ error. Hence, the complete table for binary division in as follows:
Division of binary numbers Result
0÷0 Result of function is undefined. (error)
0÷1 0
1÷0 Cannot be divided by zero (error)
1÷1 1
Example – 1: 100001 ÷ 110
0101 (Quotient)
(Dividend )
110 ) 100001
- 110 (Divisor greater than 100, hence, put 0 in quotient and take first four bit.)
1001 (Reminder)
- 110
11
Example 2: Divide (10110) by (11)
Solution: 22
111
11 1 0 1 1 0
-11
101
115 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
-11
100
-11
1
?Quotient = 111 & remainder = 1
Decimal to Binary
A positive decimal integer can be converted to Binary through successive division
by 2 till the quotient becomes zero and sequential collection of remainder on last
come first basis (i.e. bottom to top).
Convert (349) into Binary
10
Solution:
2 349 - 1
2 174 - 0
2 87 - 1
2 43 - 1
2 21 - 1
2 10 - 0
25 -1
22 -0
21 -1
0
?(349)10 = (101011101)
2
Binary to Decimal
The decimal equivalent of a binary number is the sum of the digits multiplied by 2
with their corresponding weights.
(101011101) into Decimal
2
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 116
Vedanta Let’s Log in Computer Science | Book 10
Solution:
8 7 6 5 4 3 2 1 0 (weight)
Binary 101011101
Number:
Decimal 1×28 + 0×27 + 1×26 + 0×25 + 1×24 + 1×23 + 1×22 + 0×21 + 1×20
Equivalent :
= 1×256+0×128+1×64+0×32+1×16+1×8+1×4+0×2+1×1
= 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
= 349
? (101011101) = (349)
2 10
Decimal to Octal
Decimal number can be converted to Octal through successive division by 8 till the
quotient becomes zero.
Example – 1: (538) = ? Column 2 Column 3
10 8 538 2
67 3
Column 1 8 0
8 1 1
8 0
8
8
Hence, (538) = (1032)
10 8
Example – 2: (952) = ?
10 8
Column 1 Column 2 Column 3
8 952 0
8 119 7
8 14 6
8 1 1
0
Hence, (952) = (1670)
10 8
117 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Here the number in ‘Column 2’ is divided by the number in ‘Column 1’ and the
reminder is in ‘Column 3’ and quotient in the last row of ‘Column 2’.
Octal to Decimal
The procedure for conversion of octal numbers to their decimal equivalents is
similar to conversion of binary numbers to their decimal equivalents but with the
difference that the base used in this case is 8 instead of 2 used in binary.
Example 1: (435) = (?)
8 10
= 4 x 82 +3 x 81 +5 x 80
= 4 x 64 +3 x 8 + 5 x 1
= 256 + 24 + 5
Thus, (435) = (285)
8 10
Example 2: (670) = (?)
8 10
= 6 x 82 +7 x 81 +0 x 80
= 6 x 64 +7 x 8 +0 x 1
= 384 + 56 + 0
Thus, (670) = (440)
8 10
Octal to Binary
The following steps are used in this method:
Step 1 : Convert each octal digit to a 3 digit binary number (the octal digits
may be treated as decimal numbers for this conversion).
Step 2 : Combine all the resulting binary groups (of Octal Binary
3 digits each) into a single binary number. 0 000
1 001
Example 1: (567) = ? 2 010
82 3 011
4 100
Step 1 : Convert each octal digit to binary digits. 5 101
6 110
5 = 101 7 111
82
6 = 110
82
7 = 111
82
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 118
Vedanta Let’s Log in Computer Science | Book 10
Step 2 : Combine the binary groups.
(567) = 101 110 111
8 5 6 7
Hence, (567) = (101110111)
82
This is a straight forward method, in which one just substitutes the respective
binary value for each digit of the octal number from above table.
Example 2: (7560) = ?
82
7 = 111
2
5 = 101
2
6 = 110
2
0 = 000
2
Therefore, (7560) = (111 101 110 000)
82
Binary to Octal
A binary number can be converted to its octal equivalent by grouping together
successively 3 bits of the binary number starting from the least significant bit
(right most digit) and then replacing each 3 bit-group by its octal equivalent, from
the above table.
Example 1: (111011011) = ?
28
Step 1 : Divide the binary digits into groups of three (starting from the
right)
(111 011 011)
2
733
Therefore, (111011011) = (733)
28
Example 2: (1111101) = ? (Group of 3 digits from the right)
28
(001 111 101)
1 7 52
Therefore, (1111101) = (175)
28
119 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Decimal to Hexadecimal
The method for conversion of decimal number to hexadecimal number system is
exactly similar to that of conversion of decimal to octal except the number is divided
by 16 instead of 8 as the hexadecimal number system has base 16.
Example – 1: (538) = ? Column -2 Column -3
10 16 538 10
33 1
Column -1 2 2
16 0
16
16
Hence, (538) = (21A) (Since 10 is represented by A in hexadecimal number
system) 10 16
Example 2: (952) = ? Column -2 Column -3
10 16 952 8
59 11
Column -1 3 3
16 0
16
16
Hence, (952) = (3B8) (Since 11 is represented by B in hexadecimal number
system) 10 16
Here the number in ‘Column -2’ is divided by the number in ‘Column-1’ and the
reminder is in ‘Column-3’ and quotient in last row of ‘Column-2’.
Hexadecimal to Decimal
The decimal equivalent of a hexadecimal number is the sum of the digits multiplied
by their corresponding weights.
Example 1: (269) = (?)
16 10
= 2 x 162 +6 x 161 +9 x 160
= 2 x 256 +6 x 16 + 9 x 1
= 512 + 96 + 9
Thus, (269) = (617)
16 10
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 120
Vedanta Let’s Log in Computer Science | Book 10
Example 2: (BCA) = (?)
16 10
= B x 162 +C x 161 +A x 160
= 11 x 256 +12 x 16 +10 x 1
= 2816 + 192 + 10
Thus, (BCA) = (3018)
16 10
Hexadecimal to Binary
The method for conversion of hexadecimal number Hexadecimal Binary
to binary number is similar to that of conversion of 0 0000
octal number to binary number except the binary 1 0001
representation of each hexadecimal digit is done in 2 0010
terms of four bits. Or in this method, just you should 3 0011
remember the values presented in table. 4 0100
5 0101
Example 1: (7560) = ? 6 0110
16 2 7 0111
7 = 0111 8 1000
2 9 1001
5 = 0101 A 1010
2 B 1011
6 = 0110 C 1100
2 D 1101
0 = 0000 E 1110
2 F 1111
Therefore, (7560) = (0111 0101 0110 0000)
16 2
Example 2: (3BF) = ?
16 2
3 = 3 = 0011
2
B = 11 = 1011
2
F = 15 = 1111
2
(001110111111)
2
Therefore, (3BF) = (1110111111)
16 2
Hexadecimal Value 8 4 2 1 Result
3 OFF (0) OFF (0) ON (1) ON (1) 0011
ON (1) OFF (0) ON (1) ON (1) 1011
B = 11 ON (1) ON (1) ON (1) ON (1) 1111
F = 15
121 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Binary to Hexadecimal
The method for conversion of binary number to hexadecimal number is similar to
that of conversion of binary number to octal number except the grouping is done
using four bits as the hexadecimal digit is represented in terms of four bits.
Example 1: (111011011) = ?
2 16
Step 1 : Divide the binary digits into groups of three (starting from the
right)
(0001 1101 1011)
2
1 13 11
13 = D
Where,
11 = B
Therefore (111011011) = (1DB)
2 16
Example 2: (1011111101) = ?
2 16
(0010 1111 1101) (Group of 3 digits from the right)
2 15 13 2
Where, 15 = F
13 = D
Therefore (1011111101) = (2FD)
2 16
POINTS TO REMEMBER
Number system is differentiated by its base or radix.
The group of digits or symbols used to express quantities as the basis for doing
different calculations is called number system.
A bit is the smallest unit of information on computer.
Decimal number system has base 10 as it uses 10 digits from 0 to 9.
Binary number system has base 2 as it uses 2 digits 0 and 1.
Octal number system has base 8 as it uses 8 digits from 0 to 7.
Hexadecimal number system has base 16 as it uses 16 digits (10 digits and 6 letters,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F).
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 122
Vedanta Let’s Log in Computer Science | Book 10
xercise
1. Answer the following questions:
a. What is number system? List its types.
b. What is Binary Number System?
c. What is a ‘bit’ in computer terminology?
d. What is decimal number system?
e. What is binary number system?
f. What is octal number system?
g. What is hexadecimal number system? List its numbers and characters set.
2. Convert the following decimal to binary numbers:
a. (33) b. (56) c. (64) d. (278)
10 10 10 10
e. (1102) f. (2500) g. (6416) h. (9899)
10 10 10 10
3. Convert the following binary to decimal numbers:
a. (101010) b.(10111) c.(111111) d.(100001)
2 2 2 2
e.(101011) f.(1101) g. (11010) h. (01111)
2 2 2 2
4. Add the following binary numbers:
a. (1010+1000) b.(1111+1011) c.(101011+100111)
2 2 2
d.(1111+1011) e. (10101+111011) f. (11011+10111)
2 2 2
g.(11000+11111) h.(11100+10111)
2 2
5. Perform the following binary subtractions:
a. 1101 – 110 b. 11011 -1111 c. 1100 – 111
d. 11101 – 1110 e. 11011 – 11010 f. 1010001 – 111111
g. 101010 – 11001 h. 110110 – 001100
6. Find the product of: b. (110101x101) c. (1101x110)
a. (1111x11) 2 2
2
123 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
d. (111111x11) e. (1010101x110) f. (11011x1011)
2 2 2
g. (11100x111) h. (11011x1101) c)10011 by 1110
2 2
7. Divide the following:
a) 110 by 11 b)10100 by 1101
d)10011 by 1100 e)1101 by 111
8. Convert the following Octal to Decimal numbers:
a.(632) b. (534) c. (345) d. (670)
8 8 8 8
e. (7506) f.(5067) g. (5676) h. (7560)
8 8 8 8
9. Convert the following Decimal to Octal: d. (670)
10
a. (694) b. (834) c. (347) e. (7506)
10 10 10 d. (760) 10
8
10. Convert the following Octal number to Binary: e. 1010110
h. (1260)
a. (560) , b. (453) c. (445) 8
8 8 8
d.100001
e. (716) f. (4217) g. (5764)
8 8 8
11. Convert the following Binary to Octal:
a. 1011010 b. 0101111 c. 1111101
12. Convert the following Hexadecimal to Decimal:
a. (B2) b. (A8) c. (8A) d. (79) e. (BCA)
16 16 16 16 16
f. (BAD) g. (4AD) h. (FAE) i.(84A5)
16 16 16 16
13. Convert the following Decimal to Hexadecimal:
a. (53) b. (235) c. (342) d. (2345) e. (684)
10 10 10 10 10
14. Convert the following Hexadecimal to Binary:
a. (3FB0) b. (A0BC) c. (BA56) d. (AB44) e. (F06)
16 16 16 16 16
15. Convert the following Binary to Hexadecimal:
a. (10001010) b. (10111001) c. (1011101101) d. (1101110110)
2 2 2 2
16. Give full forms of the following abbreviations:
a. BCD b. ASCII c. EBCDIC d. MSB e. LSB
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 124
Vedanta Let’s Log in Computer Science | Book 10 Group B
Unit
2
Database Management
System
125 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Unit Introduction to
Database Management
2.1 System
This is the age of information. We have to deal with different data and information
regularly. Everyday large volume of data is generated from our different business
activities, transaction, and communication with employees and customers. For
example, your school maintains data regarding a student's general information,
academic performance, punctuality, and discipline. These data need to be kept in
such a way that it can be readily available and can be presented easily in desired
formats. The data also needs to be updated and appended regularly.
As you can notice in the below Table – Students_Details, it has information
distributed under the headings, such as SID, Name, English, Mathematics, and
Computer. Furthermore, entire information is alphabetically organized for easy
retrieval.
Table – Students_Details
SID Name English Mathematics Computer
S0A Archana Kumal 45 98 88
S9B Nirmal Chaudhary 78 65 77
S7R Raju Tamang 80 76 70
Well organized information as above is database. A database is a collection of
data that is organized for easy access, retrieval and management of its contents. A
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 126
Vedanta Let’s Log in Computer Science | Book 10
database has one or more related tables of data. The data can be any format like
text, numeric, images, audio, and video.
Data and Information
Raw form of any facts, figures or entities is known as data. Data alone does not
give any meaning. For example, Aaradhya, 1000, account, balance, etc. are raw
data that individually does not give any meaning.
The processed form of data is known as information. When the data becomes
information, it gives meaningful result. For example, Aaradhya has Rs 1000 as
balance in his bank account. Here Aaradhya, 1000, account, and balance all have
their meaning. Thus, we can say that information is the organized collection of
inter-related data.
Purpose of Database
A database refers to the collection of information organized in such a way that its
contents can easily be accessed, updated, and queried. A database usually contains
data about a particular entity. An entity may be a student or an employee in
organization, etc.
Database can be computerized and non-computerized (manual). A database may
have single table or multiple tables. The data in a database are organized in rows
and columns. Some examples of database are telephone directory, mark ledger,
attendance register, dictionary, etc.
Database Management System (DBMS)
Database management system (DBMS) is a software package that provides
software programs to control the creation, maintenance, and use of a database.
DBMS basically deals with the creation of database, its management, and retrieval
process. Creating, modifying, updating, appending, organizing, sorting, removing,
and retrieving are the major tasks performed easily, efficiently, and accurately by
using Database management system. Some of the popular DBMS softwares are
MS-Access, Oracle, , MS-SQL Server, MySQL, PostgreSQL, etc.
DBMS Softwares
127 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
These DBMS’s are capable of handling records in multiple tables on the basis of a
key field. It allows a user to view or retrieve records from the multiple linked tables
continuously at a time.
Advantages of Database Management System
A computerized DBMS offers several advantages over conventional filing system.
Some of the advantages are:
a) Organized Data
The DBMS allows you to store data, retrieve and process the collection of
data in a central database file. There is no need of using different files for the
storage of data.
b) Quick and Efficient Retrieval of Information
The DBMS allows to retrieve information from the database quickly. User
has to set the query to extract the required data from the database.
c) Reduces Data Redundancy:
In conventional data storage method, some information is stored in different
files: it results into duplication of data. It is called data redundancy. When we
use electronic database all the data is stored in the central location. Hence, it
reduces data redundancy and provides better and efficient use of the memory
space.
d) Consistency of Data
When same data is stored at different location, it the data is not changed at
all the locations during editing. It results into inconsistency of data.
e) Data Security
DBMS allows only authorized access to the data. Hence, unauthorized users
cannot access the data.
f) Data Sharing
Data is present in the centralized database. Hence, it may be used by many
users.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 128
Vedanta Let’s Log in Computer Science | Book 10
g) Data Integrity
Since the same database is shared by many users, DBMS makes it sure
that the data being transmitted does not get corrupted. Hence, it maintains
integrity of the data.
h) Standardization of Data
It allows entry of the data in the fixed format with only valid values specified.
Components of Database
Table
Database is composed of one or more tables. Tables are the building block of
database. A single table is used to store data of a specific purpose or subject such as
telephone directory, book records in library, etc. Since entire data is managed and
kept in a table for the future retrieval process, it is also called the primary object
of database. Table stores large volume of data into rows called records and column
called field. When fields and records are combined, they form a complete table.
Table – Student_Records
Student_ID Student_Name Height (cm) Weight (KG)
S201 Ramesh Parajuli 157 58
S202 Janaki Mahato 150 49
S203 148 52
S204 Rabin Lama 151 47
Uttara Upreti
Record
A record or row contains information about single items in a database. It is also
called tuple. For example, in Table–Student_Records, all the information about a
student is record. Here, the combination of Student_ID, Student_Name, Height
(cm), Weight (KG) values forms a record.
Student_ID Student_Name Height (cm) Weight (KG)
S201 Ramesh Parajuli 157 58
129 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Field Weight (KG)
58
A field or column contains information about a certain type for 49
all records. It is also known as attribute. For example, in Table– 52
Student_Records, Student_ID, Student_Name, Height (cm), 47
Weight (KG) are the fields.
Relational Database Management System (RDBMS)
A relational database is a special type of database where data is stored in different
tables which we link to each other. Some examples of RDBMS are MS-Access,
MySQL, MS SQL Server, Oracle, etc.
POINTS TO REMEMBER
A collection of systematically organized inter-related data is called a database.
Raw form of any facts, figures, or entities are known as data.
The processed form of data is known as information.
Database management system (DBMS) is a computerized system that stores data
process them, and provide information in an organized form.
Some of the popular DBMS software are MS-Access, Oracle, , MS-SQL Server, MySQL,
PostgreSQL, etc.
Tables are the building blocks of database.
A record or row contains information about single items in a database.
A field or column contains information about a certain type for all records.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 130
Vedanta Let’s Log in Computer Science | Book 10
xercise
1. Answer the following questions:
a) What is database? Give some examples of database.
b) Differentiate between data and information.
c) What is DBMS? Name any four DBMS softwares.
d) What are the components of database?
2. Choose the correct option.
a) .................... is the collection of related information.
i. Data ii. Meta data iii. Database iv. Facts
b) .................... is the raw form of any facts and figures.
i. Information ii. DBMS iii. Records iv. Data
c) .................... is a DBMS software.
i. MS-Access ii. MS-Excel iii. bdase iv. None of them
d) A .................. is a collection of data about a specific topic.
i. DBMS ii. Database iii. Table iv. All of them
e) In a table, row is called .................. and column is called .................
i. record, field ii. field, record iii. record, tuple iv. None of them
3. Fill in the blanks by using the phrases given below:
i. Database is a) Enter, Maintain and update data
in database
ii. DBMS is a software
package to b) Railway reservation, Facebook
registrations
iii. Database applications for
example are c) Control the creation, maintenance
and use of a database
iv. DBMS Software programs
and Tools are used to d) Collection of data in organized
tables
131 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Unit Creating Database
2.2 Using Microsoft Access
An Introduction to Microsoft Access
MS-Access is a DBMS software developed by Microsoft
Corporation. This software is distributed along with the
Microsoft Office application package. Microsoft Access 2019
is the latest version available in the market.
The Access database consists of several different components.
Each component is called an object. Access consists of seven
objects. The various objects of MS-Access are Tables, Queries, Forms, Reports,
Pages, Macros, and Modules. All objects of a database are stored in a single file,
and the extension of database file is .accdb.
Main features of MS-Access
a) It creates sophisticated database quickly.
b) It analyzes and modifies your data easily with queries.
c) It creates elaborate reports from your data.
d) It makes customized data entry forms.
e) It presents your data dynamically on WWW (World Wide Web).
We explore mainly the following four objects of MS-Access:
a) Tables
All databases must have at least one table. Tables are the primary building
block of database. All data are stored and managed in a table. Every table in a
database focuses on one specific subject. Table stores large volume of data into
rows and column.
b) Queries
A query is simply the question that we ask about the data stored in the table.
Query is also used to perform various actions on the data. For example, “Show the
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 132
Vedanta Let’s Log in Computer Science | Book 10
names of students who have scored greater than or equal to 80 marks in science.”
“Update the salary of employees by 10%.”
c) Forms
Forms are the graphical interface used to simply make entry of data into the
tables or multiple linked tables. Forms are also used to display the information in
specific manner as well as to permit user to add, modify and delete data in a table.
Primarily, fields in the table or queries are made available to place in the forms
that we create.
d) Reports
Reports are the presentation of information in a required format. Reports are
generally created for printing of any target information. With Access, we can create
reports of any table or query. For example, report card of your final examination is
one such use of Access.
Starting MS-Access
Follow the following steps to run MS-Access:
Step 1 : Press on Windows
Step 2 : Key and R at the
Step 3 : same time. Run
window appears.
Type ‘msaccess’ as
shown in the figure
alongside.
Finally click on OK
button.
Creating a new database file
When MS-Access starts, it gives user a choice of either creating a new database or
opening an existing database. Follow the following steps to create a new database
file:
133 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Step 1 : Vedanta Let’s Log in Computer Science | Book 10
Click on the Blank desktop database.
A Blank desktop database dialog box appears.
Step 2 : Type the File Name.
Step 3 : Choose the required folder where you want to save.
Step 4 : Click on Create button.
Creating Table in MS-Access
Follow the following steps to create a table:
Step 1 : From Create tab, click on Table Design button of Tables group.
Step 2 : Add the required Field Name and Data Type.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 134
Vedanta Let’s Log in Computer Science | Book 10
Step 3 : Right click on the Table1 tab in the above figure.
Step 4 : Type Table name. Click on OK.
Note:
A field name can be up 40 characters long.
Adding Fields in a table
Follow the following steps to add a field in an existing table:
Step 1 : Open the database and open the table.
Step 2 : Right click on the field above which you want to add a new field.
Step 3 : Click on Insert Rows. A new blank field is inserted above the
Step 4 : selected field.
Type Field Name and Data Type.
135 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Deleting Fields in a Table
Follow the following steps to add a field in an existing table:
Step 1 : Open the database and open the table.
Step 2 : Right click on the field which you want to delete.
Step 3 : Click on Delete Rows.
Defining Data types
Data type determines the kind of values that you can store
in the field. After you enter the valid field name, it allows
a user to select the data type for the field. You can use
the Data Type property to specify the type of data stored
in a table field such as text for name field, number for
class field, Date and time for DOB field, etc. Each field can
store data consisting of only a single data type. MS-Access
supports the following data types:
Table - MS-Access Data types
Data Type Description Maximum Data Default
ShortText / Space Field Size
LongText Used for text or combinations of text 255
Number and numbers, as well as numbers, such Up to 255
- Byte that does not require calculations, such Characters
- Integer as phone numbers.
Lengthy text or combinations of text Up to 64,000 _
and numbers. characters.
Used for data to be included in 1,2,4 or 8 Bytes Long
mathematical calculations. Integer
Stores numbers from 0 to 255 without 1 byte
decimals.
Stores numbers from -32768 to 2 bytes
+32768 without decimals.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 136
Vedanta Let’s Log in Computer Science | Book 10
- Long Stores numbers from -2147483648 to 4 bytes
Integer +2147483647 without decimals.
- Single
Single precision floating point numbers 4 bytes, 7
- Double
Date/Time from -3.4 x 10-38 to 3.4 x 1038. decimal places
Currency
Auto Number Double precision floating point numbers 8 bytes, 15
from -1.797 x 10-308 to 1.797 x 10308. decimal places
Yes/No
Used for dates and time data. 8 Bytes
OLE Object
Used for currency values. 8 Bytes -
Hyperlink _
Attachments Used for unique sequential 4 Bytes _
Lookup (incrementing by 1).
Wizard _
Used for data that can be only one of 1 Bit
two possible values, such as Yes/No. _
_
Used for OLE objects (such as Up to about 2 GB _
MS-Word documents, MS-Excel
spreadsheets, pictures, sounds).
Used for hyperlinks. Up to 2048
Characters
To attach any supported type of file Up to about 2 GB
Used to create a field that allows you Dependent on the
to choose a value from another table data type of the
lookup field
Field Description
You can enter the description of each field in the Description column. It helps you
to remember the use and purpose of a particular field. This is an optional part in
a database. It is displayed in the status bar when you select this field on a form.
Primary Key field
Primary Key
Primary Key is a special field or group of fields in the table that uniquely identifies
each record from the database. To distinguish one record from another, table must
137 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
contain a unique field named as primary key. The primary key does not accept
duplicate value for a field and it does not allow a user to leave the field blank or
null. The primary key is an identifier such as a student ID, a Product code, Exam
roll no., etc. Hence, primary key is unique to each record.
Importance of Primary Key
To identify each record of a table uniquely.
To reduce and control duplication of the record
in a table.
To set the relationship between tables.
Setting the Primary Key
Follow the following steps to create a primary key field:
Step 1 : Open the table in Design View.
Step 2 : Click on the field in which you want
to apply primary key.
Step 3 : Click on Design tab.
Step 4 : Click on Primary Key
button from Tools
group.
A key icon is displayed
on the left side of the
primary key field.
Primary Key field
Field Properties Pane
Field properties pane displays list of properties associated with each field data type.
To control over the contents of a field, we can set the field size, format, validation
rule, etc.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 138
Vedanta Let’s Log in Computer Science | Book 10
The general properties of fields are given below:
Field Properties – ShortText Field Properties – Number
a) Field Size
You can use the field size property to set the maximum size for data stored in
the field that is set to the Text or Number data type.
For Text data, the amount of data that you can store can be determined by the
number of characters you wish to store on it. Maximum is 255 characters.
For numeric data, the field size can be set depending upon the type and range of
value you wish to store. The table below explains about the numeric data range
and storage.
Field Size Setting Range of Values Decimal Storage Size (in
Places Bytes)
Byte 0 to 255 None
Integer 1
Long Integer -32768 to 32767 None
Single 2
Double 2147483648 to +2147483647 None
-3.4 x 10-38 to 3.4 x 1038. 4
-1.797 x 10-308 to 1.797 x 10308 7
4
15
8
139 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
b) Caption
Caption field property is the alternative name given for any field. This helps to
make field name more explanatory. The maximum size for this is 2048 characters.
It is also a label for a field when used in a form. If caption is not entered, field name
is used for label for a field on a form.
c) Default Value
Default Value field property is one that is displayed automatically for the
field when you add a new record to the table.
d) Validation Rule
It is used to limit the values that can be entered into a field. Data validation
in various cases are explained in the below following table.
Expression Example Description
Validation expression for numbers
< <100 Entered value must be less than 100.
> >50 Entered value must be less than 50.
<> <>0 Entered value must be not equal to 0.
<= <=100 Entered value must be less than or equal to 100.
>= >=50 Entered value must be less than or equal to 50.
= =10 Entered value must be equal to 10.
B e t w e e n Between 0 and Entered value must be within the range of 0 to
.... and ... 100 100.
Validation expression for dates
< # 1/30/2012 # Entered date must be before January 30, 2012.
> # 1/30/2010 Entered date must be after January 30, 2010 and
5:30 PM # after 5:30 PM.
<= #1/30/2012 # Entered date must be before or on January 30,
2012.
>= # 1/30/2010 Entered date must be after or on January 30,
2010.
> Date() Entered date must be after the current date.
< Date() Entered date must be before the current date.
> Now() Entered date must be today after the current time
or any other day in future.
< Now() Entered date must be today before the current
time or any other day in past.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 140
Vedanta Let’s Log in Computer Science | Book 10
Validation expression for texts
Like "B*" Here * represents zero or more characters. It
checks that the value starts with B (or b), followed
by zero or more characters.
Like "*up" It checks whether text ends with characters "up".
Like Like "?????UP" Here ? represents one character. It accepts 7
characters and ends with UP.
AND
OR Like "####CSX" Here # also represents one character but it is
number. It accepts 7 characters and ends with
CSX and preceded by five numbers.
Like "[BO]????" It accepts 5 characters and first character is
either B or O.
Like "[A-Z] [A-Z] It accepts four charecter (Only letters). [A-Z]
[A-Z] [A-Z] represents characters ranges from A to Z.
Validation expression with boolean operators
>=10 AND <=50 Entered value must be within the range of 10 to
50
>500 OR <100 Entered value must be either greater than 500 or
less than 100.
e) Validation Text
Validation Text is the error message that appears if the data entered is
invalid according to the specified validation rule.
Validation Rule for Section Field – “A” Or “B” Validation Text Message Box
141 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
f) Required
You can use required property to specify whether a value is required in a
field. So, Yes and No are the options for required property. If this property is set to
Yes for a field, the field must receive a value during data entry. If this property is
set to No for a field, the field can be left blank.
g) Indexed
You can use the indexed property to set an index on a field. It speeds up
searching and sorting of records based on a field. For example, if you search for
specific student’s name in a SName field, you can create an index for this field to
speed up the search for the specific name. By default, indexed property is set as No.
It also uses other two settings.
Table - Indexed property settings
Setting Description
No No indexing.
Yes (Duplicates OK) The index allows duplicates.
Yes (No Duplicates) The index does not allow duplicates.
POINTS TO REMEMBER
MS-Access is a DBMS software developed by Microsoft Corporation. It is distributed
with MS-Office package.
Tables, Queries, Reports, and Forms are the four main objects of MS-Access database.
Tables are the primary building blocks of database.
Data type determines the kind of values that you can store in the field.
Data Type supported by MS-Access are Short Text, Long Text, Number, Data/Time,
Currency, AutoNumber, Yes/No, OLE Object, Hyperlink, Attachment, and Lookup
Wizard.
The primary Key is a special field or group of fields in the table that uniquely identifies
each record from the database.
Caption is the alternative name given for any field.
Indexed property speeds up searching and sorting of records based on a field.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 142
Vedanta Let’s Log in Computer Science | Book 10
xercise
1. Answer the following questions.
a) List any four features of MS-Access.
b) What is database object? List any four database objects.
c) What does data type refer to? Name any four data types in MS-Access.
d) What is the primary key? Why is it important to specify?
e) What are field properties? Name any four of them.
f) Define indexing. Mention its importance.
2. Choose the best answer.
a) What is extension of access database file?
i. .DBF ii. .ACCDB iii. .MBD iv. .MDB
b) Object primarily used to store the data in database.
i. Table ii. Form iii. Query iv. Report
c) A field name can be up to .................. characters long.
i. 40 ii. 46
iii. 64 iv. 2048
d) .................. is a data type used for lengthy text and numbers
i. Text ii. Long Text
iii. OLE Object iv. Memo
e) Data type that requires 8 bytes of storage.
i. Yes/No ii. Currency
iii. Long Integer iv. All of them
f) The name of caption can be declared up to ……….. characters.
i. 1024 ii. 2024 iii. 2048 iv. 2005
g) Memory Space used by a auto number data type is ……………….
i. 1 Byte ii. 2 Bytes iii. 4 Bytes iv. 8 Bytes
143 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
3. Match the following: Vedanta Let’s Log in Computer Science | Book 10
I. Group A
a) Number Group B
b) Yes/No i. 50
c) Currency ii. 8 Bytes
d) Text iii. Long integer
iv. 1 bit
v. Short integer
II. Group A Group B
a) Data Redundancy i. Error message
b) Validation Text ii. Pattern of data in a field
c) Input Mask iii. Lookup wizard
d) Validation Rule iv. Data duplication
v. Limits the values
III. Group A Group B
a) Indexing data i. Retrieves data
b) Long text ii. Caption
c) FoxPro iii. Memo field
d) Label for a field iv. DBMS
v. Searching fast
4. Write the most appropriate technical term of following statements.
a) Field property that limits the values and that can be entered into a field
b) The value automatically enters for the new record
c) A field or a group of fields that uniquely identifies the records in database.
d) A message displayed after data is entered and checked into a field.
e) Field property that defines label for the field
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 144
Vedanta Let’s Log in Computer Science | Book 10
Unit Entering and Editing
2.3 Data
Table Datasheet and its Formatting
Table datasheet is simply the display of records in row and column format. Using
the datasheet view, you can add, modify, search, or delete records. There are mainly
two views of Table.
a) Design View
Related with table structure. You can add, edit, or delete field and its
properties.
b) Datasheet View
It is related to records. You can add, modify,
search or delete records.
Switching to Datasheet View
Follow the following steps to switch from Design
View to Datasheet View:
Step 1 : Click on the Design Tab.
Step 2 : Click on View drop-down button
from Tools group.
Step 3 : Click on Datasheet View.
Adding Records in a Datasheet
After the table is created through design view option, you open it in datasheet to
enter the records. Follow the following steps to add records in datasheet:
Step 1 : After you open datasheet mouse cursor is placed in the first field
of first record. Type the required data in the field.
145 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Step 2 : Vedanta Let’s Log in Computer Science | Book 10
Step 3 :
Press on Tab or Arrow to move to the next field. Or, simply place
Step 4 : the mouse cursor in the desired field.
While entering the data in a field, next row for new record is
automatically displayed. For example, if you entering the record
in the first row, the second row automatically appears. Repeat the
above steps to enter the data in fields as long as you required it.
After completing adding records in the datasheet, you can close
the datasheet simply by clicking on close button.
Modify Records in a Datasheet
You can open the existing table and can modify the date in datasheet. Follow the
given steps to modify records in datasheet:
Step 1 : Open the table in Datasheet View.
Step 2 : Put the mouse cursor in the target cell.
Step 3 : Type new value or edit the exiting value of the desired cell.
Delete Records from a Datasheet
You can remove the unwanted records of the datasheet. Follow the given steps to
delete records in datasheet:
Step 1 : Open the table in a Datasheet
Step 2 : View.
Right-click on the square
Step 3 : box left to the record which
Step 4 : you want to delete. A pop-up
menu appears.
Click on Delete Record
option. A message box
appears.
Click on Yes.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 146
Vedanta Let’s Log in Computer Science | Book 10
Hiding the Columns or Fields
You can temporarily hide a column(s) or field(s)
so that you can view more columns in a larger
datasheet. Follow the given steps to hide fields:
Step 1 : Right-click on the column heading
Step 2 : (field name) which you want to
hide. A pop-up menu will appear.
Click on Hide Fields option.
Unhide the Hidden Fields
Follow the given steps to unhide the hidden columns:
Step 1 : Open the table in Datasheet View.
Step 2 : Right-Click on any Column
heading. A pop-up menu appears.
Step 3 : Click on Unhide Fields option.
A Unhide Columns dialog box
Step 4 : appears with the list of fields.
Step 5 : Click on the check box of required
field to unhide.
Click on Close.
Freeze Columns
You can freeze one or more columns on a datasheet
so that they become the leftmost columns and are
visible at all times no matter wherever you scroll.
Follow the given steps to freeze column(s):
Step 1 : Open the table in Datasheet View.
Step 2 : Right-Click on the column heading
which you want to freeze. A pop-up
Step 3 : menu appears.
Click on Freeze Fields option.
147 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Unfreeze Columns
You can unfreeze columns on a datasheet. Follow the given steps to unfreeze
column(s):
Step 1 : Right-Click on the column heading. A pop-up menu appears.
Step 2 : Click on Unfreeze All Fields option.
Adjusting Column Width
In datasheet, we can adjust the column width as required to fit the data in the field.
In some case, field might contain the longer data that might not be easily visible
and in other case, field might contain the short data that taking unnecessary longer
width. So, to improve from this inefficient view of datasheet, we have to adjust the
column width. This can be done in three ways mentioned below:
Method #1:
By dragging the field sizing line from the right most corner of the field header.
Method #2:
By double clicking on the field sizing line.
Method #3:
By setting the fixed width in a column width
dialog box.
Step 1 : Right-Click on the header
Step 2 : of column.
Click on Field Width
Step 3 : option. A Column Width
Step 4 : dialog box appears.
Type the required width
value.
Click on OK.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 148
Vedanta Let’s Log in Computer Science | Book 10
Adjusting Row Height
In datasheet we can also adjust the height
of row as required to fit the records in the
row. This can be done in two ways mentioned
below:
Method #1:
By dragging the row sizing line from the
bottom most corner of the row.
Method #2:
By setting the row height in a Row Height dialog box.
Step 1 : Right-Click on the square box left to the
required row. A pop-up menu appears.
Step 2 : Select Row Height option. A Row Height
dialog box appears.
Step 3 : Type the required row height.
Step 4 : Click on OK.
Sorting Records
The process of arranging all the records in a table either ascending or descending
order based on field or fields is known as sorting.
Text types of data are sorted in alphabetical order (ie. A to Z or Z to A).
Date and Time data are sorted from the oldest to the newest or the newest to
the oldest.
Number/Currency types of data are sorted in the smallest to the largest or
the largest to the smallest.
149 Approved by Curriculum Development Centre, Sanothimi, Bhaktapur
Vedanta Let’s Log in Computer Science | Book 10
Follow the given steps to sort data of
Short Text field:
Step 1 : Open the table in
Datasheet View.
Step 2 : Right-Click on the
column heading of a
field which you want
to sort. A pop-up menu
appears.
Step 3 : Click on Sort A to Z
option.
The data is sorted in alphabetical order.
Before Sorting After Sorting
Field with Memo, Hyperlink, and OLE Objects data types cannot be sorted. After
the sorting process, you need to save the table to keep changes.
POINTS TO REMEMBER
There are two views of Table: Design View and Datasheet View.
Using the datasheet view, you can add, modify, search, or delete records.
You can hide/ unhide column and freeze/unfreeze required column(s) of a table.
The process of arranging all the records in a table either ascending or descending
order based on field or fields is known as sorting.
Approved by Curriculum Development Centre, Sanothimi, Bhaktapur 150