FOC- Full Notes
FOC- Full Notes
1) What is computer?
A computer is a programmable device that stores, retrieves, and processes data.
2) What is data processing?
Data processing means to process the data i.e. to convert its format. As we all
know data is the very useful and when it is well presented and it becomes
informative + useful. Data processing system is also referred as information
system. It is also right to say that data processing becomes the process of
converting information into data and also vice-versa.
3) Difference between data and information
The term Data is defined as a raw and unstructured fact that needs to be processed
to make it meaningful. Data can be simple and unstructured at the same time until
it is structured. Usually data contains facts, numbers, symbols, image,
observations, perceptions, characters, etc.
The term Information is defined as a set of data that is processed according to the
given requirement in a meaningful way. To make the information useful and
meaningful, it must be processed, presented and structured in a given context.
Information is processed from data and possess context, purpose and relevance.
It also includes raw data manipulation.
Information gives meaning and increases the accuracy of the data. It helps to
guarantee undesirability and reduces confusion. Thus, when the data is
transformed into information, there is no unwanted and useless detail contained
in the information. Example of information: Merit List, receipts, reports, report
cards etc.
4) List and explain characteristics of computer
Speed: – As you know computer can work very fast. It takes only few seconds
for calculations that we take hours to complete. You will be surprised to know
that computer can perform millions (1,000,000) of instructions and even more
per second.
Therefore, we determine the speed of computer in terms of microsecond (10-6
part of a second) or nanosecond (10 to the power -9 part of a second). From this
you can imagine how fast your computer performs work.
2. Accuracy: – The degree of accuracy of computer is very high and every
calculation is performed with the same accuracy. The accuracy level is 7.
determined on the basis of design of computer. The errors in computer are due
to human and inaccurate data.
Diligence: – A computer is free from tiredness, lack of concentration, fatigue,
etc. It can work for hours without creating any error. If millions of calculations
are to be performed, a computer will perform every calculation with the same
accuracy. Due to this capability it overpowers human being in routine type of
work.
The modern computer took its shape with the advent of time. It was around 16th
century when the evolution of computer started. The initial computer faced
many changes, obviously for the betterment. It continuously improved itself in
terms of speed, accuracy, size, and cost to get the shape of the modern day
computer. This long period can be conveniently divided into the following
phases called computer generations:
Programming language was shifted from high level to assembly language and
made programming comparatively an easy task for programmers. Languages
used for programming in this era were FORTRAN (1956), ALGOL (1958) and
COBOL (1959). Examples: PDP-8, IBM1400 series, IBM 1620, IBM 7090,
CDC 3600.
A single IC, has many transistors, registers and capacitors built on a single thin
slice of silicon. The cost size were reduced and memory space and working
efficiency was increased in this generation. Programming was now done in
Higher level language such as BASIC (Beginners All purpose Symbolic
Instruction Code). Mini computers find their shape in this era. Examples: NCR
395, B6500.. IBM 360,370
The speed is highest, size is the smallest and area of use has remarkably
increased in the fifth generation computers. Though not hundred per cent
artificial intelligence has been achieved till date but keeping in view the current
developments, it can be said that this dream will also become a reality very
soon.
The first generation computers used the technology of vacuum tubes, which has
been replaced by transistors in the second generation and integrated circuits in
the third. The fourth generation envisaged the use of microprocessors and now
is the era of artificial intelligence.
(ii) logical operations often known by comparing by using AND, OR, NOT and
exclusive OR operation which is done by analyzing and evaluating data by
matching it with a set of known data that are included in the program or called
from the memory.
Control Unit
this unit is mainly used for generating the electronic control signals for the
synchronization of various operation.
2. Memory
3. Input/Output unit:
Data and instructions must enter the system, before any computation can be
performed,
i). It accepts the instructions and data from the outside world.
ii). It converts these instructions and data in computer readable form.
iii). It supplies the converted instruction and data to the computer system for
further processing.
Output unit:
the job of an output unit is just reverse of an input unit, it supplies the
information obtained from processed data to the outside world.
1). Accept the result produced by the computer and gives to the outside world;
2). It converts this codes result to human readable form.
3). It supplies the converted result to outside world.
10) What are the two main components of CPU? List the main
functions of each component.
Control unit
Control unit: This unit controls the operations of all parts of computer but
does not carry out any actual data processing operations. Functions of
control unit are:
It obtains the instructions from the memory, interprets them, and directs
the operation of the computer.
Primary memory devices are more Secondary memory devices are less
expensive than secondary storage expensive when compared to
devices. primary memory devices.
CU-Control unit
MU- Memory unit
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
8. What is a Unicode?
Unicode is a standard for character encoding. The introduction of ASCII
characters was not enough to cover all the languages. Therefore, to overcome this
situation, it was introduced. The Unicode Consortium introduced this encoding
scheme.
1. It defines all the characters needed for writing the majority of known
languages in use today across the world.
2. It is a superset of all other character sets.
3. It is used to represent characters across different platforms and programs.
11. What are the features of Unicode?
Using the NOT operation reverse the value of the Boolean variable from 0 to 1
or vice-versa. This can be understood as:
If A = 1, then using NOT operation we have (A)’ = 0
If A = 0, then using the NOT operation we have (A)’ = 1
We also represent the negation operation as ~A, i.e if A = 1, ~A = 0
Using the AND operation satisfies the condition if both the value of the
individual variables are true and if any of the value is false then this operation
gives the negative result. This can be understood as,
If A = True, B = True, then A . B = True
If A = True, B = False, Or A = false, B = True, then A . B = False
If A = False, B = False, then A . B = False
Disjunction (OR) Operation:
Using the OR operation satisfies the condition if any value of the individual
variables is true, it only gives a negative result if both the values are false.
This can be understood as,
If A = True, B = True, then A + B = True
If A = True, B = False, Or A = false, B = True, then A + B = True
If A = False, B = False, then A + B = False
Here are some of the main steps used to solve the duality theorem
in boolean algebra:
Expression Dual
1=0 0=1
0=1 1=0
1.0 = 0 0+1=1
0.1 = 0 1+0=1
1+0=1 0.1 = 0
0+1=1 1.0 = 0
A.0 = 0 A+1=1
A.A = 0 A+A=1
A.(B.C) = (A.B).C A + (B + C) = (A + B) + C
UNIT 1-(CHAPTER 3) COMPUTER SOFTWARE
Device drivers are a class of system software that minimizes the need for system
troubleshooting. Internally, the operating system communicates with hardware
elements. Device drivers make it simple to manage and regulate this
communication.
To operate the hardware components, the operating system comes with a variety
of device drivers. The majority of device drivers, including those for a mouse,
keyboard, etc., are pre-installed in the computer system by the businesses that
make computers.
5. Utility Software
Every natural language has a systematic method of using the words and
symbols in that language defined by the grammar rules of the language.
Similarly, we need to use the words and symbols of a computer language
as per set rules is known as syntax rules of the language.
Interpreter
Assembler
Compiler:
Performs the translation of a program as a whole.
Execution is faster.
Debugging is hard as the error messages are generated after scanning the
entire program only.
programming languages like C, C++ uses compilers.
Interpreter
Performs statement by statement translation.
Execution is slower.
It stops translation when the first error is met. Hence, debugging is easy.
programming languages like Python, BASIC, and Ruby uses interpreters.
1) Terminal: An oval flow chart shape indicating the start or end of the
process.
2) Input/Output:
A parallelogram that indicates data input or output (I/O) for a process.
3) Process
4) Decision
A small, labeled, circular flow chart shape used to indicate a jump in the
process flow.
6) Flow
Advantages of pseudocode:
Disadvantages of pseudocode:
There are no accepted standards for writing pseudocodes and designer use
their own style while writing pseudocodes.
Workstation
The workstation works similarly to the server. Workstations are meant for
sharing data on the network at the workplace.
A bit (short for "binary digit") is the smallest unit of measurement used to
quantify computer data. It contains a single binary value of 0 or 1.
Bit
In a computer, data is stored in the form of 0s and 1s. We can store each and
every data in a computer with the help of 0s and 1s. Each digit, either 0 or 1, is
called a Bit. The Bit is the smallest unit of memory. Bit simply refers to the
binary digit.
Nibble
Word: A word “size” refers to the amount of data a CPU’s internal data
registers can hold and process at one time. Computers embedded in
word sizes of 8, 16, 32, or 64 bits.
Hardware cannot perform any task The software can not be executed
without software. without hardware.
1. Keyboard
2. Mouse
3. Scanner
4. Joystick
5. Light Pen
6. Digitizer
7. Microphone
8. Magnetic Ink Character Recognition (MICR)
9. Optical Character Reader (OCR)
10. Digital Camera
11. Webcam
12. Biometric Devices
This type of keyboard layout was developed to increase the typing speed by
reducing the finger movement while typing. The most frequently used letters are
kept in a home row to improve typing.
5. What is a Digitizer?
6. What is MICR?
They can't be faked or copied, due to the use of magnetic ink and unique
fonts.
The benefits of the technology include enhanced security against fraud and
mechanization of check processing.
7. What is OCR?
8. What is OMR?
Barcodes are used to help organize and index information or prices about
an object.
Barcodes used by the U.S. postal service to help speed the delivery of mail
is an example of how a barcode could be used.
It is a data input device that reads data from a card shaped storage medium.
A magnetic card reader is a device used to read magnetic stripe cards, such
as credit cards.
Typing Keys
Control Keys
Special Keys
Function Keys
Mouse
The most common pointing device is the mouse. The mouse is used to move a
little cursor across the screen while clicking and dragging. The cursor will stop
if you let go of the mouse. The computer is dependent on you to move the
mouse; it won’t move by itself. As a result, it’s an input device.
The left mouse button can be used to select or move items, while the right mouse
button when clicked displays extra menus.
Joystick
A joystick is a pointing device that is used to move the cursor on a computer
screen. A spherical ball is attached to both the bottom and top ends of the stick.
In a socket, the lower spherical ball slides. You can move the joystick in all four
directions.
Track Ball
Track Ball is an accessory for notebooks and laptops, which works on behalf of
a mouse. It has a similar structure to a mouse. Its structure is like a half-inserted
ball and we use fingers for cursor movement. Different shapes are used for this
like balls, buttons, or squares.
Optical Mark Reader (OMR)
An Optical Mark Reader is a device that is generally used in educational
institutions to check the answers to objective exams. It recognizes the marks
present by pencil and pen.
Printers are output devices that allow you to print information on paper. There
are certain types of printers which are described below.
Impact Printers
Character Printers
Line Printers
Non-Impact Printers
Laser Printers
Inkjet Printers
Printer
Impact Printer
Characters are printed on the ribbon, which is subsequently crushed against the
paper, in impact printers. The following are the characteristics of impact
printers:
Exceptionally low consumable cost.
Quite noisy
Because of its low cost, it is ideal for large-scale printing.
To create an image, there is physical contact with the paper.
Character Printers
Character Printer has the capability to print only one character at a time. It is of
two types.
Dot Matrix Printer
Daisy Wheel
Line Printers
Line Printers are printers that have the capability to print one line at a time. It is
of two types.
Drum Printer
Chain Printer
Non-Impact Printers
Characters are printed without the need for a ribbon in non-impact printers.
Because these printers print a full page at a time, they’re also known as Page
Printers. The following are the characteristics of non-impact printers:
Faster
They don’t make a lot of noise.
Excellent quality
Supports a variety of typefaces and character sizes
Laser Printers
Laser Printers use laser lights for producing dots which will produce characters
on the page.
Inkjet Printers
Inkjet printers are printers that use spray technology for printing papers. High-
quality papers are produced in an Inkjet printer. They also do color printing.
15. What is a projector?
Projectors are optical devices that have the work to show visuals on both
types of screens, stationary and moving both. It helps in displaying
images on a big screen. Projectors are generally used in theatres,
auditoriums, etc.
16. What is a speaker?
Speakers are devices that produce sound after getting a command from a
computer. Nowadays, speakers come with wireless technology also like
Bluetooth speakers.
17. Write a note on Output devices.
Output Devices
Output Devices are the devices that show us the result after giving the input to
a computer system. Output can be of many different forms like image, graphic
audio, video, etc. Some of the output devices are described below.
Monitor
Monitors, also known as Visual Display Units (VDUs), are a computer’s
primary output device. It creates images by arranging small dots, known as
pixels, in a rectangular pattern. The amount of pixels determines the image’s
sharpness.
The two kinds of viewing screens used for monitors are described below.
Cathode-Ray Tube (CRT) Monitor: Pixels are minuscule visual
elements that make up a CRT display. The higher the image quality or
resolution, the smaller the pixels.
Flat-Panel Display Monitor: In comparison to the CRT, a flat-panel
display is a type of video display with less volume, weight, and power
consumption. They can be hung on the wall or worn on the wrist.
Flat-panel displays are currently used in calculators, video games, monitors,
laptop computers, and graphical displays.
Printer
Printers are output devices that allow you to print information on paper. There
are certain types of printers which are described below.
Impact Printers
Character Printers
Line Printers
Non-Impact Printers
Laser Printers
Inkjet Printers
Impact Printer
Characters are printed on the ribbon, which is subsequently crushed against the
paper, in impact printers. The following are the characteristics of impact
printers:
Exceptionally low consumable cost.
Quite noisy
Because of its low cost, it is ideal for large-scale printing.
To create an image, there is physical contact with the paper.
Character Printers
Character Printer has the capability to print only one character at a time. It is of
two types.
Dot Matrix Printer
Daisy Wheel
Line Printers
Line Printers are printers that have the capability to print one line at a time. It is
of two types.
Drum Printer
Chain Printer
Non-Impact Printers
Characters are printed without the need for a ribbon in non-impact printers.
Because these printers print a full page at a time, they’re also known as Page
Printers. The following are the characteristics of non-impact printers:
Faster
They don’t make a lot of noise.
Excellent quality
Supports a variety of typefaces and character sizes
Laser Printers
Laser Printers use laser lights for producing dots which will produce characters
on the page.
Inkjet Printers
Inkjet printers are printers that use spray technology for printing papers. High-
quality papers are produced in an Inkjet printer. They also do color printing.
Speakers
Speakers are devices that produce sound after getting a command from a
computer. Nowadays, speakers come with wireless technology also like
Bluetooth speakers.
Projector
Projectors are optical devices that have the work to show visuals on both types
of screens, stationary and moving both. It helps in displaying images on a big
screen. Projectors are generally used in theatres, auditoriums, etc.
Primary memory devices are more Secondary memory devices are less
expensive than secondary storage expensive when compared to
devices. primary memory devices.
Every file that contains a C program must be saved with ‘.c’ extension. This is
necessary for the compiler to understand that this is a C program file. Suppose
a program file is named, first.c. The file first.c is called the source file which
keeps the code of the program. Now, when we compile the file, the C compiler
looks for errors. If the C compiler reports no error, then it stores the file as a .obj
file of the same name, called the object file. So, here it will create the first.obj.
This .obj file is not executable. The process is continued by the Linker which
finally gives a .exe file which is executable.
Linker: First of all, let us know that library functions are not a part of any C
program but of the C software. Thus, the compiler doesn’t know the operation
of any function, whether it be printf or scanf. The definitions of these functions
are stored in their respective library which the compiler should be able to link.
This is what the Linker does. So, when we write #include, it includes stdio.h
library which gives access to Standard Input and Output. The linker links the
object files to the library functions and the program becomes a .exe file. Here,
first.exe will be created which is in an executable format.
Loader: Whenever we give the command to execute a particular program, the
loader comes into work. The loader will load the .exe file in RAM and inform
the CPU with the starting point of the address where this program is loaded.
CPU Registers
Memory:
CISC- CISC means complex instruction set computer, it allows the user to
apply 1 instruction as an alternative to many simple instructions.
RISC- RISC means Reduced Instruction Set Computers. RISC reduces the
operation time by shortening the clock cycle per instruction.
Microcontroller Microprocessor
Process management
Memory management
File management
Device management
Security
Command interpretation
File Management
A file system is organized into directories for efficient or easy navigation and
usage. These directories may contain other directories and other files. An
Operating System carries out the following file management activities.
It keeps track of where information is stored, user access settings, the status of
every file.
It decides who gets the resources.
Device Management
The operating system manages the communication between the computer system
and the peripheral devices connected to the I/O port of the system. Peripheral
devices use their respective drivers to communicate with the system. The
operating system determines which program or process is accessed by which
connection and device. It also makes sure when a program is executed or
terminated, it will stop the communication between the device and the computer
system.
Security:
Command interpretation:
One of the most important functions of the operating system is controlling the
system's health. For this purpose, it monitors and observes the delay time between
a service being requested and the requested service being served. This delay time
is reduced as much as possible to improve the overall performance of the system.
A variety of errors can occur while a computer system is running. These include
internal and external hardware errors, such as a memory error, a device failure
and various software errors. In each case, the operating system must provide a
response that clears the error condition with the least impact on running
applications.
When the computer starts then the operating system and application
programs are loaded into main memory.
In old operating systems (OS) only one program runs on the computer at a
time.
These types of operating systems in which one program runs at a time are
known as Uniprogramming operating systems.
5. Differentiate between CPU bound and I/O bound jobs.
CPU bound jobs: These jobs mostly perform computations with little I/O
operations. Hence, their CPU utilization is more. For example, multiplying
small matrices, is likely to be CPU bound.
I/O bound jobs: These jobs mostly perform I/O operations with little
computation. Hence their CPU utilization is very low. For example,
counting the number of lines in a file is likely to be I/O bound.
Advantages:
Disadvantages:
Due to lack of protection scheme, one batch job can affect pending jobs.
No user interaction.
Disadvantages of Multiprogramming
Prior knowledge of scheduling algorithms is required.
If it has a large number of jobs, then long-term jobs will have to
require a long wait.
Memory management is needed in the operating system because all
types of tasks are stored in the main memory.
Using multiprogramming up to a larger extent can cause a heat-up
issue.
The operating system that runs more than one task at a time is known as a
multitasking operating system (MOS). MOS can be desktop or mobile
operating system (OS).
Advantages
Failure of one processor does not affect the functioning of other
processors.
It divides all the workload equally to the available processors.
Makes use of available resources efficiently.
Disadvantages
Symmetrical multiprocessing OS are more complex.
They are costlier.
Synchronization between multiple processors is difficult.
Process A will execute for 4 ns, as soon as it gets over, process B starts
executing for a duration of 4 ns. Further when B gets complete, process C
executes for 4 ns. This process continues till all the processes is very fast.
Hence the user feels that all the processes are running at the same time.
Advantages
1. Each task gets an equal opportunity.
2. Fewer chances of duplication of software.
3. CPU idle time can be reduced.
Disadvantages
1. Reliability problem.
2. One must have to take of the security and integrity of user programs
and data.
3. Data communication problem.
System programs are nothing but a special software which give us facility
to manage and control the computer’s hardware and resources.
Status Information: Information like date, time amount of available
memory, or disk space is asked by some users.
Uniprogramming:
Multiprogramming:
The processor needs to be faster.
In multiprogramming, the main memory needs more space.
Some examples of multiprogramming are:
The operating systems that are used in modern computers like Windows 10,
etc.
Multiprogramming:
It includes the single CPU to execute the program.
Concept of Context Switching is used.
Multi-programming increases CPU utilization by organizing jobs .
The idea is to reduce the CPU idle time for as long as possible.
Execution of process takes more time.
Multi-tasking:
It uses multiple tasks for the task allocation.
Concept of Context Switching and Time Sharing is used.
In multi-tasking also increases CPU utilization, it also increases
responsiveness.
The idea is to further extend the CPU Utilization concept by
increasing responsiveness Time Sharing.
Execution of process takes less time.
Chapter-7 Unix Operating System
1. What is Unix?
4. What is a Kernel?
5. What is a shell?
External commands:
External commands are not built into the shell. These are executable and
are present in a separate file. When an external command, has to be
executed, a new process has to be loaded and the command gets
executed. For example, when you execute the “cat” command, which
usually is at /usr/bin, the executable /usr/bin/cat gets executed.
Example: cat, mkdir, rm, cp, rmdir, mv
a) Printf:
“printf” command in Linux is used to display the given string,
number or any other format specifier on the terminal window. It
works the same way as “printf” works in programming languages
like C.
Syntax:
$printf [-v var] format [arguments]
Example:
Printf “programming in %s” ”java”
Output: programming in java
c) Date: date command is used to display the system date and time.
date command is also used to set date and time of the system. By
default the date command displays the date in the time zone on
which unix operating system is configured.
Syntax: date[month][year]
Ex: $date
Output: Thu Mar 22 18:14:37 UTC 2020
d) tput: The tput command is used to control the movement of the
cursor on the screen. That is using tput command user can display
the output to specified row and column. It is also used to add
features such as blinking, boldface and underline to the message
displayed on the screen.
Syntax: tput [row column]
Ex: The following command display total number of rows
24(default).
$tput lines
Output:24
e) uname: prints the name, version and other details about the current
machine and the operating system.
Syntax:
Uname[option]…
Option:
-n It prints the hostname of the network node
-p It prints the type of the processor
-o It prints the name of the operating system
Ex: $uname
Output:Linux
Ex: $uname -o
Output: GNU/Linux
f) tty
There is a command called tty which displays information related
to the terminal.
Syntax: tty
Ex: $tty
Output: /dev/pts/0
g) who
The who command is used to get information about currently
logged-in users on the system.
Syntax
Who
Ex: $who
Output:
Ubuntu tty2 2019-03-28 17:56
Ubuntu tty5 2019-03-28 17:56
Ubuntu pts/0 2019-03-28 17:58
h) passwd
The passwd command changes passwords for user accounts. A
normal user may only change the password for his/her own
account, while the superuser may change the password for any
account.
Example:
$ passwd
output:
$ passwd
Changing password for ubuntu.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
i) man
Syntax :
$ man [COMMAND NAME]
Example:
$ man printf
Output:
j) clear
Syntax:
clear
8. What is a microkernel?
A microkernel is a type of operating system kernel that is designed to
provide only the most basic services required for an operating system to
function, such as memory management and process scheduling.
1. Inter-Process Communication
2. Memory Management
3. CPU Scheduling
Inter-Process Communication
Memory Management
CPU Scheduling
CPU scheduling refers to which process the CPU will execute next. All
processes are queued and executed one at a time. Every process has a level of
priority, and the process with the highest priority is performed out first. CPU
scheduling aids in optimizing CPU utilization.
Booting is basically the process of starting the computer. When the CPU is
first switched on it has nothing inside the Memory. In order to start the
Computer, load the Operating System into the Main Memory and then
Computer is ready to take commands from the User.
Cold Booting: When the computer starts for the first time or is in a shut-
down state and switch on the power button to start the system, this type of
process to start the computer is called cold booting. During cold booting,
the system will read all the instructions from the ROM (BIOS) and the
Operating System will be automatically get loaded into the system.
Step 1: The Startup: It is the first step that involves switching the power
ON. It supplies electricity to the main components like BIOS and
processor.
Step 3: Loading of OS: In this step, the operating system is loaded into
the main memory. The operating system starts working and executes all
the initial files and instructions.
Step 4: System configuration: In this step, the drivers are loaded into the
main memory. Drivers are programs that help in the functioning of the
peripheral devices.
1. What is Data?
Data is a collection of facts, such as numbers, words, measurements,
observations or even just descriptions of things.
2. What is Database?
c) Database Is Reliable
Databases store data consistently and reliably. This helps to prevent the data
from becoming corrupted.
File System:
Universities:
Banking:
It is one of the major applications of databases. Banks have a huge amount of data
as millions of people have accounts that need to be maintained properly.
E-commerce Websites:
Medical:
Industries:
The database management system is the main priority of industries because they
need to store huge amounts of data. The industry database stores customer details,
sales records, product lists, transactions, etc.
End Users: The end users are those who actually access the database
for querying, updating and generating reports. There are various
categories of end users. They are:
Stand alone users: These are those users whose job is basically
to maintain personal databases by using a ready-made program
package that provides easy-to-use menu-based or graphics-
based interfaces, An example is the user of a tax package that
basically stores a variety of personal financial data for tax
purposes. These users become very proficient in using a specific
software package.
Disadvantages of DBMS
Complex design :
Database design is complex, difficult and time consuming.
Unorganized
Information:
Organized
It is refined data.
11.What is SQL?
SQL Data type is an attribute that specifies the type of data of any
object. Each column in a database table is required to have a name and
a data type.
Data type
Constraints are the rules that we can apply on the type of data in a table. That
is, we can specify the limit on the type of data that can be stored in a particular
column in a table using constraints.
The available constraints in SQL are:
NOT NULL: This constraint tells that we cannot store a null value in
a column. That is, if a column is specified as NOT NULL then we
will not be able to store null in this particular column any more.
UNIQUE: This constraint when specified with a column, tells that
all the values in the column must be unique. That is, the values in
any row of a column must not be repeated.
PRIMARY KEY: A primary key is a field which can uniquely
identify each row in a table. And this constraint is used to specify a
field in a table as primary key.
FOREIGN KEY: A Foreign key is a field which can uniquely
identify each row in a another table. And this constraint is used to
specify a field as Foreign key.
CHECK: This constraint helps to validate the values of a column to
meet a particular condition. That is, it helps to ensure that the value
stored in a column meets a specific condition.
DEFAULT: This constraint specifies a default value for the column
when no value is specified by the user.
The following SQL ensures that the "ID", "LastName", and "FirstName"
columns will NOT accept NULL values when the "Persons" table is created:
Example
CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255) NOT NULL,
Age int
);
MySQL:
CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
PRIMARY KEY (ID)
);
d) SQL FOREIGN KEY on CREATE TABLE
The following SQL creates a FOREIGN KEY on the "PersonID"
column when the "Orders" table is created:
MySQL:
CREATE TABLE Orders (
OrderID int NOT NULL,
OrderNumber int NOT NULL,
PersonID int,
PRIMARY KEY (OrderID),
FOREIGN KEY (PersonID) REFERENCES Persons(PersonID)
);
e) SQL CHECK on CREATE TABLE
The following SQL creates a CHECK constraint on the "Age" column
when the "Persons" table is created. The CHECK constraint ensures
that the age of a person must be 18, or older:
MySQL:
CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
CHECK (Age>=18)
);
f) SQL DEFAULT on CREATE TABLE
The following SQL sets a DEFAULT value for the "City" column
when the "Persons" table is created:
To create a CHECK constraint on the "Age" column when the table is already
created, use the following SQL:
MySQL:
ALTER TABLE Persons
ALTER City SET DEFAULT 'Sandnes';
DROP CONSTRAINT
The DROP CONSTRAINT command is used to delete a UNIQUE,
PRIMARY KEY, FOREIGN KEY, or CHECK constraint.
1. What is Internet?
Internet is a global network that connects billions of computers across the
world with each other and to the World Wide Web.
Easy to Use
The software that is used to access the Internet or web browser is designed
in such a way that is very simple and can be easily learned and used. Also,
it is easy to develop.
Flexibility
Accessibility
Internet service is a worldwide service and access to all. People located in remote
or anywhere interior can also use the Internet. Therefore, information through the
internet flows across the networks in a standardised manner.
Businesses are expanding with the help of the Internet. There is a high degree of
interaction with the media due to internet service. Like, News, magazines,
publishing houses, etc. have extended their business with the help of Internet
service. Also, communication is flexible due to internet service. With the help of
text voice, video people can communicate easily.
There are some popular communication internet applications, which are given
below.
Email
Skype
Google Meet
Zoom
WhatsApp
Facebook Messenger
Through email, you can also send an email to someone in a few seconds
and can also receive email from anyone. You just need to have an internet
connection to send or receive emails.
Through email, you can send text messages, program files, spreadsheets,
photos, videos, etc to anyone. Email is mostly used by professional people.
Job Search
Due to covid 19, many people lost their jobs today or if they say, millions
of people around the world have become unemployed due to covid
epidemic, and it is very difficult to find jobs again.
Through these internet job applications, you can find jobs for yourself sitting at
home, these job portals have all kinds of jobs for all types of people, all you have
to do is use these job applications and just send your resume. We have given
below the names of some jobs providing internet applications.
Naukri.com
Monster.com
Freshersworld.com
Indeed.com
Glassdoor
Online Shopping
Today there are many such applications on the Internet, through which you can
buy anything online. Such as - Mobile, Tablet PC, Computers, Watch, Smart
Watch, Television, Fan, Table Fan, LED Bulb, Glasses, Ring,
Jewellers, Camera, Home Appliances, clothes, etc.
Through these shopping applications, you can order any item of your need
sitting at home. We have given below the names of some shopping applications,
from which you can shop.
Amazon
FlipKart
Paytm Mall
ShopClues
Myntra
Travel
Due to the Covid epidemic all over the world, people have stopped
traveling, and as the effect of the Covid epidemic is working, people are
now starting to leave their homes.
Today, there are many such Internet applications, so they make your journey even
easier. You can book travel tickets, hotels, taxis, etc. through these internet
applications.
Or you can now book the same trip through these applications
MakeMyTrip.
Cleartrip.
Goibibo.
Agoda.
Booking.com.
Yatra.
Research
Research means to do deep research about a subject or to know
everything about that subject. Doing research is no small task, it takes a
lot of time and effort to do research about anything.
Today there are many such internet applications that make your research
easier and you do not have to work harder too.
All you have to do is use these applications to complete your research.
Mendeley
Flipboard
Researcher
Google Keep
Curiosity
Paperity
Slack
DropBox
Online Payments
Today is the era of online payments, in today's digital age, now everyone is
paying any bill online instead of giving cash. Today online payments are in full
swing all over the world.
There are many benefits of online payment. For example - you do not need to
carry cash, there is no need to spare money in taking any item.
Paytm
PhonePe
Google Pay
Social Networking
Social networking is also a good platform, through which you talk to people.
Today millions of people around the world are using social networking sites.
Through social networking sites, you can make connections with friends, family,
classmates, customers, and clients.
You must have an internet connection to use social networking sites because
without an internet connection you cannot use these social networking sites.
Facebook
Instagram
Twitter
LinkedIn
YouTube
E-mails provides faster and easy mean of communication. One can send
message to any person at any place of world by just clicking mouse.
o It is effective and cheap means of communication because single
message can be send to multiple people at same time.
o E-mails are very easy to filter. User according to his/her priority
can prioritize e-mail by specifying subject of e-mail.
o E-mail is not just only for textual message. One can send any kind
of multimedia within mail.
To write an e-mail there is no need of any kind of paper, thus it is
environment friendly.
6. What is FTP?
8. What is a newsgroup?
IP stands for Internet Protocol and v4 stands for Version Four (IPv4).
Ipv4 was the primary version brought into action for production within
the ARPANET in 1983.
IP version four addresses are 32-bit integers which will be expressed in
decimal notation.
Example- 192.0.2.126 could be an Ipv4 address.
Ipv4 could be a 32-Bit IP Address.
Ipv4 could be a numeric address, and its bits are separated by a dot.
An Ipv4 address consists of four numbers, each of which contains one to
three digits, with a single dot (.) separating each number or set of digits.
Each of the four numbers can range from 0 to 255.
12. What is IPV6?
MAC Address:
o MAC Address stands for Media Access Control Address.
o MAC Address is a six byte hexadecimal address.
o MAC Address is used to ensure the physical address of a computer.
o MAC Address helps in simply identifying the device.
o MAC Address of computer cannot be changed with time and
environment.
A dial-up connection is the least expensive way to access the Internet, but it also
slowest connection.
DSL: DSL has a lot going for it: it’s faster than dial-up; in a lot of cases it’s faster
than satellite (and no latency for gamers); and it’s infrastructure makes it more
available than either cable or fiber internet.
Both DSL and old-school dial-up internet use phone lines to connect you to the
internet; but dial-up works on a frequency that prevents you from being able to
be on the (landline) phone and the internet simultaneously.
Wi-Fi Internet:
Ethernet: Ethernet is the most widely used LAN technology and is defined
under IEEE standards 802.3. The reason behind its wide usability is that
Ethernet is easy to understand, implement, and maintain, and allows low-cost
network implementation. Also, Ethernet offers flexibility in terms of the
topologies that are allowed.
The Domain Name System (DNS) is the phonebook of the Internet. Humans
access information online through domain names, like nytimes.com or espn.com.
Web browsers interact through Internet Protocol (IP) addresses. DNS translates
domain names to IP addresses so browsers can load Internet resources.
Each device connected to the Internet has a unique IP address which other
machines use to find the device. DNS servers eliminate the need for humans to
memorize IP addresses such as 192.168.1.1 (in IPv4), or more complex newer
alphanumeric IP addresses such as 2400:cb00:2048:1::c629:d7a2 (in IPv6).
It receives and responds to requests made over a network. Server receives the
request from the client for a web document, and it sends the requested
information to the client's computer.
Static:
Content of Web pages can not be change at runtime.
No interaction with database possible.
It is faster to load as compared to dynamic website.
Cheaper Development costs.
No feature of Content Management.
HTML, CSS, Javascript is used for developing the website.
Same content is delivered everytime the page is loaded.
Dynamic:
Content of Web pages can be changed.
Interaction with database is possible
It is slower than static website.
More Development costs.
Feature of Content Management System.
5. What is a Website?
A website is a collection of many web pages, and web pages are digital
files that are written using HTML(HyperText Markup Language).
Stateless: HTTP is a stateless protocol as both the client and server know
each other only during the current request. Due to this nature of the
protocol, both the client and server do not retain the information between
various requests of the web pages.
HTTP HTTPS
HTTP speed is faster than HTTPS. HTTPS speed is slower than HTTP.
<HTML >
<HEAD>
<TITLE> Title of the webpage</TITLE>
</HEAD>
<BODY>
Tags that define the content of a webpage are written here.
</BODY>
</HTML>
<HTML> -> It identifies the document as HTML document. The entire code to
design a webpage is written between the opening and closing HTML tags.
<HEAD> -> It is used to provide some additional information, including title,
scripts used and so on, about a webpage.
<TITLE> -> The title tag is used to specify the title of a webpage. The title
appears on the title bar or on the tab in the browser window.
<BODY> -> This tag defines the content of a webpage that would be visible in
the browser. All the tags that display text, images or links in a web page are
written between the opening and the closing<BODY> tags.
23. What is HTML heading?
The HTML heading tag is used to define the headings of a page. There are
six levels of headings defined by HTML. These 6 heading elements are h1, h2,
h3, h4, h5, and h6; with h1 being the highest level and h6 being the least.
<h1> is used for the main heading. (Biggest in size)
<h2> is used for subheadings, if there are further sections under the
subheadings then the <h3> elements are used.
<h6> for the small heading (smallest one).
Save Time: We can specify CSS once and reuse the same sheet within
various HTML pages. We can describe a style for every HTML tag and
apply this style to as a lot of web pages as we want.
Inline style sheets: Inline style sheets are declared within individual
tags and affected those tags only. Inline style sheets are declared with
the style attribute.
Example:
<html>
<head>
<p style=”color:purple; font-size: 30px”> computer science</p>
</head>
</html>
Document level style sheets: A document level style sheet holds the
CSS code for the webpage in the head section of the particular file. This
makes it easy to apply styles like classes or id’s in order to reuse the
code.
Ex:
<html>
<head>
<style type=”text/css”>
H1{color:blue;}
H2{color:red;}
P{color:green;}
</style >
</head>
<body>
<h1> C programming</h1>
<h2> Operating system</h2>
<p> java programming </p>
</body>
</html>
<html>
<head>
<link rel=”stylesheet” type=”text/css” href=”exstyle.css”>
</head>
<body>
<h1> c programming</h1>
<h2> operating system</h2>
<p> java programming </p>
</body>
</html>