Final Notesof Class 12 CS

Download as pdf or txt
Download as pdf or txt
You are on page 1of 67

Chapter-1

Network Operating System

Q1. What do you mean by network?


A1. A network is the group of two or more computers that are linked in order to share
resources, exchange files or allow communications. It is capable of sharing software
and hardware resources between many users.
Q2. What is computer networks?
A2. Computer network is a collection of interconnected independent computers and
peripherals connected by communication facilities for exchanging information and
sharing resources.
A computer network is interconnection of geographically distributed multiple
computers so that a meaningful transmission and exchange of information may take
place among them.
Q3. Give advantages of network?
A3. The advantages of network are as follows :
i. Sharing files , data and information.
ii. Sharing hardware and software.
iii. File integrity
iv. Network provides a very fast communication media.
v. It provides flexibility because there is a possibility of connecting devices of different
user’s.
vi. It reduces the cost of system.
vii. Network provides security to us.
viii. Speed : Sharing and transferring files within network is very rapid.
ix. It provides backup facility.
Q4. Give disadvantages of network?
A4. The various disadvantages of network are:
i. Network failure : All the central facilities may fail due to network.
ii. Management : The management of whole network is tough.
iii. Security : Danger of security is always present on network.
iv. Expensive to build.
v. Large scale organization :Cables and other hardware are very costly to buy
and replace in large organization.
Q5. Explain various components of computer networks?
A5. Various components of computer network are:
i. Computer : The main purpose of a network is to join computers together.
The two types of computers which are used for networking are :
a. Client/Node : It is the normal computer system which is connected to
network for sharing of resources.
b. Server is a powerful computer. It helps us in sharing of resources or
information. It controls all other nodes.
ii. Network Interface Card(NIC) : It is a small computer circuit board or card that
is installed in a computer so that it can be connected to a network. This card should
be fitted in each computer known as client and server computer.
iii. Hub/Switch : It is a device that allows you to connect multiple computers to a
single network devices. It allows data sharing between all devices connected to hub.
iv. Router : It is hardware device which is designed to receive, analyze and
forward incoming data within a network or to another network.

1
v. LAN cable : It is used to connect more than one computer or other devices such as
printers and scanners to each other.
Q6. What is TCP/IP?
A6. The Internet works by using a protocol called TCP/IP or Transmission Control
Protocol/Internet Protocol. It allows one computer to talk to another computer via the
internet through compiling packets of data and sending them to right location.
TCP layer handles the message part. The message is broken down into smaller units
called packets which are then transmitted over network.
IP layer is primarily concerned with the transmission portion.
Q7. What is IP addressing?
A7. Every machine on the internet has a unique number assigned to it called an IP
address. An Internet Protocol(IP address) is a numerical label assigned to each
device(e.g. computer, printer) participating in a computer network that uses the
Internet Protocol for communication.An IP address consists of 32 bit of information.
These bits are divided into four sections referred to as octets or bytes, each
containing 1 byte(8 bits). An address space is the total number of addresses used by
the protocol. If a protocol uses N bits to define an address, the address space is 2N
because each bit can have two different values(0 or 1) and N bits can have 2N values.
Q8. Name various classes of IP address?
A8. IPV4 address is divided into two parts :
i. Network ID :This identifies the network to which IP address belongs
ii. Host ID : This identifies host on the specified network.
The IPV4 addressing system is divided into five classes of IP addresses. These are :
Class A, Class B , Class C, Class D , Class E address.
Q9. What is IP routing?
A9. IP routing is a means of specifying and discovering paths in a TCP/IP network along
which network data may be sent. Routing uses a set of routing tables to direct the
forwarding of network data packets from their source to the destination often via
intermediary network nodes known as routers. Two types are :
i. Static routing : It is the manual configuration and selection of a network route,
usually managed by the network administrator.
ii. Dynamic routing : It makes the automatic adjustment of the routes according to
the current state of the route in the routing table.
Q10. What do you mean by network operating system? Explain.
A10. An operating system that provides the connectivity among a number of autonomous
computers is called a network operating system. Network Operating System(NOS)
runs on a server and provides server the capability to manage data, users, groups,
security, applications and other network functions. Its main purpose is to allow
shared file and printer access among multiple computers in a network typically a
local area network, a private network or to other network. E.g. UNIX, LINUX,
Novell Netware
Q11. Give the functions of NOS?
A11. The functions of NOS are :
i. Provides access to remote devices i.e. printers etc.
ii. Enabling and managing access to files on a remote systems and granting
access to users.
iii. Granting access to remote applications and resources such as internet.
iv. Monitoring the system and security so as to provide security against viruses,
hackers etc.

2
Q12. What is Linux Operating System?
A12. The Linux Operating system is a freely distributable operating system based on Unix
that can be installed on PCs, laptops, netbooks, mobile, video game consoles, servers
computers and more.
Q13. Give the three major components of linux structure?
A13. The three major components of linux structure are :
(i). Kernel (ii) Shell (iii) Application
Q14. Write a note on Kernel?
A14. It is the program that is responsible for allocating the computer‟s resources and
scheduling the user jobs in a fair manner. It is also called the heart of the Linux.
Various functions performed by kernels are :
i. Memory management.
ii. Process management
iii. Device management
iv. System call
v. Security
Q15. Write a note on Shell?
A15. Shell refers to the program that is used to interpret the typed commands the user
sends to the operating system. Linux has following types of shells :
i. Bourne Shell : named after its developer “Steve Bourne”. It was the first
shell used for the Unix operating system. It provides
features which are sufficient for most programming
needs.
ii. C Shell : It was designed to allow user to write shell scripts programs
using a syntax similar to C programming language. It is known
as „csh‟
iii. TC Shell : It is an expansion of C shell. It has all the same feature but add
the ability to use keystrokes from the Emacs word processor to
edit text on the command line. It is also known as „tcdh‟
iv. Korn Shell : It was written by „David Korn‟. It attempts to merge the feature
of the C shell, TC shell and Bourne shell under one package. It
also includes the ability for developers to create new shell
commands.
v. Bash Shell : It is the updated version of the original Bourne shell.
Q16. Write a note on applications?
A16. Linux has a variety of high quality softwares which can be easily downloaded and
installed similarly like Windows, Mac.
Q17. Give advantages of Linux?
A17. Advantages of Linux are :
i. Open Source :- It is open source operating system i.e. its source code is easily
available for every one.
ii. Security : Linux is more secure in comparison to other OS such as
Windows.
iii. Software Updates : In Linux you encounter a large number of software
updates. These software updates are much faster than updates in any other OS.
iv. Free to Use(Low Cost) : It is freely available on the web to download and
use.
v. Stability(Reliability) : It provides high stability.

3
vi. Performance : It provides high performance on various networks and
workstations.
vii. Fast and Easy installation : It can be easily installed from the web and
does not require any pre requirements as it can run on any hardware.

Q18. Give various components of Linux desktop?


A18. The various components of Linux desktop are :
i. Top Bar : The bar across the top of screen provides access to the date and
time, system indicators, currently open applications.
ii. Desktop : It is the area where you can open, run, rearrange multiple
program and application.
iii. Dock : The dock occupies the left side of the screen. It shows
currently open apps and shortcut of your favourite.
iv. App Drawer : It is at the bottom of the dock. When clicked it
lists all of the apps installed on your computer in a grid of icons.
v. Search : It appears at the top of the activities overview. Click activities option
to open search later.
vi. System Indicator : These are individual icons showing battery life, network
connectivity, sound, Bluetooth and many more.
Q19. Write note on various shell commands?
A19. The various shell commands are :

(i) who : It lists all users currently on system. The syntax is :


$ who
(ii) who am i : It reports the user name of the command user. The syntax is :
$ who am i
(iii) Mkdircommand : It is used to make a new directory. The syntax is :-
$ Mkdirdirname
e.g. $ mkdirabc
(iv) CD command : It is used for changing the directory. The syntax is :-
$cd
(v) Rmdircommand : It is used to remove a directory. The syntax is :-
$ Rmdirdirname
e.g. $ rmdirabc
(vi) Ls command : It is used to display a list of files in the current working
directory. The syntax is :-
$ Ls
To show the detail of all files in a list form : $ ls – l
To show all the hidden files : $ ls - a
(vii) Pwd : It is used to find the directory in which user is currently
working. Pwd stands for print working directory. The syntax is :
$ pwd
(viii) Cp : It is used to copy a file or directory. The syntax is :-
$ cp file1 file2
(ix) Echo : It is used to display a message on the terminal window. The
syntax is :
$ echo message
e.g. $ echo Hello. How are you.

4
(x) Grep : This commands searches the named input FILEs for lines
containing a match to the given PATTERN. It is used to find a
string in a file or stream. The syntax is :-
$ grep [options] „string‟ [filename]
e.g. $ grep „hello‟ file1.txt
(xi) Chmd command : It changes the access mode (permission) of one or more
files. Only the owner of the file or a privileged user may change the mode.
Mode can be numeric or an expression in the form of who opcode permission.
The syntax is :-
$ Chmod [options] mode files
e.g. $ chmod u=rwx , g = rx , o = r myfile
(xii) Cat command : The cat(short for “concatenate”) command allows to
create single or multiple files, view content of file , concatenate files
and redirect output in terminal or files. The cat command is used for :-
a. Display text file on screen : the syntax is
$ cat abc.txt
b. Create a new text file : the syntax is :
$ cat>newfile
c. Append data in a text file : the syntax is :
$ cat>> abc.txt
d. File concatenation : the syntax is :
$ cat file1 file2 >newfile
(xiii) Find : It is used to find the files in the hard drive. The syntax is :
e.g. $ find /user/bin – type f – name “*.txt”
(xiv) Date command : It is used to display the current system date and time. The
syntax is :- $ date
(xv) Cal : It is used to print a 12 month calendar for a given year. The
syntax is :
$ cal 2019
(xvi) Cmp : It compares two files that they are identical. It shows 0 if they
are identical otherwise it shows 1. The syntax is
$ cmp file1 file2
(xvii) Sort : It print the lines of file in sorted order. The syntax is :
$ sort filename
(xviii) Ps :- It is used to view the processes that user is running. The syntax
is : $ ps [option]
e.g. $ ps – u username displays the processes of the
specified.
(xix) Kill : It is used for terminating the process. The syntax is :
$ kill processid
(xx) Netstat : It display the network status. It prints information about active
socket, routing table, interfaces etc. the syntax is :
$ netstat
(xxi) Logout : It is used for logging out the Linux. The syntax is :
$ logout

5
Q20. What are wildcards?
A20. Wildcards are a set of characters that allow you to create a pattern defining a set of
files or directories. The basic type of wild cards are :
i. * represents zero or more character
e.g. if user want to display files beginning with „F‟ :
$ ls F*
ii. ?represents a single character
e.g. $ ls F????.txt
the output will be : First.txt File1.txt File2.txt
Q21. What is I/O redirection?
A21. Redirection is a feature in Linux such that when executing a command you can
change the standard input/output devices. The basic workflow of any linux command
is that it takes an input and gives an output. The standard input device is the
keyboard. The standard output device is the screen.
Q22. What is output redirection?
A22. The output from a command normally intended for standard but it can be easily
diverted to a file. This capability is known as output redirection. A greater than
character(>) is used for output redirection.
e.g. $ who > users
Here no output appears at the terminal because the output has been redirected from
the default output(the terminal) into the specified file.
Q23. What is input redirection?
A23. Input of a command can be redirected from a file. The less-than character(<) is used
to redirect the input of a command.
e.g. $ command [arguments] < filename
$ mail ram <mail_contents
Here the text file mail_contents will be used as input for command mall ram.
Q24. What is pipelines?
A24. Pipes are used to redirect a stream from one program to another. We pipe the output
of one program to the input of another. A pipe is nothing but a temporary storage
place where the output of one command is stored and then passed as the input for
second command. It is represented by a vertical bar ( | ).
The syntax is :
$ command1 | command2
e.g. $ ls | lpr
here the list of filenames output by ls command is piped into the lpr command.
Q25. What do you mean by vi editor? Explain.
A25. Vi stands for visual editor. It is used for editing files in Linux. It operates in three
modes :-
i. Regular mode :- It allows typing commands. In regular mode you can move
the cursor around with the arrow keys. E.g. press the x key to delete the
character.
ii. Insertion mode :- It is used to insert a character inside a document. To
switch to insertion mode press the key Insert on your keyboard or press key i.
iii. Replacement mode :- It allows to replace existing text by the text you
capture. Just hit r again to goto replacement mode and hit the key ESC to
return to regular mode.

6
Q26. What is cyber crime?
A26. The crimes committed with the use of computers or relating to computer using
internet is called cyber crime. The most common type are :
i. Fraud : is used to describe a cybercrime that intends to deceive a person
in order to gain important data or information.
ii. Hacking : It involves the partial or complete acquisition of certain
functions within a system, network or website. It also aims to
access to important data and information, breaching privacy.
iii. Computer viruses : Most criminal take advantage of viruses to gain
unauthorized access to systems and steal important data.
iv. Spamming : It uses electronic messaging systems, most commonly emails in
sending message that host malware, fake links of websites and
other malicious programs.
v. Phishing : Phishers act like a legitimate company or organization. They use
email spoofing to extract confidential information such as credit
card numbers, social security number, passwords etc.
Q27. What is cyber law?
A27. It is a generic term which refers to all the legal and regulatory aspects of internet and
world wide web.

7
Chapter-2
Network Operating System Administration(Configuration and Maintenance)
Q1. What do you mean by network operating system? Explain.
A1. An operating system that provides the connectivity among a number of autonomous
computers is called a network operating system. Network Operating System(NOS)
runs on a server and provides server the capability to manage data, users, groups,
security, applications and other network functions. Its main purpose is to allow
shared file and printer access among multiple computers in a network typically a
local area network, a private network or to other network. E.g. UNIX, LINUX,
Novell Netware
Q2. Give the functions of NOS?
A2. The functions of NOS are :
i. Provides access to remote devices i.e. printers etc.
ii. Enabling and managing access to files on a remote systems and granting
access to users.
iii. Granting access to remote applications and resources such as internet.
iv. Monitoring the system and security so as to provide security against viruses,
hackers etc.
Q3. What do you mean by maintenance? Explain.
A3. Maintenance is a regular and systematic inspection, cleaning and replacement of
worn parts, materials and systems. Preventive maintenance helps to prevent the
failure of parts , material and systems by ensuring that they are in good working
order.
Q4. Give five elements of maintenance and management of network?
A4. There are five major elements to the maintenance and management of a network.
They are :
i. Fault management.
ii. Configuration management.
iii. Performance management.
iv. Security management.
v. Accounting management.
Q5. What is network security?
A5. Network security is the process of taking preventative measures to protect the
underlying networking infrastructure from unauthourised access, misuse,
malfunction, modification, destruction or improper disclosure. It involves the
authorization of access to data in a network, which is controlled by the network
security administrator/specialist.
Q6. Give the responsibilities of network security specialist?
A6. The responsibilities for network security specialist are as follows :
i. Analyze IT specifications to assess security risks.
ii. Design and implement safety measures and data recovery plans.
iii. Install, configure and upgrade security software.
iv. Secure networks through firewalls, password protection and other systems.
v. Inspect hardware for vulnerable points of access.
vi. Monitor network activity to identify issues early and communication them to
IT teams.
vii. Act on privacy breaches and malware threats.
viii. Serve as a security expert and conduct trainings when needed.
ix. Draft policies and guidelines.
8
Q7. What are the various career opportunities for network specialist?
A7. The various career opportunities for network specialist are as follows :
i. Network technician.
ii. System Engineer
iii. System Architect
iv. Network Engineer
v. Field Engineer
vi. Network Security Manager
vii. Network Analyst
Q8. What is Window NT? Give its advantages and disadvantages?
A8. Windows NT is a 32-bit network operating system developed by Microsoft for users
and businesses needing advanced capability. Windows NT have two products :
Microsoft NT Workstation and Microsoft NT Server. The characteristics of Windows
NT are :-
It is multitasking system, it is multi-user system, it supports numerous network
features and security.
The advantages of Windows NT are :-
i. More pleasing to the eye.
ii. Low system requirements.
iii. Runs well on old machines if all patches are installed.
iv. Faster to operate.
v. Easier to install.
vi. Security .
The disadvantages of Windows NT are :-
i. More easy to catch viruses and malware.
ii. Crashes if patches are not installed.

Q9. What is the difference between linux and windows operating system? Explain.
A9. The difference between linux and windows are as follows :
LINUX WINDOWS
1 Linux is an open source operating Windows does not provide the users
system(OS) access to the programming code that
forms the basis for foundation of this OS
2. No licensing is used to use linux software. The user should have license to use this
software.
3. It is available free of cost. The users has to pay for this software.
4. Users can install an application without Internet connection is needed to install
using internet support. application in windows.
5. Linux is much more secured as compared to Windows continues to be the most
windows. vulnerable to viruses, malware and other
attacks and is less secure.
6. It can be installed on a wide variety of Windows can be installed on PC‟s,
computer hardware, ranging from mobiles desktops, laptops, servers and some phones.
phones, tablet computers and video game
consoles, to mainframes and
supercomputers.

9
Q10. What is Linux Firewall?
A10. Firewall is a network security system that filters and controls the traffic on a
predetermined set of rules. This is an intermediary system between the device and the
internet.
A network firewall protects your computer from attacks or intrusions from malicious
crackers in the network. A properly configured firewall can increase the security of
computer.
Q11. Name five types of firewall?
A11. The five types of firewall are as follows :
i. Packet filtering firewall.
ii. Circuit Level Gateway.
iii. Stateful inspection firewall.
iv. Application Level Gateway.
v. Next Generation Firewall.
Q12. What is Logical Volume Manager(LVM)?
A12. LVM stands for Logical Volume Management. It is a system of managing logical
volumes or file systems that is much more advanced and flexible than the traditional
method of partitioning a disk into one or more segments and formatting that partition
with a file system. There are three concepts that LVM manages :
i. Volume Groups : is used for changing what abstracted set of physical
partitions are presented to your operation in logical volumes.
ii. Physical Volumes : used for adding or removing hard drives in volume
group.
iii. Logical Volumes : It will present the volume groups as partitions so that
operating system can use the designated space.
Q13. What is a SWAP Space? Explain.
A13. It is used when the amount of physical memory(RAM) is full. If the system needs
more memory resources and the RAM is full, inactive pages are moved to the swap
space. While swap space can help machines with a small amount of RAM, it should
not be considered a replacement for more RAM. It is located on hard drives which
have a slower access time than physical memory.
Q14. What is mount point in linux?
A14. Mount is to access a filesystem in Linux. In Red Hat Linux each partition is used to
form part of the storage necessary to support a single set of files and directories. This
is done by associating a partition with a directory through a process known as
mounting. Mounting a partition makes its storage available starting at the specified
directory known as a mount point.
Q15. What do you mean by shell scripting? Explain.
A15. Shell is a program that acts as an interface between the user and the Linux kernel.
The shell is a command line interpreter. Whenever we enter a command it is
interpreted by the Linux shell. A shell script is file that contains ASCII text. Shell
script is series of command written in plain text file.
Q16. Why do we need shell scripts?
A16. There are many reasons to write shell scripts :
i. To avoid repetitive work and automation.
ii. System admins use shell scripting for routine backups.
iii. System monitoring.
iv. Adding new functionality to the shell etc.
10
Q17. Give advantages of shell scripts?
A17. The advantages of shell scripts are :
i. The command and syntax are exactly the same as those directly entered in
command line, so programmer do not need to switch to entirely different
syntax.
ii. Writing shell scripts are much quicker.
iii. Quick start.
iv. Interactive debugging etc.
Q18. Give disadvantages of shell scripts?
A18. Various disadvantages of shell scripting are :
i. Prone to costly errors, a single mistake can change the command which might
be harmful.
ii. Slow execution speed.
iii. Design flaws within the language syntax or implementation.
iv. Not well suited for large and complex task.
Q19. What do you mean by Red Hat Linux? Explain.
A19. It is the enterprise grade version of Red Hat‟s open source Linux operating system
distribution. It can be deployed on both servers and desktops.
Q20. What are responsibilities of network security specialist?
A20. A network security specialist is a kind of computer administrator that specializes in
protecting a company‟s data and other information. Network security specialists build
firewall, install antivirus software on servers and computers within a network and monitor
network for breaches in security. A Network security specialist often provides training to
general staff regarding security issues and he may develop policies that govern how
employees can access company information using a smartphone, laptop or home computer.
Q21. What do you mean by linux firewall? What are three levels of security provided
by linux firewall?
A21. A network firewall protects your computer from attacks or intrusions from malicious
crackers in the network. A firewall exists between your computer and the internet. A
properly configured firewall can increase the security of computer. There are three
different levels of security :
i. Highly secure firewall : it is suitable for those who are quite concerned about
their security. Here all incoming network connections are disallowed unless
specifically listed in the services list on the screen.
ii. Medium grade secure firewall : this is default level of security and is
generally adequate while using the internet.
iii. No firewall : It allows any outside individuals to access network resources on
your computer.
Q22. What is the purpose of root user in Linux? Explain.
A22. To perform system administration operations we must have access rights such as the correct
password that enable to log in as root user, making us the superuser. Because the superuser
i.e. root user have the power to change almost anything on the system. With the correct
password, we can log in to the system as a system administrator and configure the system in
different ways.
Q23. What are the command for adding and deleting a user in Linux?
A23. Adduser allows to add a single user to the system. All the parameters must be specified on
the command line. The syntax is :sudoadduser username
The command to delete a user is deluserl. With the – r option, the user‟s home directory will
also be removed. The syntax is :sudodeluser username

11
Chapter-3
Desktop Publishing(Advanced)

Q1. Write a note on Corel Draw?


A1. Corel Draw is a vector based drawing program that makes it easy to create creative artwork
from simple logos to technical illustrations. Corel Draw is a graphic design application that
gives designers and enjoyable work experience and helps to create accurate and creative
vector illustrations and professional page layouts.
Q2. Write a note on bitmap image and Vector image?
A2. Bitmap image : They are made up of tiny dots on the computer screen. These dots are
called pixels. Bitmaps are made up of rows and columns of pixels that
come together to form a picture.
Vector Image : They are made up of many geometric objects. Each of these objects
can be defined by mathematical statements and has individual
properties assigned to it such as color, fill and outline.
Q3. Give examples of bitmap file format?
A3. Some examples of bitmap file format are :

S. No. Name File Extension


1 TIFF(Tagged Image File .tif, .tiff
Format)
2 JPEG(Joint Picture Expert .jpg , .jpeg
Group)
3 PSD(Photoshop Document) .psd
4 GIF(Graphics Interchange .gif
Format)
5 PNG(Portable Network .png
Graphics)

Q4. Give examples of vector file format?


A4. Some examples of vector file format are :
S. No. Name File Extension
1 EPS(Encapsulated PostScript) .eps
2 AI(Adobe Illustrator) .ai
3 CDR(CorelDraw) .cdr
4 SVG(Scalable Vector .svg
Graphics)
5 PDF(Portable Document .pdf
Format)

Q5. Give difference between bitmap graphics and vector images?


A5. The difference are as follows :
Bitmap Vector
1. Made of pixels. Made of mathematical calculations that
form objects and lines.
2. Represents and edits photo and photo- Can be scaled to any size without losing
like elements better than vector programs quality.
with the use of continuous tones. The use
of different color pixels allows for
smooth blends of colors.
3. Resolution dependent. Enlarging a image Resolution independent. Can be printed
will result in loss of quality of image. at any size/resolution.
4. Cannot be easily converted to vector. Can be easily converted to bitmap.
12
.
Q6. Give various components of CorelDraw window?
A6. The various components are : Menu Bar, Property Bar, Toolbar, Title Bar, Rulers,
Toolbox, Drawing Window, Drawing Page, Color Palette, Docker, Status Bar,
Document Navigator, Navigator.
Q7. Give various tools in CorelDraw?
A7. The various tools used in CorelDraw are :
i. Pick Tool : used to select, resize and rotate toward the image object.
ii. Shape Tool(F10) : is used in editing an image object shape or text character
by manipulating nodes.
iii. Smooth Tool : It smooths object by dragging along its outline.
iv. Crop tool : Remove the areas outside a selection.
v. Eraser Tool(X) : It removes unwanted areas in a drawing.
vi. Zoom Tool(Z) : Change the magnification level of the document window.
vii. Pan Tool(H) : Drag hidden areas of a drawing into view without
changing the zoom level.
viii. Freehand Tool(F5) : Draw curves and straight line segments.
ix. Pen Tool : It draws curves in segments and preview each segment as
you draw.
x. Smart Drawing Tool(Shift + s) : Convert freehand strokes to basic shapes or
smoothed curves.
xi. Rectangle Tool(F6) : It draws squares and rectangles by dragging in the
drawing window.
xii. Ellipse Tool(F7) : It draws circles and ellipses by dragging in the drawing
window.
xiii. Polygon Tool(Y) : It draws polygons by dragging in the drawing window.
xiv. Star Tool : It draw uniform, outlined stars.
xv. Basic Shapes Tool : It draws triangles, circles, cylinders, hearts and other
shapes.
xvi. Arrow Shape Tool : Draw arrows of various shapes and directions.
xvii. Flowchart Shapes Tool : Draw flowchart symbols.
xviii. Text Tool(F8) : Add an edit paragraph and artistic text.
xix. Table Tool : Draw, select and edit tables.
xx. Drop Shadow Tool : It apply shadows behind or below objects.
xxi. Color Eyedropper Tool : Sample colors and apply them to objects.
xxii. Horizontal or Vertical Dimension Tool : Draw horizontal or vertical
dimension lines.

Q8. Explain the importance of tool box in Corel Draw ?


A8. The toolbox contains various tools you can use to select objects, edit objective draw
shapes, add and edit text, navigate around the page, and perform a variety of other
tasks. It contains a range of tools that can be used for specific drawing and editing
tasks. Some tool let you draw shapes, and other tools let you apply colors, patterns or
other types of fills to object.
Q9. What is vector based drawing ?
A9. Vector based drawing refers to a program where images are mathematically
expressed. For example a circle is expressed with equation : X2 + Y2 = R2
If we resize the image of the circle the mathematical expression is recalculate
resulting in a more accurate and appropriate image.

13
Q10. Explain the following : (i) Pixel (ii) PPI
A10. Pixel : It is a single square on a computer screen. Depending upon your screen
resolution your screen probably has hundreds of thousands of pixels. E.g. the most
common screen resolution currently is 1074 x 768 which comes out to 786,432
pixels.
PPI : It stands for Pixels Per Inch, the standard unit of measurement for computer
graphics(sometimes known as dpi or dots per inch)

Q11. How can you enter text in Corel Draw? Explain.


A11. Corel Draw lets you create two type of text:
i. Paragraph text is contained within a text frame. It is used for larger blocks of
text.
ii. Artistic text is not contained within a text frame and you can add special
effects such as contouring and drop shadows. Artistic text is ideal for logos,
banners and headlines.
You can create both paragraph and artistic text by using the Text tool. The steps in
adding text are as follows :
i. Click the Text Tool
ii. To add artistic text click anywhere on the page and then start typing.
iii. To add paragraph text click and drag. A frame appears and type in it.
iv. To add paragraph text to the inside of an object position the pointer at the
inside border of the object and then when the pointer changes to an insert
cursor begin typing.
Q12. How can you create a drawing in corel draw? Explain
A12. In Coreldraw we can create a drawing in two ways :
i. By using a blank page
ii. By template
When you create a drawing using New Option a blank drawing page appears. When
you use a template, a Drawing page with pre-designed elements and placeholders
appears. The steps are as follows :-
i. Click on All Program  Corel Draw Graphics Suite  Corel Draw
ii. Corel Draw opening dialog window appears.
iii. Click on New option to open a new drawing. You can also press CTRL + N or
click the New button on the standard toolbar to create a new drawing.
Q13. Write steps in starting Corel Draw?
A13. When you open Corel Draw the application window opens containing a drawing
window. The Corel Draw interface consists of several components including the
drawing window, drawing page, toolbox and toolbar. The steps to start Corel Draw
are as follows :-
i. Click on All Program  Corel Draw Graphics Suite  Corel Draw
ii. Corel Draw opening dialog window appears.
iii. Click on New option to open a new drawing and open option to open an
already existing drawing.
iv. Corel draw application window will appear on the screen. The window
consists of several components that you will use to create works of art.

14
Q14. What do you mean by view modes? Explain.
A14. A feature by which we can view a drawing. Corel Draw provides six modes to view a
drawing. They are as follows :-
i. Simple Wireframe mode displays the outlines of the object in the drawing in
monochrome but hides the fills, contours and blends.
ii. Wireframe mode displays the outlines, contours and blends of the objects in
the drawing in monochrome but hides the fills.
iii. Draft mode displays the drawing in low resolution and displays texture and
pattern fills in grayscale.
iv. Normal mode displays the drawing in high resolution with smooth edges.
v. Enhanced mode displays the drawing in high resolution with smooth edges.
vi. Enhanced with overprints mode displays the drawing in high resolution with
smooth edges and also shows how colors will appear if you are overprinting
objects.

Q15. How can you save a drawing in Corel Draw? Explain.


A15. After creating the drawing you can save the drawing. The steps are as follows :
i. Click File  Save AS option(CTRL + SHIFT + S). Save drawing dialog box
appears.
ii. In the File name box, type the filename for the drawing. The default extension
for files created in Corel Draw is .cdr
iii. Click Save.
Q16. How can you draw shapes in corel draw? Explain.
A16. The steps in creating a rectangle are as follows :
i. Click the Rectangle tool in the toolbox.
ii. Click anywhere in the drawing area and drag the mouse pointer.
iii. Release the mouse button where you like the end of the rectangle, Rectangle
will be drawn on the drawing area.
iv. Similarly use Ellipse tool to draw circles and ellipses, Polygon to draw
polygons, Arrow shapes to draw, direction arrows and arrowheads etc.
v. The drawn shape has selection handles around it. These handles can be used to
scale shapes horizontally, vertically or both.
Q17. How can you select objects in corel draw? Explain.
A.17 Pick tool is used for selecting objects. The steps in using pick tool are as follows :-
i. To select an object, click it.
ii. To select multiple objects hold down Shift and clickeach object or drag to
form a marquee around the objects.
iii. To select all objects double-click the Pick tool.
Q18. How can you group objects in Corel Draw? Explain.
A18. The steps in creating grouping are as follows :-
i. Select the objects using Pick tool. To select multiple objects hold down shift
key while selecting them.
ii. Click the group command in the arrange menu. The selected objects will be
grouped as a single object.
iii. Move all the objects together.

15
Q19. How can you lock and unlock objects? Explain.
A19. The steps to lock objects are as follows :-
i. Select the object or group of objects using Pick Tool.
ii. Click Arrange  Lock Object Option
iii. The selected object will be locked.
The steps to unlock the object are as follows :-
i. Select the locked objects using Pick Tool.
ii. Click Arrange UNLock Object Option
iii. The locked object will be unlocked.
Q20. How can you import files from Corel Draw?
A20. The steps to import files in Corel Draw are as follows :-
i. Click File  Import
ii. Choose the folder where the file is stored.
iii. Choose a file format from the files of type list box.
iv. Click the filename.
v. Click import and do one of the following :-
Click the drawing page to maintain original file and position top-left corner
where you click.
Click and drag on the drawing page to resize the file.

Q21. How can you export file from Corel Draw?


A21. The steps are as follows :-
i. Click File  Export
ii. Choose the folder where you want to save the file.
iii. Choose the file format from the Save as type list box.

iv. Type a filename in the File name list box.

v. Click options and enable any of the following active check box :
Export this page only.
Selected only.
Do not show filter dialog.
vi. Click Export.
**************************************************************************

16
Chapter-6(Elementary Server Side Scripting Using PHP

Q1. What is the difference between HTML and XHTML? Explain.


A1. The difference between HTML and XHTML are as follows :-
S.No HTML XHTML
1. All the content can be put under All the content has to be put in
body element. blocks under body element.
2. An application of SGML An application of XML.
3. Attributes have quotes as optional Attributes have quotes mandatory
e.g. <font color = #ff0000> e.g. <font color =”#ff0000”>
4. Attributes values not significant Attributes values are important
e.g. <input type =”checkbox” e.g. <input type =”checkbox”
checked> checked =”checked”
5. Can have empty/open tags e.g. All the unclosed tags must be
<br>, <p> closed e.g. <br/>, <p></p>
Q2. What do you mean by XHTML? Explain.
A2. XHTML stands for Extensible Hyper Text Markup Language. It was developed by
World Wide Web Consortium to help web developers make the transition from
HTML to XML. XHTML documents need to be well formed, the website will be
compatible with present and future web browsers and rendered more accurately. It
also makes website easier to maintain, convert and format in the long run.
Q3. What do you mean by CSS? Explain.
A3. CSS stands for Cascading Style Sheets. It is the language for describing the
presentation of web pages, including colors, layout and fonts. It is a stylesheet
language that describes the presentation of an HTML(or XML) document. It
describes how elements must be rendered on screen, on paper, or in other media. It
allows one to adapt the presentation to different types of devices such as large
screens, small screens or printers.
Q4. What is the purpose of dreamweaver? Explain.
A4. It is a software application that allows you to create and edit HTML and XHTML
documents(web pages). Dreamweaver is considered WYSIWYG(What You See Is
What You Get) meaning that when you format your webpage, you see the results of
the formatting instead of the mark-ups that are used for formatting. Dreamweaver
create HTML code that controls everything about how the page looks and acts.
Q5. What do you mean by PHP? Explain.
A5. PHP stands for Hypertext Preprocessor. It is a server-side programming language
for the web. It is a programming language that allows web developer to create
dynamic content that interacts with database. It is basically used for developing web
based software applications. It is an interpreted language i.e. there is no need for
compilation.
Q6. Give features of PHP?
A6. The features of PHP are as follows :
i. It is an open source software.
ii. It costs nothing, it is free to download.
iii. It is a server-side scripting language and is used for website and web applications.
iv. PHP scripts are executed on the server.
v. It supports a wide range of databases.
vi. It runs on various like Linux, Windows, Unix etc.

17
Q7. What are the advantages of PHP? Explain.
A7. The advantages of PHP are as follows :
i. It is fast.
ii. It is open source software.
iii. It is easy to use.
iv. It can run on many operating systems.
v. Technical supports is widely available.
vi. It is designed to support databases.
vii. It is customizable
Q8. What do you mean by WAMP server? Explain.
A8. WAMP stands for “Windows , Apache, MySQL and PHP”. It is often used for web
development and internal testing but may also be used to serve live websites. WAMP
includes PHP and MySQL, which are two of the most common technologies used for
creating dynamic websites. MySQL is a high-speed database, while PHP is a
scripting language that can be used to access data from the database. By installing
these two components locally, a developer can build and test a dynamic website
before publishing it to a public web server. The most important part of the WAMP is
Apache which is used to run the web server within Windows. By running a local
Apache web server on a Windows machine, a web developer can test web pages in a
web browser without publishing them live on internet.
Q9. What is the syntax of PHP script? Explain.
A9. A PHP script starts with
<?php and ends with ?>.
Its syntax is :
<?php
// PHP Code
?>
The default file extension for PHP file is “.php”. A PHP file normally contains
HTML tags and some PHP scripting code.
Q10. What is the purpose of print and echo command? Explain.
A10. The print() statement is used to display the data. The syntax is as follows :
Intprint(argument)
Echo() statement have the same purpose as print() statement. It is used to print the
data. The syntax is :
Echo(string argument1 [, …string argument])
Q11. What is the purpose of comments in PHP? Explain.
A11. A comment is a non executable statement that helps to read and understand a
program. Comments may appear anywhere in the program. PHP has two types of
comments :
i. Single-line comments : It starts with double slash symbol(//) and terminates
at the end of current line. E.g.
// My first web page.
ii. Multiline comment : It begins with /* and ends with */
e.g
/* My first
Web Page. */

18
Q12. What do you mean by variables?
A12. A variable is a name associated with value. A variable stores or contains the value.
Variables allow you to store and manipulate data in program. It can hold any value
during the execution of the program. It‟s value can be changed during program
execution.
Q13. What are the rules for declaring variable names?
A13. The rule for declaring variables names are as follows :
i. A variable starts with $ sign, followed by the name of the variable.
ii. A variable name must start with a letter or the underscore character.
iii. A variable name cannot start with a number.
iv. Variable names can be any length.
v. Variable names can include letters, numbers and underscores only.
vi. Variable names are case-sensitive e.g. $name and $NAME are two different
variable.
Q14. What do you mean by scope of variables? Explain.
A14. The scope of a variable is the region of program in which it is defined. PHP has three
different variable scopes :
i. Local : A variable which is declared inside function is called local variable. It is
accessible within the function only.
ii. Global : It is a variable relevant throughout the entire program. A variable
declared outside the function or declared with window object is known as global
variable.
iii. Static : When a function is completed/executed, all of its variable are deleted.
However sometimes we want a local variable NOT to be deleted. We need it for a
further job. To do this use the static keyword when you first declare the variable.
Q15. What do you mean by data types?
A15. Values stored in a variable or a constant are stored as a specific type of data. PHP
provides different data types to hold different types of values.
Q16. What are various data types in PHP? Explain.
A16. The various data types in PHP are as follows :
i. Integers : Whole numbers, without a decimal point e.g. 24 , 73 , -33 etc.
ii. Floating point number : A numeric value with decimal digits e.g 7.35
iii. String : A series of characters e.g. “All is well”
iv. Boolean : A value that can be either true or false.
v. Array : A group of values in one variable.
vi. Object : A structure created with a class.
vii. Resource : A reference that identifies a connection.
viii. NULL : A special type that only has one value NULL
Q17. What is the purpose of if statement? Explain.
A17. The if statement is used to execute one or more lines of code based on a condition.
This statement executes one block of statements if the condition is True. The syntax
is :
If(condition)
{
Code to be executed
}

19
Q18. What is the purpose of switch statement? Explain.
A18. It is a multi way branching statement. This statement causes a particular group of
statements to be chosen from several available groups. The selection is based on the
current value of expression that is included within switch statement. The interpreter
checks each case against the value of the expression until a match is found. If nothing
matches a default will be used. The syntax is :
Switch(n)
{
Case label1:
Code to be executed;
Break;
Case label2:
Code to be executed;
Break:
………..
………..
Default:
Code to be executed;
}
Q19. What is the purpose of FOR statement? Explain.
A19. The for loop is a block of statements that is used to carry out a looping operation i.e.
to execute a sequence of statements fixed number of times. A PHP for loop exectes a
block of statements until a specified condition is true. The syntax is :
For(init counter; test counter; increment/decrement counter)
{
Code to be executed;
}
Where :
Initcounter : initialize the loop counter value.
Test counter : evaluated for each loop iteration. If it evaluates to TRUE, the
loop continues. If it evaluates to FALSE, the loop ends.
Increment/decrement counter : Increases/decreases the loop counter value.
Q20. What do you mean by functions? Explain.
A20. A function is a block of code. Functions can be built-in or user defined. They can require
information to be passed to them and usually return a value. A function is a self contained
block of statements that perform a specific task. A function accepts values from user,
processes them and then perform an action or returns a new value, possibly both. Using
function it is possible to reduce the size of program by calling and using them at different
places in a program.
Q21. Give advantages of using functions?
A21. Various advantages of using functions are as follows :
i. Easy to write a correct and small function.
ii. Easy to read, write and debug a function.
iii. Easier to maintain or modify such a function
iv. Small functions tend to be self documenting and highly readable.
v. It can be called any number of times in any place with different parameters.
vi. Reducing duplication of code.
vii. Decomposing complex problems into simpler pieces.
viii. Improving clarity of the code.
ix. Reuse of code.
x. Information hiding.
20
Q22. What do you mean by array? Explain.
A22. An array is a collection of identical data objects which are stored in consecutive
memory locations under a common heading or variable name. Arrays are complex
variables that stores multiple or a group of values under a single variable name. It is a
special variable which can hold more than one value at a time. There are three types
of arrays in PHP :
i. Indexed array : An array with a numeric key.
ii. Associative array : An array where each key has its own specific value.
iii. Multidimensional array : An array containing one or more arrays within
itself.
Q23. What do you mean by Get and Post methods? Explain.
A23. GET method : The form data is passed by adding it to the URL that calls the
form processing program. The GET method sends the encoded user information
appended to the page request. The GET method is restricted to send upto 1024
characters only. The advantages of this method are simplicity and speed.
The disadvantages are that less data can be passed and that the information is
displayed in the browser, which can be a security problem in some situations.
POST method : The form data is passed as a package in a separate
communication with the processing program. The POST method transfers
information via HTTP headers. The information is encoded as described in case of
GET method and put into a header called QUERY_STRING.
The advantages of this method are unlimited information passing and security of the
data.
The disadvantages of this method are the additional overhead and slower speed.
Q24. What do you mean by session variables? Explain.
A24. A session is the time that a user spends at web site. When work with an application
you open it, do some changes and then you close it. This is much like session. Users
can view many web pages between the time they enter the site and leave it. PHP
enables you to set up a session on one web page and save variables as session
variables.

Q25. Give difference between programming language and scripting language?


A25. The difference is :
Programming language Scripting language
It has all the features needed to develop Mostly used for routine tasks.
complete applications.
The code has to be compiled before it can The code is usually executed without
be executed compiling.
Does not need to be embedded into other Is usually embedded into other software
languages. environment.

21
Q26. What do you mean by operators? Give various operators used in PHP.
A26. Operators are used to perform operations on variables and values. PHP divides the
operators in the following groups :
i. Arithmetic operators : These operators are used with numeric values to perform
common arithmetical operations such as addition, subtraction, multiplication,
division etc.
ii. Assignment operator : These are used with numeric values to write a value to a
variable. e.g $ x=10 , $x + = $ y , $ x % = $y etc.
iii. Comparison operators : These are used to compare two values (number or string)
e.g. $x > 10 , $x <= 30 etc
iv. Increment/Decrement operator : The increment operator is used to
increment a variable value e.g. ++ $x
Decrement operator is used to decrement the value of variable e.g - - $x
v. Logical operators : These are used to combine conditional statements.
e.g AND , OR , NOT , XOR
vi. String operator : these are used specially designed for strings e.g concatenation
vii. Array operators : these are used to compare arrays.

Q27. Write a note on while loop in php?


A27. The while loop executes a block of code as long as the specified condition is true.
Syntax is :
while (condition )
{
statement to be executed;
}

Q28. Write a note on do-while loop in php?


A27. The do..while loop will always execute a block of code once, it will then check the
condition and repeat the loop while the specified condition is true.
Syntax is :
do
{
statement to be executed;
} while (condition );

22
Practicals Q/A
PHP

Q1. Example of external style?


A1.
<html>
<head>
<style>
body
{
background-color:lightblue;
}
h1
{
color:red;
text-align:center;
}
P
{
font-family:”Times New Roman”;
font-size:20px;
}
</style>
</head>
<body>
<h1> CSS Example</h1>
<p> HPBOSE </p>
</body>
</html>

To see the output :


i. Write this code in html file(notepad).
ii. Save this file with html extension.
iii. Run this file browser and get the output.
Q2. Write a program to create a php file?
A2. Open notepad and create the phpfile :
<html>
<head>
<title> PHP Script</title>
</head>
<body bgcolor=”green”>
<?php echo “Hello and Welcome to My Php Page”;
?>
</body>
</html>

23
Q3. Write a program in php to find sum of two variables:
A3. <html>
<head>
<title> PHP Script</title>
</head>
<body>
<?php
$x=15;
$y=41;
echo $x + $y;
?>
</body>
</html>
Q4. Write a program to demonstrate a local scope variable?
A4. <html>
<head>
<title> Local Scope variable
</title>
</head>
<body>
<?php
Function mytest()
{
$x=5; // local scope
Echo “<p>Variable x inside function is : $x</p>”;
}
Mytest();
//using x outside the function will generate an error
Echo “<p> Variable x outside function is : $x</p>”;
?>
</body></html>
Q5. Write a program to demonstrate a global keyword before the variable(inside the function)?
A5.
<html>
<head>
<title> Global Scope variable
</title>
</head>
<body>
<?php
functionmytest()
{
Global $x, $y;
$y=$x + $y;
}
mytest();
Echo $y:// outputs 15
?>
</body></html>
24
Q6. Write a program to demonstrate the static keyword?
A6.
<html>
<head>
<title> Static Scope variable
</title>
</head>
<body>
<?php
functionmytest()
{
Static $x=0;
Echo $x;
$x++;
}
Mytest();
Mytest();
Mytest();
?>
</body>
</html>
Q7. Write a program to demonstrate if statement?
A7. <html>
<head>
<title>If statement
</title>
</head>
<body>
<?php
$t=date(“H”);
if($t<”20”)
{
Echo “Have a good day!”;
}
?>
</body>
</html>

25
Q8. Write a program to demonstrate if else statement?
A8.
<html>
<head>
<title> If else statement
</title>
</head>
<body>
<?php
$t=date(“H”);
If($t<”20”)
{
Echo “Have a good day!”;
}
else
{
Echo “Have a good night!”;
}
?>
</body></html>
Q9. Write a program to demonstrate if elseif statement?
A9. <html>
<head>
<title> If elseif statement
</title>
</head>
<body>
<?php
$t=date(“H”);
If($t<”10”)
{
Echo “Have a good morning!”;
}
Elsif($t<”20”)
{
Echo “Have a good day!”;
}
Else
{
Echo “Have a good night!”;
}
?>
</body></html>

26
Q10. Write a program to demonstrate switch statement?
A10.
<html>
<head>
<title> Switch statement
</title>
</head>
<body>
<?php
$fcolor=”red”;
switch($fcolor)
{
case “red”:
Echo “Your favorite color is red!”;
Break;
case “blue”:
echo “Your favorite color is blue!”;
break;
case “green”:
echo “Your favorite color is green!”;
break;
default :
echo “Your favorite color is neither red, blue nor green!”;
}
?>
</body></html>

27
Q11. Write a program to find the greatest number among three number?
A11.
<html>
<head>
<title> Greatest among three numbers
</title>
</head>
<body>
<?php
$a=20;
$b=10;
$c=30;
If($a>$b)
{
If($a>$c)
{
Echo “Greatest number is = “,$a;
}
Else
{
Echo “greatest number is = “,$c;
}
Else
{
If($b>$c)
{
Echo “greatest number is = “, $b;
}
Else
{
Echo “greatest number is = “, $c;
}
}
?>
</body></html>
Q12. Write a program to find whether given year is a leap year or not leap year?
A12.
<html><head>
<title> Leap Year </title></head><body>
<?php
$y=2000;
If($y%4==0 || $y%100!=0 || $y%400==0)
{
Echo $y. “is a leap year”;
}
Else
Echo $y. “ is not a leap year”;
?>
</body></html>
28
Q13. Write a program to find the day fall on a given date of a month. It is given that
month start with Monday.
A13.
<html>
<head>
<title></title></head>
<body>
<?php
$d=14;
$r=$d%7;
Switch($r)
{
Case 1:
Echo “on date “.$d. “ of this month is Monday”;
Break:
Case 1:
Echo “on date “.$d. “ of this month is Monday”;
Break:
Case 2:
Echo “on date “.$d. “ of this month is Tuesday”;
Break:
Case 3:
Echo “on date “.$d. “ of this month is Wednesday”;
Break:
Case 4:
Echo “on date “.$d. “ of this month is Thrusday”;
Break:
Case 5:
Echo “on date “.$d. “ of this month is Friday”;
Break:
Case 6:
Echo “on date “.$d. “ of this month is Saturday”;
Break:
default:
Echo “on date “.$d. “ of this month is Sunday”;
}
?>
</body></html>

29
Q14. Write a program to demonstrate while loop?
A14.
<html>
<head>
<title></title></head>
<body>
<?php
$x=1;
While($x<=5)
{
Echo “The number is : $x <br>”;
$x++;
}
?>
</body></html>

Q15. Write a program to demonstrate do while loop?


A15.
<html>
<head>
<title></title></head>
<body>
<?php
$x=1;
Do
{
Echo “The number is : $x <br>” ;
$x++;
}while($x<=5);
?>
</body></html>
Q16. Write a program to demonstrate for loop?
A16.
<html>
<head>
<title></title></head>
<body>
<?php
For($x=0;$x<=10;$x++)
{
Echo “The number is : $x <br>”;
}
?>
</body></html>

30
Q17. Write a program to print all the even number from 10 to 50?
A17.
<html>
<head>
<title></title></head>
<body>
<?php
Si = 10;
While($i<=50)
{
If($i%2==0)
{
Echo “<br> Even Number = “.$i;
$i=$i + 1;
}
}
?>
</body></html>
Q18. Write a program to find the factorial of a given positive number?
A18.
<html>
<head>
<title></title></head>
<body>
<?php
$n=5;
$f=1;
For($i=$n;$i>0;$i--)
{
$f=$f * $i;
}
Echo “<br>Factorial of the given number = “,$f;
?></body></html>
Q19. Write a program to find the m raise to power n?
A19.
<html>
<head>
<title></title></head>
<body>
<?php
$m=4;
$n=3;
$t=1;
For($i=1;$i<=$n;$i++)
{
$t=$t * $m;
}
Echo $m. “Raise to power “.$n. “ = “.$t;
?></body></html>
31
Q20. Write a program to demonstrate foreach loop?
A20.
<html>
<head>
<title></title></head>
<body>
<?php
$colors=array(“red”,”green”,”blue”,”yellow”);
Foreach($colors as $value)
{
Echo “$value <br>”;
}
?>
</body></html>
Q21. Write a program to demonstrate a user defined function?
A21.
<html>
<head>
<title></title></head>
<body>
<?php
Function writemsg()
{
Echo “Hello everybody!”;
}
Writemsg(); // call the function
?>
</body></html>
Q22. Write a program to demonstrate an indexed array?
A23.
<html>
<head>
<title></title></head>
<body>
<?php
<?php
$cars=array(“Maruti”,”BMW”,”Toyota”);
$arrlength=count($cars);
For($x=0;$x<$arrlength;$x++)
{
Echo $cars[$x];
Echo “<br>”;
}
?>
</body></html>

++++++++++++++++++++++++++

32
Chapter-5
RDBMS CONCEPTS AND MYSQL
Q1. What is database?
A1. Database is a collection of inter-related data i.e composed of a collection of files that
are linked in such a way that information from one of the files may be combined with
information from other files so that user may receive the exact information. E.g.
school database organizes the data about a student, teachers and admin staff etc.
which help in efficient retrieval, insertion and deletion of data from it.
Q2. Give difference between data and information?
A2. Data : It is a raw and unorganized fact that required to be processed to make it
meaningful i.e data is the collection of raw facts and figures.
Information : The data formatted in a manner that allows it to be utilized by
human beings in some significant way i.e. processed data is called information
Q3. What is DIKW?
A3. DIKW is the model used for discussion of data, information, knowledge, wisdom and
their interrelationships. It represents structure or functional relationships between
data, information, knowledge and wisdom.
Q4. Name and explain database elements?
A4. Various database elements are :
i. Table : A table is composed of records and fields that hold data. Each
table in a database holds data about a different but related subject.
ii. Records : Data is stored in records. A record is composed of fields and
contains all the data about one particular person, company or item in a
database. Records appear as rows in the database table.
iii. Fields : A field is a part of a record and contains a single piece of data
for the subject of the record. E.g. roll_no, student_name, address etc.
iv. Instance : The collection of information stored in database at a particular
instance of time is called instance of database.
v. Schema : The overall design of the database is called database schema.
Q5. What is DBMS?
A5. DBMS : It stands for Database Management System. A DBMS is a system
software for easy, efficient and reliable data processing and management. DBMS is a
collection of inter-related data and set of programs to store and access those data in
an easy and effective manner. E.g. MySQL, Oracle etc.It can be used for :
i. Creation of a database.
ii. Retrieval of information from the database.
iii. Updating the database. iv. Managing a database.
Q6. Give various task of DBMS?
A6. Various task of DBMS are as follows :
i. Data definition : It helps in creation, modification and removal of
definitions that define the organization of data in database.
ii. Data Updation : It helps in insertion, modification and deletion of the
actual data in the database.
iii. Data Retrieval : It helps in retrieve of data from the database which can be
used by applications for various purposes.
iv. Use Administration : It helps in registering and monitoring users, enforcing
data security, monitoring performance, maintaining data integrity, dealing
with concurrency control and recovering information corrupted by unexpected
failure.
33
Q7. Name various applications where we use Database Management Systems are :
A7. Application where we use DBMS are :
i. Telecom : There is a database to keep track of the information regarding
calls made, network usage, customer details etc.
ii. Industry
iii. Banking System : For storing customer info, tracking day to day credit and
debit transactions, generating bank statements etc.
iv. Sales : To store customer information, production information and
invoice details.
iv. Airlines : To travel through airlines we make early reservations this
reservation information along with flight schedule is stored in database.
v. Education sector : Database systems are frequently used in schools, colleges.
vi. Online shopping
Q8. Name and explain components of database system?
A8. A database system is composed of following components :
i. Data : Data : It is a raw and unorganized fact that required to be processed to
make it meaningful. DBMS store and utilize data. Metadata is data about data.
E.g. When you yourName in a database, the DBMS will store when the name
was stored in the database, what is the size of the name, is it stored as related
data to some other data, or is it independent, all this information is metadata.
ii. Hardware : When we say hardware we mean computer, hard disks, I/O
channels for data and any other physical component involved before any data
is successfully stored into the memory.
iii. Software : This is the main component as this is the program which
controls everything.
iv. Data base access language :- It is a simple language designed to write
commands to access, insert, update and delete data stored in any database.
v. Users : Users are those persons who read the information from the
database to carry out their primary business responsibilities i.e. personnel,
staff, clerical etc.
Q9. What do you mean by RDBMS(Relational Database Management System)
A9. RDBMS : It stands for Relational Database management System. It is a program
that allows you to create, update and administer a relational database. It refers to a
database that stores data in a structured format using rows and columns. This makes
it easy to locate and access specific values within the database. It is “relational”
because the values within each table are related to each other. Examples of RDBMS
are : MySQL, Oracle, SQL Server etc.
Q10. What is a file system?
A10. A file system is a method for sorting and organizing computer files and the data they
contain to make it easy to find and access them.
Q11. What is traditional File System?
A11. A traditional file system is totally computer based system where all the informations
is stored in different computer files.

34
Q12. Give characteristics of traditional file processing system?
A12. The characteristics of traditional file processing system are as follows :
i. it stores data of an organization in group of files.
ii. Files carrying data are independent on each other.
iii. COBOL, C, C++ programming languages were used to design the files.
iv. Each file system contains data for some specific area or department like
library, student fees, and student examinations.
v. It is less flexible and has many limitations.
vi. it is very difficult to maintain file processing system.
vii. Any change in one file affects all the files that creates burden on the
programmer.
viii. File in traditional file processing systems are called flat files.
Q13. What are problems in traditional file oriented approach?
A13. Various problems in traditional file oriented approach are as follows :-
i. Data redundancy : It refers to the duplication of data.
ii. Data inconsistency : data redundancy leads to data inconsistency. E.g.
suppose a student is enrolled for two courses and we have student address
stored twice. Now let‟s say student requests to change his address, if address
is changed at one place and not on all the records then this can lead to data
inconsistency.
iii. Data Isolation :- Because data are scattered in various files, and files may
be in different formats, writing new application programs to retrieve the
appropriate data is difficult.
iv. Dependency on application programs : Changing files would lead to change
in application programs.
v. Atomicity issues : Atomicity of a transaction refers to “All or nothing”,
which means either all the operations in a transaction executes or none.
vi. Difficult Data Access : A user should know the exact location of file to
access data so the process is very cumbersome and tedious.
vii. Unauthorized Access : File system may lead to unauthorized access to
data. If a students gets access to file having his marks, he can change it in
unauthorized way.
viii. Concurrent Access : The access of same data by multiple users at same
time is known as concurrency. File system does not allow concurrency as data
can be accessed by one only one user at a time.
ix. No Backup and Recovery : File system does not incorporate any backup and
recovery of data if a file is lost or corrupted.
x. Data security : Data should be secured from unauthorized access.
xi. Limited data Sharing : There is limited data sharing possibilities with the
traditional file system.

35
Q14. Give difference between DBMS and Traditional File System?
A14. The difference between DBMS and Traditional File System are as follows :
i. DBMS is very expensive but, the traditional file system is cheap.
ii. DBMS is good for the large system but, the traditional file system is good
for a small system having a small number of items.
iii. DBMS Required lots of effort for designing but, the traditional file system is
very low design efforts.
iv. DBMS is highly secured but, the traditional file system is not secure.
v. DBMS is data sharable but, the traditional file system is isolated data
sharable.
vi. DBMS is flexible but, the traditional file system has a lack of flexibility and
has many limitations.
vii. DBMS has no integrity issue but, the traditional file system has an integrity
problem.
viii. DBMS has a complex backup but, the traditional file system has a simple
backup system.
Q15. Give advantages of DBMS?
A15. The various advantages of DBMS are as follows :
i. Minimal Redundancy : Data redundancy is reduced or eliminated in
DBMS because all data are stored at a centralized location rather than being
created by individual users for each application.
ii. Data Inconsistency can be avoided : In DBMS there is a single repository of
data that is defined once and is accessed by many users, and data are
consistent.
iii. Searching capability : Searching and retrieving of data is very easy in
DBMS systems.
iv. Data Sharing : DBMS allows users and applications to share data with
multiple applications and users.
v. Data Security : DBMS provide a strong framework to protect data
privacy and security.
vi. Flexibility : Database systems are more flexible than file processing systems.
vii. Data Integration : It is a process of combining the data residing at different
locations and present the user with a unified view of data.
viii. Easy access to data : A database system manages data in such a way so
that the data is easily accessible with fast response times.
ix. Concurrent access to data : Data can be accessed concurrently
by different users at same time in DBMS.
x. Data backup and recovery : DBMS provides a strong framework for
data backup and recovery.
xi. Improved decision making : Better managed data and improved data
access make it possible to generate better quality information on which better
decisions are based.

36
Q16. Give disadvantages of DBMS?
A16. The various disadvantages of DBMS are as follows :
i. DBMS requires high initial investment for hardware, software and trained staff.
ii. In order to convert our data into a database management system we need to spend a
lot which adds on to the cost of the database management system.
iii. In order to work with a Database management system a team of technical staff is
required who understand DBMS.
iv. A DBMS requires disk storage for the data and sometimes you need to purchase
extra space to store your data.
v. Database systems are complex to understand.
vi. DBMS does not give a good performance as its speed is very slow.
vii. Backup and recovery are more difficulty.
Q17. What is data abstraction?
A17. The process of hiding irrelevant details from user is called data abstraction.
Q18. Give the three types of data abstraction?
A18. The three types of data abstraction are :
i. Internal or Physical level : Actual physical storage structure and access
paths. It is physical representation of the database on the computer. This level
describes how the data is actually stored in the storage device. E.g.let‟s say we
are storing student information in a student table. At physical level these
records can be described as blocks of storage(bytes, gigabytes etc.) in
memory.
ii. Conceptual or Logical Level : Structure And constraints for the entire
database. The whole design of the database such as relationship among data,
schema of data etc are described in this level. At the logical level records can
be described as fields and attributes along their data types, their relationship
among each other.
iii. External or view level : Describes various user views. At view level, user
just interact with system with help of GUI and enter the details at the screen,
they are not aware of how the data is stored and what the data is stored, such
details are hidden from them.
Q19. Name three types of users for a DBMS?
A19. The three types of users for a DBMS are :
i. The Application Programmer : These users write application programs to
interact with the database.
ii. The End User : End users are the users, who use the applications
developed. End users are of two types :
a. Direct user : They are the users who see the computer, database
system directly, by following instructions provided in the user interface.
b. Indirect users : They are the users just concerned with the output and are
not bothered about the programming part.
iii. System Analyst : System Analyst determines the requirement of end users,
database designing, feasibility, economic, technical aspect of the system.
Q20. What do you mean by DBA?
A20. DBA : It stands for Database Administrator. DBA is the person which makes the
strategic and policy decisions regarding the data of the enterprise, and who provides
the necessary technical support for implementing these decisions. DBA is
responsible for designing, implementing and maintaining database, use of database
management system and training employees in database management etc.
37
Q21. What is the role of DBA?
A21. The role of the DBA is very important and is defined by the following functions :
i. Schema definition : The DBA defines the logical schema of the database.
According to this schema, database will be developed to store required data
for an organization.
ii. Storage structure and access method definition : The DBA decides how
the data is to be represented in the stored database.
iii. Assisting application programmers : The DBA provides assistance to
application programmers to develop application programs.
iv. Physical Organization Modification : The DBA modifies the physical
organization of the database to reflect the changing needs of the organization
or to improve performance.
v. Approving Data Access : The DBA determines which user needs access to
which part of the database.
vi. Liaising with users : The DBA needs to interact continuously with the
users to understand the data in the system and its use.
vii. Monitoring Performance : The DBA monitors performance of the
system.
viii. Backup and Recovery : Database should not be lost or damaged.
Q22. Write a note on Data Dictionary?
A22. A data dictionary contains metadata i.e. data about the database. It is a dictionary
about the data that we store in the database. It contains all the information about the
data objects such as :
i. Names of all the database tables and their schemas.
ii. Details about all the tables in the database such as their owners, their
security constraints, when they were created etc.
iii. Physical information about the tables such as where they are stored and how.
iv. Table constraints such as primary key attributes, foreign key information etc.
v. Information about the views of the database.
vi. It also contains the physical information of the table like about their storage,
about their alteration etc.
Q23. Name and explain two types of data dictionary?
A23. The two types of data dictionary is :
i. Active Data Dictionary : Any changes to the database object structure via
DDLs will have to be reflected in the data dictionary. But updating the data
dictionary tables for the changes are responsibility of database in which the
data dictionary exists. If the data dictionary is created in the same database,
then the DBMS software will automatically update the data dictionary. Hence
there will not be any mismatch between the actual structure and the data
dictionary details. Such data dictionary is called active data dictionary.
ii. Passive Data Dictionary : In some of the databases, data dictionary is created
separately from the current database as entirely new database to store only
data dictionary information. Sometimes it is stored as XML, excels or in any
other file format. In such case, an effort is required to keep data dictionary in
sync with the database objects. This kind of data dictionary is called passive
data dictionary.

38
Q24. What is integrity constraints?
A24. Database integrity refers to the validity and consistency of stored data. Integrity is
usually expressed in terms of constraints, which are consistency rules that the
database is not permitted to violate. Integrity constraints are a set of rules. It is used
to maintain the quality of information. It ensure that the data insertion, updating and
other processes have to be performed in such a way that data integrity is not affected.
It is used to guard against accidental damage to the database. E.g. A blood group
must be „A‟, or „B‟ or „AB‟ or „O‟ only but cannot be of any other values

Q25. Explain types of integrity constraints?


A25. The various types of integrity constraint are :
i. Domain constraints : It means the definition of a valid set of values for
an attribute. It ensures that only a valid range of value is allowed to be stored
in a column.
ii. Entity Integrity Constraint : It states that primary key value can‟t
be null. This is because the primary key value is used to identify individual
rows in relation and if the primary key has a null value, then we can‟t identify
those rows. A table can contain a null value other than the primary key field.
iii. Referential Integrity Constraint : It is specified between two tables. In
the referential integrity constraints, if a foreign key in table1 refers to the
primary key of Table2, then every value of the foreign key in table1 must be
available in tavble2.
iv. Key Constraint : Keys are the entity set that is used to identify an entity
within its entity set uniquely. An entity set can have multiple keys, but out of
which one key will be the primary key. A primary key can contain a unique
and null value in the relational table.
Q26. What do you mean by datatypes?
A26. Datatypes are rules that define what data may be stored in a column and how that
data is actually stored. Data types are used for several reasons :
i. Datatypes enables us to restrict the type of data that can be stored in a column.
ii. Data type specifies storage efficiently and instructs show it stores data
internally in memory.
iii. Data types allow for more efficient storage.
iv. Data type allow for alternate sorting orders.

39
Q27. Name various type of data types used in DBMS?
A27. In SQL there are three main data type :
i. Numeric : Numeric data types are normally used to store numeric data like
age, marks, salary etc. Numeric datatypes are following :
a. Int : used for number without decimal
b. Decimal(m,d) : used for floating/real numbers.
Here m denotes the total length of number and d is number of decimal
digits.
ii. Date and Time :
a. Date : used to store date in YYYY-MM-DD format e.g date of birth,
purchase date etc.
b. Time : used to store time in HH:MM:SS format e.g arrival time,
departure time etc.
iii. String type : These are used to store names , addresses, descriptions or any
value that contains letters and numbers including binary data, like image or
audio files. String datatypes are following :
a. Char(n) : used to store a fixed length string.
b. Varchar(n) : used to store a variable length string. Here n denotes
maximum number of characters.

Q28. Give difference between char and varchardatatypes?


A28. The difference between char and varchardatatypes are as follows :

S. No. Char datatype Varchardatatype


1. It specifies a fixed length character It specifies a variable length
string. character string.
2. When a column is given datatype When a column is given datatype as
as CHAR(n), then MySQL ensures VARCHAR(n), then the maximum
that all values stored in that column size a value in this column can have
have this length i.e. n bytes. If a is n bytes. Each value that is stored
value is shorter than this length n in this column store exactly as you
then blanks are added, but the size specify it i.e. no blanks are added if
of value remains n bytes. the length is shorter than maximum
length n.

Q29. Write a short note on SQL?


A29. SQL stands for Structured Query Language which is a standardized language for
interacting with RDBMS(Relational Database Management System). It is a database
query language used for storing and managing data in relational DBMS.

40
Q30. Give characteristics of SQL?
A30. The various characteristics of SQL are as follows :
i. SQL is used for storing and managing data in relational database management
system(RDBMS)
ii. All the RDBMS like MySql, Oracle, MS Access and SQL server use SQL as
their standard database language.
iii. SQL allows users to query the database in a number of ways, using English-
like statements.
iv. SQL is used to perform create, retrieve, update and delete operations on
relational database.
v. It can also perform administrative tasks on database such as database security,
backup, user management etc.
vi. We can create databases and tables inside database using SQL.
vii. It is not case sensitive.
viii. Statements of SQL are dependent on text lines. We can use a single SQL
statement on one or multiple text line.
ix. Using the SQL statements, you can perform most of the actions in a database.
x. SQL depends on tuple relational calculus and relational algebra.
Q31. What are SQL commands?
A31. SQL commands are instruction, coded into SQL statement which are used to
communicate with the database to perform specific tasks, work, functions and
queries with data. SQL commands are grouped into four major categories depending
on their functionality namely Data Definition Language(DDL), Data Manipulation
Language(DML), Transaction Control Language(TCL), Data Control
Language(DCL).

Q32. Write note on DDL, DML, TCL, DCL ?


A32. DDL(Data Definition Language) : These SQL commands are used to define the
database schema. These commands are used to create, modify, drop the structure of
database objects. Examples of DDl commands are :
i. Create : It is used to create the database or its objects like table, index,
function, views, stored procedure and triggers.
ii. Drop : It is used to delete objects from the database.
iii. Alter : is used to alter or change the structure of the database.
iv. TRUNCATE : is used to remove all records from a table, including all
spaces allocated for the records are removed.
v. COMMENT : is used to add comments to the data dictionary.
vi. RENAME : is used to rename an object existing in the database.
Q33. How will you create a database?
A33. To create a database command used is CREATE DATABASE.
Syntax is :
CREATE DATABASE database_name;
Example :
CREATE DATABASE my_database;

To use the database created use the USE statement :


For example :
USE my_database;

41
Q34. How will you create a table?
A34. To create table we use CREATE TABLE statement.
Syntax is :
CREATE TABLE table_name
(
Column1 data_type(size),
Column2 data_type(size),
Column3 data_type(size),
……….
……….
);

Where table_name is the name of a table.


Column1 is the name of first column/field.
Data_type is the type of data we want to store in the particular column.
Size is the size of the data we can store in a particular column.

Example is :
CREATE TABLE student
(
ROLLNO int(3),
STUDENTNAME varchar(30),
ADDRESS varchar(30),
PHONENO int(12),
AGE int(12)
);

Q35. How will you drop a table or a whole database?


A35. To delete a database we use drop statement.
Syntax is :
DROP DATABASE database_name;
Example is :
DROP DATABASE school;

To delete a table we use drop statement.


The syntax is :
DROP TABLE student;
Q36. How will you truncate a table?
A36. To truncate a table we use TRUNCATE statement. To truncate means to delete all
the rows from the table and free the space containing the table.
Syntax is :
TRUNCATE TABLE table_name;

For example : to delete all the rows from student table, the query would be like
TRUNCATE TABLE student.

42
Q37. Write note on DML ?
A37. DML(Data Manipulation Language) : These commands are used for storing,
retrieving, modifying and deleting data.
Examples of DML are :
i. SELECT : is used to retrieve data from the database.
ii. INSERT : is used to insert data into a table.
iii. UPDATE : is used to update existing data within a table.
iv. DELETE : is used to delete records from a database table.

Q38. How will you insert records in a table?


A38. There are two ways to insert records in a table by using INSERT INTO statement
1. Only values to be inserted in a table :This method is to specify only the
values of data to be inserted without the column names.
Syntax :
INSERT INTO table_name
VALUES(value1, value2, ……….,valueN);

Where table_name : is the name of the table.


Value1, value2,…… are the values of first column, second column, and so on.
Example :
INSERT INTO
2. Specify column names and their values : In the second method we will
specify both the columns which we want to fill and their corresponding values
as shown below :
Syntax is :
INSERT INTO table_name
[(column1, column2, …………,column)]
Values(value1, value2, ………, valueN);

Q39. Write a note on select statement?


A39. Select statement is used to retrieve or fetch data from a database. With the SELECT
clause of a SELECT command statement, we specify the column that we want to be
displayed in the query result and, optionally, which column headings we prefer to see
above the result table.
Syntax :
SELECT column1, column2 FROM table_name;
Where Column1, column2 are the names of the fields of the table.
Table_name is the name of the table from where we want to fetch.
Example :
i. To fetch the entire table or all the fields in the table ?
SELECT * from Student;
ii. Write a query to fetch the fields ROLL_NO, NAME, AGE from the table
Student?
SELECT ROLL_NO, NAME , AGE FROM Student;

43
Q40. Write a note on WHERE clause?
A40. WHERE clause is used with SELECT statement to specify the condition based on
which rows will be extracted from the table. It is used to fetch data according to a
particular criteria.
Syntax:
SELECT column1, column2 FROM table_name WHERE column_name operator
value;
Example :
i. Write a query to fetch records of students from student table with age
equal to 20?
SELECT * FROM Student WHERE AGE=20;
ii. Write a query to fetch Name and Address of students from tha table student
with ROLL_NO greater than 3?
SELECT ROLL_NO , NAME , ADDRESS FROM Student WHERE
ROLL_NO>3;
Q41. Write a note on BETWEEN operator?
A41. The BETWEEN operator is used to specify a range of values. The range you specify
contains a lower and upper range. It is used to fetch filtered data in a given range
inclusive of two values.
Syntax :
SELECT column1, column2 FROM table_name WHERE column_name BETWEEN
value1 AND value2;
Where :
Between is the operator name
Value1 and value2 : are the exact value from value1 to value2 to get related data in
result set.
Example :
I. Write a query to fetch records of students from Student table where
ROLL_NO is between 1 and 3 (inclusive).
SELECT * FROM Student WHERE ROLL_NO BETWEEN 1 AND 3;
II. Write a query to fetch NAME, ADDRESS of students where AGE is between
20 and 30(inclusive).
SELECT NAEM, ADDRESS FROM Student WHERE AGE BETWEEN 20
AND 30;
Q42. Write a note on LIKE operator?
A42. LIKE operator is used to fetch filtered data by searching for a particular pattern in
WHERE clause. LIKE operator is used with CHAR datatype.
Syntax :
SELECT column1, column2 FROM table_name WHERE column_name LIKE
pattern;
Example :
i. Write a query to fetch records of students from Student table where NAME
starts with letter S?
SELECT * FROM Students WHERE NAME LIKE „S%‟;
ii. Write a query to fetch records of students from Student table where NAME
contains the pattern „AM‟?
SELECT * FROM Student WHERE LIKE „%AM%‟;

44
Q43. Write a note on IN operator?
A43. IN operator is used to fetch filtered data same as fetched by „=‟ operator just the
difference is that here you can specify multiple values for which we can get the result
set.
Syntax :
SELECT column1, column2 FROM table_name where
column_nameIN(value1, value2, value3, ….)
Example :
I. Write a query to fetch NAME and ADDRESS of students from table Student
where Age is 18 or 20?
SELECT NAME, ADDRESS FROM Student WHERE AGE IN(18,20);
II. Write a query to fetch records of students from table Student where
ROLL_NO is 1 or 4?
SELECT * FROM Student WHERE ROLL_NO IN(1,4);
Q44. Write a note on AND operator?
A44. AND operator is used to displays only those records where both the conditions
condition1 and condition2 evaluates to True.
Syntax :
SELECT * FROM table_name WHERE condition1 AND condition2 and …..
condition;
Example :
i. Write a query to fetch all records from student table where AGE is 18 and
ADDRESS is DELHI?
SELECT * FROM Student WHERE AGE = 18 AND ADDRESS = „DELHI‟;
ii. Write a query to fetch all the records from Student table where NAME is Ram
and age is 18?
SELECT * FROM Student WHERE AGE = 18 AND NAME = „RAM‟;

Q45. Write note on OR operator ?


A45. OR operator is used to display the records where either one of the conditions
condition1 and condition2 is TRUE.
Syntax :
SELECT * FROM table_name WHERE condition1 OR condition2 OR …..
condition;
Example :
i. write a query to fetch all the records from Student table where name is RAM
or name is SUJIT?
SELECT * FROM Student WHERE NAME = „RAM‟ OR NAME =‟SUJIT‟;
ii. Write a query to fetch all records from student table where name is RAM or
age is 20
SELECT * FROM student WHERE NAME=‟RAM‟ OR AGE = 20;
Q46. Write a note on NOT operator?
A46. NOT operator returns false if following conditions is true.
Syntax :
SELECT * FROM table_name WHERE condition;
Example :
Write a query to fetch all the records from student table where age is not equal
to 20.
SELECT * FROM student WHERE AGE <> 20;
45
Q47. Write a note on ORDER BY statement?
A47. The ORDER BY statement in SQL is used to sort the fetched data in either ascending
or descending according to one or more columns.
Syntax :
SELECT * FROM table_name ORDER BY column_name ASC|DESC;
Example :
Write a query to fetch all data from the table student and sort the result in
descending order according to the column ROLL_NO.
SELECT * FROM student ORDER BY ROLL_NO DESC.
Q48. How will add a column into existing table?
A48. ADD is used to add columns into the existing table.
Syntax :
ALTER TABLE table_name
ADD (columnname1 datatype, columnname1 datatype, …..);
Example :
Write a query to ADD two columns AGE and SUBJECT to table Subject?
ALTER TABLE Subject ADD (AGE int(3), SUBJECT varchar(4));
Q49. How will DROP a column in a table?
A49. You can drop a column from a table by using the ALTER TABLE statement DROP
COLUMN clause is used to delete the unwanted columns from the table.
Syntax :
ALTER TABLE table_name
DROP COLUMN column_name;
Example :
Write a query to DROP column SUBJECT in table Subject ?
Drop column SUBJECT in table Subject;

Q50. How will you modify a column?


A50. You can modify a column definition by using the ALTER TABLE statement with the
MODIFY clause.
Syntax :
ALTER TABLE table_name
MODIFY column_name column_type;
Example :
Write a query to MODIFY column SUBJECT in table Subject?
ALTER TABLE subject MODIFY SUBJECT varchar(20);
Q51. How will you update the data of an existing table in database?
A51. The UPDATE statement in SQL is used to update the data of an existing table in
database.
Syntax :
UPDATE table_name SET column1= valiue1, colimn2 = value2….
WHERE condition;
Example :
Write a query to update the column NAME in Student table and set the value
to „Deepak‟ in all the rows where AGE is 20 ?
UPDATE Student SET NAME = „Deepak‟ WHERE AGE = 20;

46
Q52. What do you mean by Alias? How will you define column Alias?
A52. Alias are the temporary names given to table or column for the purpose of a
particular SQL query.
Syntax :
SELECT column as Alias_name FROM table_name;
Example :
Write a query to fetch ROLL_NO, NAME from Student table using S_CODE,
S_NAME as alias name respectively?
SELECT ROLL_NO As S_CODE , NAME AS S_NAME FROM student;
Q53. What is Transaction?
A53. Transaction is a group of a set of tasks into a single execution unit. Each transaction
begins with a specific task and ends when all the tasks in the group successfully
complete. A transaction has only two results : success or failure.
Q54. Write note on TCL?
A54. TCL(Transaction Control Language) : These commands are used for managing
changes affecting the data. Examples of TCL commands are :
i. COMMIT : it commits a transaction. It is used for storing changes
performed by a transaction. When a COMMIT command is issued it saves all
the changes since last COMMIT or ROLLBACK.
Syntax :
COMMIT;
Example :
Write a query which would delete those records from the table which
have age = 20 and then COMMIT the changes in the database?
DELETE FROM Student WHERE AGE =20;
COMMIT;

ii. ROLLBACK : it rollbacks a transaction in case of any error occurs. It is


used for reverting changes performed by a transaction.
Syntax :
ROLLBACK;
Example :
Write a query which would delete those records from the table which
have age = 20 and then ROLLBACK the changes in the database?
DELETE FROM Student WHERE AGE =20;
ROLLBACK;
iii. SAVEPOINT : A savepoint is a point in a transaction in which you can
roll the the transaction back to a certain point without rolling back the entire
transaction.
Syntax :
SAVEPOINT SAVEPOINT_NAME;
Example :
Write a query which would delete those records from the table which
have age = 20 and then ROLLBACK the changes in the database by
keeping Savepoints?
SAVEPOINT SP1;
DELETE FROM Student WHERE AGE =20;
SAVEPOINT SP2;
ROLLBACK TO SP1;
47
iv. SET TRANSACTION : it specify characteristics for the transaction.
Q55. How will you create user accounts in SQL?
A55. The DBA creates the user by executing the CREATE USER statement.
Syntax:
CREATE USER user
IDENTIFIED BY password;
Example :
CREATE USER ABC
IDENTIFIED BY „HELLO‟;
Q56. Write note on DCL ?
A56. DCL(Data Control Language) : is used for providing security to database objects,
rights, permissions and other controls of the database system.
Examples of DCL are :
i. GRANT : gives user‟s access privileges to database.
Syntax :
GRANT privilege_name
ON object_name
TO {user_name | PUBLIC | role_name|;
Example :
Give the user ABC all data manipulation permission on the table
Student?
GRANT ALL
ON Student
TO ABC;
ii. REVOKE : withdraw user‟s access privileges given by using the GRANT
command.
Syntax :
REVOKE privilege_name
ON object_name
FROM {user_name | PUBLIC | role_name|;
Example :
Give the user ABC all data manipulation permission on the table
Student?
REVOKE ALL
ON Student
FROM ABC;

Q57. How will you delete a user account?


A57. To delete a user account(along with associated rights and privileges) you can use
DROP USER statement.
Syntax :
DROP USER user_name;
Example :
Write a query to delete the user ABC?
DROP USER ABC;

48
Q58. What is Constraints? Name and explain most commonly used constraints
available in MYSQL?
A58. Constraints are the rules enforced on the data columns of a table. These are used to
limit the type of data that can go into a table. This ensures the accuracy and
reliability of the data in the database.
The following are some of the commonly used constraints available in MYSQL :
i. NOT NULL constraint : It ensures that a column cannot have NULL vale.
ii. DEFAULT constraint : It provides a default value for a column when none is
specified.
iii. UNIQUE constraint : It ensures that all values in a column are different.
iv. PRIMARY KEY : It uniquely identifies each row/record in a database table.
v. FOREIGN KEY : It uniquely identifies a row/record in any of the given
database table.
vi. CHECK constraint : It ensures that all the values in a column satisfies certain
conditions.

Q59. How can we specify constraints?


A59. We can specify constraints at the time of creating the table using CREATE TABLE
statement. We can also specify the constraints after creating a table using ALTER
TABLE statement.
Syntax :
CREATE TABLE table_name
{
Column1 datatype(size) constraint_name;
Column2 datatype(size) constraint_name;
Column3 datatype(size) constraint_name;
………….
};
Example :
CREATE TABLE Student1{
ROLL_NO INT(6) NOT NULL PRIMARY KEY,
NAME VARCHAR(20) NOT NULL,
AGE INT(6) NOT NULL UNIQUE,
FEE DECIMAL(8, 2)
};

Q60. Explain the concept of KEYS?


A60. KEYS are fields in a table which participate in below activities in RDBMS systems :
i. To create relationship between two tables.
ii. To maintain uniqueness in a table.
iii. To keep consistent and valid data in database.
iv. Might help in fast data retrieval by facilitating indexes on columns.

49
Q61. Name and explain various types of keys used in RDBMS systems?
A61. The various types of keys used in RDBMS systems are :
i. Candidate Key : Candidate key is a key of a table which can be selected as a
primary key of the table. A table can have multiple candidate keys out of
which one can be selected as a primary key.
ii. Primary key : It is a candidate key of the table selected to identify each record
uniquely in table. Primary key does not allow null value in the column and
keeps unique values throughout the column.
iii. Unique key : It is similar to primary key and does not allow duplicate values
in the column. The difference between primary key and unique key is that it
allows one null value in the column.
iv. Alternate key : It is a candidate key, currently not selected as primary key of
the table.
v. Composite key : It is a group of two or more columns that identifies each row
of a table uniquely.
vi. Super key : It is a set of columns on which all columns of the table are
functionally dependent. It is a set of columns that uniquely identifies each row
in a table.
vii. Foreign key: In a relationship between two tables a primary key of one table is
referred as a foreign key in another table.
Q62. Give difference between Primary and Candidate Key?
A62. The difference between Primary and Candidate key are :

S. No. Primary Key Candidate Key


1. It is a minimal super key. So there is one While in a relation there can be more
and only one primary key in a relation than one candidate key.
2. Any attribute of Primary Key cannot Any attribute can contain NULL
contain NULL value value.
3. Primary key can be optional to specify any But without candidate key there can‟t
relation. be specified any relation.
4. Primary key specifies the important Candidate specifies the key which
attribute for the relation. can qualify for primary key.
5. It is confirmed that a primary key is a But it is not confirmed that a
candidate key. candidate key can be a primary key.

Q63. Name and explain various Aggregate functions?


A63. The various aggregate functions are :
i. AVG( ) : It returns average value after calculating from values in a
numeric column.
Syntax :
SELECT AVG(column_name) FROM table_name;
Example :
SELECT AVG(MARKS) FROM Marks;
ii. COUNT( ) : It is used to count the number of rows returned in a SELECT
statement.
Syntax :
SELECT COUNT(column_name) FROM table_name;
Example :
SELECT COUNT(*) AS NumStudents FROM Marks;
50
iii. FIRST( ) : The FIRST( ) function returns the first value of the selected
column.
Syntax :
SELECT FIRST(column_name) FROM table_name;
Example :
SELECT FIRST(MARKS) AS MarksFirst FROM Marks;
iv. LAST( ) : The LAST( ) function returns the last value of the selected
column.
Syntax :
SELECT LAST(column_name) FROM table_name;
Example :
SELECT LAST(MARKS) AS MarksLast FROM Marks;
v. MAX( ) : The MAX( ) function returns the maximum value of the selected
column.
Syntax :
SELECT MAX(column_name) FROM table_name;
Example :
SELECT MAX(MARKS) AS MaxMarks FROM Marks;
vi. MIN( ) : The MIN( ) function returns the minimum value of the selected
column.
Syntax :
SELECT MIN(column_name) FROM table_name;
Example :
SELECT MIN(MARKS) AS MinMarks FROM Marks;
vii. SUM( ) : The Sum( ) function returns the sum of all the values of the
selected column.
Syntax :
SELECT SUM(column_name) FROM table_name;
Example :
SELECT SUM(MARKS) AS Totalmarks FROM Marks;
Q64. Name and explain various Scalar functions?
A64. The various scalar functions are :
i. UCASE( ) : It converts the value of a field to uppercase
Syntax :
SELECT UCASE(column_name) FROM table_name;
Example :
SELECT UCASE(NAME) FROM Marks;
ii. LCASE( ) : It converts the value of a field to lowercase.
Syntax :
SELECT LCASE(column_name) FROM table_name;
Example :
SELECT LCASE(NAME) FROM Marks;
iii. MID( ) : This function extracts texts from the text field.
Syntax : SELECT MID(column_name, start, length) AS some_name
FROM table_name;
Example : Write a query to fetch first four characters of names of students
from the Marks table.
SELECT MID(NAME, 1, 3) FROM Marks;

51
iv. LEN( ) : This function returns the length of the value in a text field.
Syntax : SELECT LENGTH(column_name) FROM table_name;
Example : Write a query to fetch the length of names of students from
Marks table?
SELECT LENGTH(NAME) FROM Marks;

v. ROUND( ) : This function is used to round a numeric field to the number of


decimals specified.
Syntax : SELECT ROUND(column_name, decimals) FROM
table_name;
Example : Write a query to fetch maximum marks among students from the
Marks table?
SELECT ROUND(MARKS, 0) FROM Marks;
vi. NOW( ) : It returns the current system date and time.
Syntax : SELECT NOW( ) FROM table_name;
Example : SELECT NAME, NOW( ) AS DateTime FROM Marks;

52
Chapter-6
PL/SQL
Q1. What do you mean by PL/SQL?
A1. PL/SQL is a block structured language that enables developers to combine the power
of SQL with procedural statement. The architecture of PL/SQL mainly consists of
following three components :
i. PL/SQL block
ii. PL/SQL engine
iii. Database Server
Q2. Give features of PL/SQL?
A2. The features of PL/SQL are as follows :
i. PL/SQL is basically a procedural language which provides the functionality of
decision making, iteration and many more features of procedural
programming languages.
ii. PL/SQL can execute a number of queries in one block using single command.
iii. One can create a PL/SQL unit such as procedures, functions, packages,
triggers.
iv. PL/SQL provides a feature to handle the exception which occurs in PL/SQL
block known as exception handling block.
v. Applications written in PL/SQL are portable to computer hardware or
operating system where Oracle is operational.
vi. PL/SQL offers extensive error checking.
Q3. Give advantages of using PL/SQL?
A3. The advantages of using PL/SQL are as follows :
i. Better performance as sql is executed in bulk rather than a single statement.
ii. High Productivity.
iii. Tight integration with SQL.
iv. Full Portability.
v. Tight Security
vi. Support Object Oriented Programming concepts.
Q4. What are the disadvantages of SQL? Explain.
A4. The disadvantages of SQL are as follows :-
i. SQL does not have procedural capabilities i.e SQL does not provide
programming techniques of conditional checking, looping and branching that
is vital for data testing storage.
ii. SQL statements are passed to the Oracle engine one at a time. Each time an
SQL statement is executed, call is made to the engine‟s resources. This adds
to the traffic on the network, thereby decreasing the speed of data processing,
especially in a multiuser environment.
iii. While processing an SQL sentence if an error occur the ORACLE engine
displays its own error messages. SQL has no facility for programmed handling
of errors that arise during manipulations of data.

53
Q5. Give the PL/SQL block structure?
A5. PL/SQL programs are made up of blocks. The block has the following structure :
i. DECLARE
This section begins with DECLARE keyword in which
variables, constants, records as cursors can be declared which
stores data temporarily. It contains definition of PL/SQL
identifiers. This part of the code is optional.
ii. BEGIN
This section is mandatory section and here the program logic is written
to perform any task like loops and conditional statements. It supports
all DML commands, DDL command and SQL*Plus built-in functions
as well.
iii. EXCEPTIONS
This section starts with EXCEPTION keyword. This section is optional
which contains statements that are executed when a run time error
occurs.
iv. END;
Q6. Give difference between SQL and PL/SQL?
A6. The difference between SQL and PL/SQL are as follows :

SQL PL/SQL
1. No Procedural Capabilities : 1. Procedural Capabilites :
SQL does not have procedural PL/SQL is basically a procedural language
capabilities i.e SQL does not which provides the functionality of
provide programming techniques decision making, iteration and many more
of conditional checking, looping features of procedural programming
and branching that is vital for data languages.
testing storage.
2. Time Consuming Processing : 2. Reduced Network Traffic :
SQL statements are passed to the PL/SQL statements sends an entire block of
Oracle engine one at a time. Each statements at one time. This reduces network
time an SQL statement is executed, time considerably.
call is made to the engine‟s
resources. This adds to the traffic
on the network, thereby decreasing
the speed of data processing,
especially in a multiuser
environment.
3. No Error handling Procedures : 3. Error handling Procedures :
While processing an SQL sentence PL/SQL offers extensive error checking.
if an error occur the ORACLE
engine displays its own error
messages. SQL has no facility for
programmed handling of errors that
arise during manipulations of data.
4. No facilities sharing : 4. Facilities Sharing :
SQL does not allow sharing of PL/SQL provides access and sharing of same
facilities. subprogram by multiple applications.
54
Q7. Name various PL/SQL identifiers?
A7. The various PL/SQL identifiers are variables, constants, procedures, cursors, triggers
etc.
Q8. What do you mean by variable?
A8. A variable is a name associated with value. A variable stores or contains the value.
Variables allow you to store and manipulate data in program. It can hold any value
during the execution of the program.
Syntax is :
Variablenamedatatype [NOT NULL := value];
Example :
Write a program to show how to declare variable in PL/SQL?
SQL> SET SERVEROUTOUT ON ;
SQL> DECLARE
var1 INTEGER;
var2 REAL;
var3 varchar2(20);
BEGIN
Null;
END;
/
Q9. What is IF statements ?
A9. The IF statement executes a sequence of statements depending on the value of a
condition. There are three forms of IF statements :
i. IF-THEN
In this form the sequence of statements is executed only if the
condition is TRUE. If the condition is FALSE or NULL, the IF
statement does nothing. In either case control passes to the next
statement.
Syntax :
IF <condition> THEN
<Action>
END IF;
Example :
Write a program in PL/SQL to check the given value is greater
than 50 by using IF-THEN statement?
DECLARE
a NUMBER :=60;
BEGIN
dbms_output.put_line(„Program started.‟);
IF(a >50) THEN
dbms_output.put_line(„ a is greater than 50.‟);
END IF;
dbms_output.put_line(„Program completed.‟);
END;
/
Output :
a is greater than 50.

55
ii. IF-THEN-ELSE :
This form is used when you want to choose between two
mutually exclusive actions.
Syntax :
IF condition THEN
Sequence of executable statements;
ELSE
Sequence of executable statements;
END IF;
Example :
Write a program in PL/SQL to check the given value is greater
or less than 50 by using IF-THEN-ELSE statement?
DECLARE
a NUMBER :=30;
BEGIN
dbms_output.put_line(„Program started.‟);
IF(a >50) THEN
dbms_output.put_line(„ a is greater than 50.‟);
ELSE
dbms_output.put_line(„ a is less than 50.‟);
END IF;
dbms_output.put_line(„Program completed.‟);
END;
/
Output :
a is less than 50.

56
iii. IF-THEN-ELSEIF :
The IF-ELDEIF formulation provides a way to handle
multiple conditions within a single IF statement.
Syntax :
IF condiont-1 THEN
Statements-1;
ELSEIF condition-2 THEN
Statement-2;
[ELSE
Statement-3]
END IF;
Example :
Write a program in PL/SQL to display value of variable by
using IF-THEN-ELSEIF statement.
DECLARE
a NUMBER(3) :=60;
BEGIN
dbms_output.put_line(„Program started.‟);
IF(a = 10) THEN
dbms_output.put_line(„ Value of a is 10.‟);
ELSEIF (a = 20) THEN
dbms_output.put_line(„Value of a is 20.‟);
ELSEIF ( a = 30) THEN
dbms_output.put_line(„Value of a is 30.‟);
ELSE
dbms_output.put_line(„None of the values is matching.‟);
END IF;
dbms_output.put_line(„Exact value of a is : „ | | a);
END;
/
Output :
None of the value is matching.
Exact value of a is :60
Q10. Write a note on LOOP statements/Iterative control?
A10. LOOP statements/Iterative control executes a sequence of statements multiple times
or indicates the ability to repeat or skip sections of a code block. A loop marks a
sequence of statements that has to be repeated. The keyword loop has to be placed
before the first statement in the sequence of statements to be repeated, while the
keyword end loop is placed immediately after the last statement in the sequence.
Types of LOOP in PL/SQlare :
i. Basic loop statement ii. For loop statement iii. While loop statement

57
Q11. Explain the BASIC LOOP Statement?
A11. The BASIC LOOP statement execution block starts with keyword „LOOP‟ and ends
with the keyword „END LOOP‟ which encloses a sequence of statements between
the keywords LOOP and END LOOP.
Syntax :
LOOP
Sequence of statements;
END LOOP;
Example :
Write a program in PL/SQL to print number from 1 to 5 using basic loop
statement?

1. DECLARE
2. a NUMBER := 1;
3. BEGIN
4. dbms_output.put_line(„Program started :‟);
5. LOOP
6. dbms_output.put_line(„ a ‟);
7. a := a + 1;
8. EXIT WHEN a > 5;
9. END LOOP;
10. dbms_output.put_line(„Program completed.‟);
11. END;
12. /
Output :
Program started :
1
2
3
4
5
Program completed.

58
Q12. Explain the FOR LOOP statement?
A12. FOR LOOP iterate over a specified range of integers. The number of iterations is
known before the loop is entered. A double dot (..) serves as the range operator. In
this loop, the lower limit and the upper limit will be specified and as long as the loop
variable is in between this range, the loop will be executed.
Syntax :
FOR <loop variable> IN <lower_limit> ..<upper_limit>
LOOP
Execution block starts
.
.
Execution block end
END LOOP;

Example :
Write a program in PL/SQL code to print number from 1 to 5 using FOR loop
statement ?

1. BEGIN
2. dbms_output.put_line(„Program started :‟);
3. FOR a IN 1 . . 5
4. dbms_output.put_line(a);
5. END LOOP;
6. dbms_output.put_line(„Program completed.‟);
7. END;
8. /
Output :
Program started :
1
2
3
4
5
Program completed.

59
Q13. Explain WHILE LOOP statement?
A13. WHILE loop statements works similar to the BASIC LOOP statement except the
EXIT condition is at the very beginning of the loop. It works like an entry-check loop
in which execution block will not even be executed once if the condition is not
satisfied.
Syntax :
WHILE <EXIT condition>
LOOP
Execution statements;
.
.
END LOOP;
Example :
Write a program in PL/SQL code to print number from 1 to 5 using
WHILE loop statement ?
1. DECLARE
2. a NUMBER := 1;
3. BEGIN
4. dbms_output.put_line(„Program started :‟);
5. WHILE( a < 5)
6. LOOP
7. dbms_output.put_line(a);
8. a := a + 1;
9. END LOOP;
10. dbms_output.put_line(„Program completed.‟);
11. END;
12. /
Output :
Program started :
1
2
3
4
5
Program completed.

Q14. What do you mean by trigger?


A14. A trigger is a PL/SQL block structure which is fired when a DML statements like
INSERT, DELETE, UPDATE is executed on database table. Triggers are basically
PL/SQL procedures that are associated with tables and are called whenever a certain
modification(event) occurs. Triggers are stored programs which are automatically
executed or fired when some events occur. Triggers could be defined on the table,
view, schema, or database with which the event is associated.

60
Q15. Give benefits of triggers?
A15. The benefits are as follows :
i. Generating some derived column values automatically.
ii. Enforcing referential integrity.
iii. Event logging and storing information on table access.
iv. Auditing.
v. Synchronous replication of tables.
vi. Imposing security authorizations.
vii. Preventing invalid transactions.
Q16. Give different types of triggers in PL/SQL?
A16. The different types of triggers are :
i. ROW LEVEL TRIGGERS and STATEMENT LEVEL TRIGGERS :
A statement level trigger is fired once on behalf of the triggering statement,
regardless of the number of rows in the table that the triggering statement
affects. A row trigger fires once for each row affected by the triggering event.
ii. BEFORE and AFTER TRIGGERS :
BEFORE trigger run the trigger action before triggering statement is run.
BEFORE trigger execute before the triggering DML statement(INSERT,
UPDATE, DELETE) execute. AFTER triggers run the trigger action after the
triggering statement is run. AFTER trigger execute after the triggering DML
statement (INSERT, UPDATE, DELETE) executed.
iii. INSTEAD OF TRIGGERS :
INSTEAD of triggers describe how to perform insert, update and delete
operations against views that are too complex to support these operations
natively.
Q17. What do you mean by cursor?
A17. We can manipulate within a SQL statement by means of assigning a name to a
“select statement”, this concept is known as cursor. It is used for processing
individual rows returned as a result for a query. It is the work area which Oracle
reserves for internal processing of SQL statements.
Q18. Name the types of cursors?
A18. There are two types of cursors :
i. IMPLICIT CURSORS :
This type of cursors are automatically created by PL/SQL whenever an SQL
statement is executed. Whenever a DML statement(INSERT, UPDATE and
DELETE) is issued an implicit cursor is associated with this statement.
ii. EXPLICIT CURSORS :
This type of cursors are defined by the programmers to gain more control over
the context area. These cursors should be defined in the declaration section of
the PL/SQL block. It is created on a SELECT statement which returns more
than one row.

61
Q19. Give the attributes of implicit cursors?
A19. The different attributes of implicit cursor are :

Attribute Description
%FOUND Returns TRUE if an INSERT, UPDATE, or DELETE statement affected
one or more rows or a SELECT INTO statement returned one or more
rows. Otherwise it returns FALSE.
%NOTFOUND The logical opposite of %FOUND. It returns TRUE if an INSERT,
UPDATE, or DELETE statement affected no rows or a SELECT INTO
statement returned no rows. Otherwise it returns FALSE.
%ISOPEN Always returns FALSE for implicit cursors, because Oracle closes the
SQL cursor automatically after executing its associated SQL statement.
%ROWCOUNT Returns the number of rows affected by an INSERT, UPDATE or
DELETE statement or returned by a SELECT INTO statement.

Q20. Give difference between TRIGGER and CURSOR?


A20. The difference are :
TRIGGER CURSOR
1. Triggers are named PL/SQL blocks 1. Cursors are temporary work areas.
2. Triggers are stored if database. 2. Cursors are not stored independently
in the database.
3. Triggers can be invoked 3. We can create cursor both implicitly
automatically. and explicitly.
4. Triggers cannot take parameters. 4. Cursors can take parameters.
5. Triggers are used to enforce data in 5. Cursors are used to process the result
dignity rules. of query.

62
Chapter-7
Internet Business Application

Q1. Write a short note on online services?


A1. An online services refers to any information and services provided over the Internet.
These services not only allow subscribers to communicate with each other, but they
also provide unlimited access to information. Online services can range from simple
to complex.
Q2. Give advantages of online services?
A2. The advantages of online services are as follows :
1. Convenience : You shop whenever you want to. Online shops are never closed.
2. Saves time.
3. Greater choice : A large number of options are available. So you can choose the
best one.
4. Better prices : You can compare prices between suppliers.
5. Convenient delivery.
6. Freedom of choice : freedom of choice is very high in online than shopping from
a nearby store.
7. Data storage saving : by storing your data online you are reducing the burden of
your hard disk, which means you are eventually saving disk space.
8. With internet banking you can keep an eye on your transactions and account
balance all the time.
Q3. Give disadvantages of online services?
A3. The disadvantages of online services are as follows :
i. Cost : Businesses will normally need to pay out a lot of money to have their
websites professionally designed and developed.
ii. Staff with expertise : The staff required to run the online business will need to
have the expertise to manage the website and keep it maintained.
iii. Online fraud : A lot of online fraud, means there is a risk of losing money on
sales.
iv. Delay : the main disadvantage of online shopping is you cannot receive the
product immediately.
v. Slow internet connections or older computers may make accessing course
materials frustrating.
Q4. What is e-commerce?
A4. E-commerce : It means electronic commerce. It is the process of buying, selling,
transferring or exchanging products, services or information via computer networks.
It refers to paperless exchange of business information using the following ways :
i. Electronic Data Exchange(EDI)
ii. Electronic Mail(e-mail)
iii. Electronic Bulletin Boards
iv. Electronic Fund Transfer(EFT)
v. Other Network-based technologies.

63
Q5. Give features of e-commerce?
A5. The features of e-commerce are as follows :
i. Non-Cash Payment: e-commerce enables use of credit cards, debits cards,
smart cards and other modes of electronics payment.
ii. 24 x 7 service availability : e-commerce automates business of enterprises and
services provided by them to customers are available anytime, anywhere.
iii. Advertising/Marketing : e-commerce increases the reach of advertising of
products and services of business.
iv. Improved Sales : Using e-commerce, orders for the products can be generated
any time, any where without any human intervention.

Q6. Give difference between traditional commerce and e-commerce?


A6. The difference between traditional and e-commerce are as follows :

Sr. Traditional commerce E-commerce


No
1. Heavy dependency on information Information sharing is made easy via electronic
exchange from person to person. communication channels making little
dependency on person to person information
exchange.,
2. Manual intervention is required for Communication or transaction can be done in
each communication or transaction. asynchronous way.
3. It is difficult to establish and maintain A uniform strategy can be easily established and
standard practices in traditional maintain in e-commerce.
commerce.
4. Communication of business depends In e-commerce or electronic market there is no
upon individual skills. human intervention.
5. Unavailability of a uniform platform e-commerce website provides user a platform
as traditional commerce depends where all information is available at one place.
heavily on personal communication.

Q7. Give the classification of e-commerce?


A7. E-commerce business models can be generally categorized in the following
categories:
i. Business to business(B2B)
ii. Business to Consumer(B2C)
iii. Consumer to Consumer(C2C)
iv. Consumer to Business(C2B)
v. Business to Government(B2G)
vi. Government to Business(G2B)
vii. Government to Citizen(G2C)

64
Q8. What is Net banking? Give its advantage and disadvantage?
A8. Net Banking is the process of conducting banking transactions over the internet. It
enables bank customers to handle account management and perform account
transactions directly with the bank through the internet.
Advantages of Net Banking are as follows :
i. An online account is simple to open and easy to operate.
ii. It‟s convenient
iii. You do not have to stand in a queue to pay off your bills.
iv. It is available all the time.
v. It is fast and efficient
vi. You can keep an eye on your transactions and account balance all the time.
Disadvantages of net banking are as follows :
i. Understanding the usage of internet banking might be difficult for a beginner.
ii. Security of transactions is a big issue.
iii. Password security is a must.
iv. If the banker‟s server is down then you cannot access your accounts.
v. You cannot have access to online banking if you don‟t have an internet
connection.
Q9. Give various modes of online payment?
A9. Various mode of online payments are : Credit Card, Debit Card, Smart Card, E-
money, Electronic Fund Transfer(EFT)
Q10. What is online reservation? Give it’s advantages and disadvantages?
A10. Online reservation is a method which helps the travel and tourism industry support
reservation through internet. It helps consumer to book flights, hotels, holiday
packages, insurance and other online services.
Advantages of online booking system are as follows :
1. Its quicker and easier to book online.
2. Most airlines usually offer incentives for cheaper flights if you book online.
3. Booking online means that its easy to track prices.
4. Large choice of hotels, tickets and easy to use interface and search engines.
5. Immediate confirmation as per system announcement.
Disadvantages of online booking system are as follows :
1. It can sometimes be hard to find a real bargain when surfing the web.
2. A computer crash could cause a passenger‟s reservation and other information to
simply vanish.
3. For online booking a well designed website needs to be put in place along with a
database.
4. You can make a mistake and book the wrong seats.
5. If the server is down or running very slowly, then much business can be lost and
annoy a lot of customers.

65
Q11. What is customer support services? Give its advantages and disadvantages?
A11. Customer Service means range of services provided to assist customers in making
cost effective and correct use of a product. It includes assistance in planning,
installation, training, trouble shooting etc.
Advantages of customer support services are as follows :
1. You can reach out at the right time to provide pre-sale and post-sale support.
2. It is quicker and easy.
3. Complaints can be submitted very easily filled 24 x 7.
4. It provides high level of satisfaction.
5. It saves time and money.
Disadvantages are as follows :
1. Some software is priced out of reach and takes a while to get used to.
2. Some software is difficult to get used to.
3. Need trained manpower.
Q12. What is online marketing and shopping? Give its advantages and
disadvantages?
A12. The act of purchasing products or services over the internet is known as online
shopping. Internet marketing refers to advertising and marketing efforts that use the
web and email to drive direct sales via electronic commerce which allows consumers
to directly buy goods or services from a seller over internet.
Advantages of shopping online are as follows :
1. It has more variety and better prices.
2. Easy to send gifts.
3. Easy price comparisons.
4. No sales pressure.
5. Access to used or damaged inventory.
Disadvantages are as follows :
1. Shipping problems and delays.
2. Risk of fraud.
3. Less contact with your community.
4. Returns can be complicated.
5. No sales assistance.
6. No support for local retailers.
Q13. What is social networking? Give its advantages and disadvantages?
A13. Social networking is the use of internet based social media programs to make
connections with friends, family, classmates, customers and clients.
Advantages of social networking are as follows :
1. Social networking has decreased the distance between friends and relatives.
2. These have increased the strength of relationships between friends and some
distant relatives.
3. These will provide opportunity to increase the communication skills as the person
is not infront of you one can talk freely.
4. One can know the updates of his friends, even without talking with them
personally.
5. One can make their ideas reach thousands of people with their posts thus
becoming popular.
6. Social networking sites are free to download.

66
Disadvantages of social networking are as follows :
1. There is a possibility of committing fraud and send spam messages.
2. Wastage of time.
3. Many people pretend to be someone else and prepare their online profiles with
false information.
Q14. Give examples of social networks?
A14. Various examples of social networks are as follows :
1. Bebo: A popular social networking site where people can share photo‟s,
stories, their journal etc with their friends and family privately or publicly on
the internet.
2. Facebook: It is a popular destination for users to setup their own personal
web pages, connect with friends, share pictures, movies, talk about what you
are doing etc.
3. Google+ : The latest social networking service from google.
4. Twitter : Another fantastic service that allows users to post 140 character
long posts from their phones and on the internet.
5. Youtube : A great network of users posting video blogs and other fun and
interesting videos.

67

You might also like