Intro To It (Extra Materials)
Intro To It (Extra Materials)
What is DBMS?
A Database Management System (DBMS) is a software system that is designed to manage
and organize data in a structured manner. It allows users to create, modify, and query a
database, as well as manage the security and access controls for that database. DBMS
provides an environment to store and retrieve data in convenient and efficient manner.
Types of DBMS
1. Relational Database Management System (RDBMS): Data is organized into tables
(relations) with rows and columns, and the relationships between the data are
managed through primary and foreign keys. SQL (Structured Query Language) is used
to query and manipulate the data.
2. NoSQL DBMS: Designed for high-performance scenarios and large-scale data, NoSQL
databases store data in various non-relational formats such as key-value pairs,
documents, graphs, or columns.
3. Object-Oriented DBMS (OODBMS): Stores data as objects, similar to those used in
object-oriented programming, allowing for complex data representations and
relationships
Database Languages
Data Definition Language
Data Manipulation Language
Data Control Language
Transactional Control Language
Data Definition Language (DDL)
DDL is the short name for Data Definition Language, which deals with database schemas
and descriptions, of how the data should reside in the database.
CREATE: to create a database and its objects like (table, index, views, store procedure,
function, and triggers)
ALTER: alters the structure of the existing database
DROP: delete objects from the database
TRUNCATE: remove all records from a table, including all spaces allocated for the
records are removed
COMMENT: add comments to the data dictionary
RENAME: rename an object
DML is the short name for Data Manipulation Language which deals with data
manipulation and includes most common SQL statements such SELECT, INSERT, UPDATE,
DELETE, etc., and it is used to store, modify, retrieve, delete and update data in a
database. Data query language(DQL) is the subset of “Data Manipulation Language”. The
most common command of DQL is SELECT statement. SELECT statement help on retrieving
the data from the table without changing anything in the table.
SELECT: retrieve data from a database
INSERT: insert data into a table
UPDATE: updates existing data within a table
DELETE: Delete all records from a database table
MERGE: UPSERT operation (insert or update)
CALL: call a PL/SQL or Java subprogram
EXPLAIN PLAN: interpretation of the data access path
LOCK TABLE: concurrency Control
DCL is short for Data Control Language which acts as an access specifier to the database.
(basically to grant and revoke permissions to users in the database
GRANT: grant permissions to the user for running DML(SELECT, INSERT, DELETE,…)
commands on the table
REVOKE: revoke permissions to the user for running DML(SELECT, INSERT, DELETE,…)
command on the specified table
TCL is short for Transactional Control Language which acts as an manager for all types of
transactional data and all transactions. Some of the command of TCL are
Roll Back: Used to cancel or Undo changes made in the database
Commit: It is used to apply or save changes in the database
Save Point: It is used to save the data on the temporary basis in the database
Data query language(DQL) is the subset of “Data Manipulation Language”. The most
common command of DQL is 1the SELECT statement. SELECT statement helps us in
retrieving the data from the table without changing anything or modifying the table. DQL
is very important for retrieval of essential data from a database.
Paradigm Shift from File System to DBMS
File System manages data using files on a hard disk. Users are allowed to create, delete,
and update the files according to their requirements. Let us consider the example of file-
based University Management System. Data of students is available to their respective
Departments, Academics Section, Result Section, Accounts Section, Hostel Office, etc.
Some of the data is common for all sections like Roll No, Name, Father Name, Address,
and Phone number of students but some data is available to a particular section only like
Hostel allotment number which is a part of the hostel office. Let us discuss the issues with
this system:
Redundancy of data: Data is said to be redundant if the same data is copied at many
places. If a student wants to change their Phone number, he or she has to get it
updated in various sections. Similarly, old records must be deleted from all sections
representing that student.
Inconsistency of Data: Data is said to be inconsistent if multiple copies of the same
data do not match each other. If the Phone number is different in Accounts Section
and Academics Section, it will be inconsistent. Inconsistency may be because of typing
errors or not updating all copies of the same data.
Difficult Data Access: A user should know the exact location of the file to access data,
so the process is very cumbersome and tedious. If the user wants to search the
student hostel allotment number of a student from 10000 unsorted students’ records,
how difficult it can be.
Unauthorized Access: File Systems may lead to unauthorized access to data. If a
student gets access to a file having his marks, he can change it in an unauthorized way.
No Concurrent Access: The access of the same data by multiple users at the same time
is known as concurrency. The file system does not allow concurrency as data can be
accessed by only one user at a time.
No Backup and Recovery: The file system does not incorporate any backup and
recovery of data if a file is lost or corrupted.
Advantages of DBMS
Data organization: A DBMS allows for the organization and storage of data in a
structured manner, making it easy to retrieve and query the data as needed.
Data integrity: A DBMS provides mechanisms for enforcing data integrity constraints,
such as constraints on the values of data and access controls that restrict who can
access the data.
Concurrent access: A DBMS provides mechanisms for controlling concurrent access to
the database, to ensure that multiple users can access the data without conflicting
with each other.
Data security: A DBMS provides tools for managing the security of the data, such as
controlling access to the data and encrypting sensitive data.
Backup and recovery: A DBMS provides mechanisms for backing up and recovering the
data in the event of a system failure.
Data sharing: A DBMS allows multiple users to access and share the same data, which
can be useful in a collaborative work environment.
Disadvantages of DBMS
Complexity: DBMS can be complex to set up and maintain, requiring specialized
knowledge and skills.
Performance overhead: The use of a DBMS can add overhead to the performance of
an application, especially in cases where high levels of concurrency are required.
Scalability: The use of a DBMS can limit the scalability of an application, since it
requires the use of locking and other synchronization mechanisms to ensure data
consistency.
Cost: The cost of purchasing, maintaining and upgrading a DBMS can be high,
especially for large or complex systems.
Limited Use Cases: Not all use cases are suitable for a DBMS, some solutions don’t
need high reliability, consistency or security and may be better served by other types
of data storage.
Applications of DBMS
Enterprise Information: Sales, accounting, human resources, Manufacturing, online
retailers.
Banking and Finance Sector: Banks maintaining the customer details, accounts, loans,
banking transactions, credit card transactions. Finance: Storing the information about
sales and holdings, purchasing of financial stocks and bonds.
University: Maintaining the information about student course enrolled information,
student grades, staff roles.
Airlines: Reservations and schedules.
Telecommunications: Prepaid, postpaid bills maintains.
Conclusion
A Database Management System (DBMS) is an essential tool for efficiently managing,
organizing, and retrieving large volumes of data across various industries. Its ability to
handle data securely, ensure integrity, support concurrent access, and provide backup and
recovery options makes it indispensable for modern data-driven applications. While
DBMSs come with complexities and costs, their benefits in terms of data management and
security far outweigh the challenges, making them a crucial component in any data-centric
environment
E-commerce
Introduction:
E-commerce, or electronic commerce, refers to the buying and selling of goods and services
over the internet. It involves the use of electronic platforms, such as websites, mobile
applications, and social media, to conduct transactions between businesses and consumers
or between businesses. E-commerce has revolutionized the way businesses operate and has
created new opportunities for entrepreneurs and consumers alike.
One of the primary benefits of e-commerce is that it offers a more convenient and efficient
way to conduct business. Consumers can browse and purchase products from the comfort
of their own homes, while businesses can reach a global audience without the need for a
physical storefront. E-commerce has also enabled businesses to streamline their operations
by automating many of the tasks involved in the sales process, such as inventory
management, order processing, and shipping.
E-commerce has continued to grow in popularity and importance, particularly in light of the
COVID-19 pandemic, which has led to a surge in online shopping as people seek to minimize
in-person interactions. As a result, businesses that are able to adapt to the e-commerce
landscape are likely to have a competitive advantage in the years to come.
E-commerce is also known as Electronic Commerce, refers to buying and selling of products
or services over the Internet. Normally e-commerce is used to refer to the sale of physical
products online, but it can also describe any kind of commercial transaction that is
facilitated through the internet. The first-ever online sale was in 1994 when a man sold a CD
by the band Sting to his friend through his website Net Market, an American retail platform.
This is the first example of a consumer buying a product from a business through the World
Wide Web or e-commerce as we commonly know it today. After that e-commerce has
evolved to make products easier to discover and purchase through online retailers and
marketplaces. All freelancers, as well as small and large businesses, have benefited from e-
commerce which enables them to sell their goods and services at a scale that was not
possible with traditional offline retail.
Features:
Product catalog: An e-commerce platform should provide an easy way to create and
manage a product catalog, including adding new products, editing existing ones, and
categorizing them.
Shopping cart: A shopping cart is a tool that allows customers to add products they want to
purchase and keep track of the items as they continue to browse the website.
Checkout and payment processing: A reliable checkout and payment processing system is
essential for e-commerce success. Customers should be able to complete transactions
quickly and easily using a variety of payment methods.
Shipping and order management: Once a customer places an order, the e-commerce
platform should provide tools to manage the order, including tracking information, shipping
options, and delivery status.
Customer accounts and loyalty programs: Many e-commerce platforms allow customers to
create accounts, which can help businesses build relationships and loyalty. Additionally,
loyalty programs can incentivize repeat purchases and encourage customers to refer others.
Marketing and analytics: An e-commerce platform should offer tools to help businesses
market their products, such as email campaigns and social media integration. Additionally,
analytics can help businesses track customer behavior, identify trends, and improve their
overall strategy.
Mobile optimization: With more people shopping on their mobile devices, it’s essential that
e-commerce platforms are mobile-optimized, with a responsive design that provides an
optimal shopping experience on smartphones and tablets.
Advantages of E-commerce:
E-commerce enables fast and secure shopping.
It is making digitalized world.
E-commerce also enables to choose different goods and services according to your
choice.
It is a simple way of selling and buying products and services.
E-commerce replaced the paper work as all transactions are through internet today.
It provides better management system, as it has a centralized database.
E-commerce via internet covers a large number of customers worldwide.
E-commerce has several payment modes.
Disadvantages of E-commerce:
E-commerce has no universal standard for quality and reliability.
E-commerce works through internet, it is possible that navigation on internet itself may
be slow.
Strong security is required in e-commerce as all transactions are through internet.
There is high risk of buying unsatisfactory products through e-commerce.
It uses public key infrastructure which is not safe.
Customers also trap in banking fraud which is quite frequent.
Hackers also try to get access of data or to destroy data in e-commerce.
Uses of E-commerce :
1. Online retail: One of the most well-known uses of e-commerce is online retail, where
businesses sell products directly to consumers through their online store, website, or
mobile app.
2. Digital products and services: E-commerce is also commonly used for the sale of digital
products and services, such as music, e-books, software, and online courses.
3. Business-to-business transactions: E-commerce can be used for B2B transactions, where
businesses sell products or services to other businesses.
4. Online marketplaces: E-commerce marketplaces, such as Amazon and eBay, provide a
platform for businesses and individuals to sell their products to a large audience.
5. Auction sites: Online auction sites, such as eBay, allow users to bid on and purchase
items from other users.
6. Online banking and financial services: E-commerce is used extensively for online
banking and financial services, including payment processing, bill payment, and money
transfers.
7. Online booking and reservations: E-commerce is used for booking and reservations of
flights, hotels, rental cars, and other travel-related services.
8. Food delivery: E-commerce platforms are used for online ordering and delivery of food
from restaurants.
9. Online advertising: E-commerce is also used for online advertising, where businesses
can advertise their products and services to a large audience.
There are many benefits of e-commerce for both businesses and consumers. Some of the
key benefits of e-commerce are:
1. Convenience: E-commerce allows customers to shop from the comfort of their own
homes or wherever they have internet access, making it convenient for them to make
purchases at any time.
2. Global Reach: E-commerce enables businesses to reach a wider audience beyond their
physical locations, allowing them to expand their customer base globally.
3. Cost-Effective: E-commerce eliminates the need for physical storefronts and reduces
overhead costs associated with operating a traditional brick-and-mortar store.
4. Personalization: E-commerce allows businesses to personalize their offerings based on
customer behavior and preferences, offering a more personalized shopping experience.
5. Easy and Secure Payment: E-commerce provides secure and convenient payment
options, making it easy for customers to make purchases.
6. Data Collection and Analysis: E-commerce provides businesses with the ability to collect
and analyze customer data, enabling them to improve their marketing and sales
strategies.
7. 24/7 Availability: E-commerce websites are always available for customers to access,
allowing them to make purchases at any time, even outside of business hours.
8. Overall, e-commerce provides businesses with new opportunities to expand their
customer base, increase sales, and improve customer satisfaction, while also offering
customers greater convenience, access, and flexibility.
Computer Virus
A computer virus is a type of malicious software program (“malware“) that, when executed,
replicates itself by modifying other computer programs and inserting its code. When
this replication succeeds, the affected areas are then said to be “infected“. Viruses can
spread to other computers and files when the software or documents they are attached to
are transferred from one computer to another using a network, a disk, file-sharing
methods, or through infected email attachments.
What is a Computer Virus?
A computer virus is a type of harmful program. When it runs, it makes copies of itself and
adds its code to other programs and files on your computer. These viruses come in different
types, and each type can affect your device differently. Simply put, a computer virus
changes how your computer works and aims to spread to other computers. It does this by
attaching itself to normal programs or documents that can run code, known as macros.
What Does a Computer Virus Do?
A virus can harm or destroy data, slow down system resources, and log keystrokes, among
other things. A virus can have unexpected or harmful outcomes during this procedure, such
as destroying system software by corrupting data. Some viruses are made to mess things up
by deleting files, messing up programs, or even wiping out your hard drive completely.
Even if they’re not super harmful, viruses can still slow down your computer a lot, using up
memory and making it crash often. Others might just make copies of themselves or send
so much stuff over the internet that it’s hard to do anything online.
Virus vs. Malware – What is the difference?
Viruses and malware are often used interchangeably, but they’re not quite the same. Here’s
how they differ:
Attacks the part of the computer that starts up when you turn it on.
Boot Sector
Boot Sector Virus can also spread through devices like floppy disks.
Virus
Often called a memory virus.
Attaches to the end of a file and modifies how a program starts to run
File Virus
the virus’s code first.
Polymorphic Changes its form every time it installs to avoid detection by antivirus
Virus software.
Multipartite Infects the computer’s boot sector, memory, and files, making it
Virus difficult to detect and remove.
Saves itself in the computer’s memory and can infect other files even
Resident Virus
after the original program stops.
Direct Action Tied to an executable file, it activates when the file is opened but does
Virus not delete files or affect system speed; blocks file access.
Type of Virus Description
One of the first and most widespread computer viruses, the Morris
Morris
Worm was a self-replicating program that spread across the
Worm
early Internet in 1988, causing delays and crashes on many devices.
Conclusion
In conclusion, understanding what a computer virus is and recognizing the dangers it poses
is crucial for keeping your data safe. These viruses are designed to infect, replicate,
and damage the functioning of computers. Protecting your computer with antivirus
software, being cautious with email attachments, and avoiding suspicious websites are
essential steps to prevent virus infections. By staying informed and attentive, you can help
safeguard your computer from the potential destruction caused by computer viruses.
Numeral System
Numeral System
b - Numeral system base
dn - the n-th digit
n – Can start from negative number if the number has a fraction part.
N+1 - the number of digits
Binary Numeral System - Base-2
Binary numbers uses only 0 and 1 digits.
B denotes binary prefix.
Examples:
101012 = 10101B = 1×24+0×23+1×22+0×21+1×20 = 16+4+1= 21
101112 = 10111B = 1×24+0×23+1×22+1×21+1×20 = 16+4+2+1= 23
1000112 = 100011B = 1×25+0×24+0×23+0×22+1×21+1×20 =32+2+1= 35
Octal Numeral System - Base-8
Octal numbers uses digits from 0..7.
Examples:
278 = 2×81+7×80 = 16+7 = 23
308 = 3×81+0×80 = 24
43078 = 4×83+3×82+0×81+7×80= 2247
Decimal Numeral System - Base-10
Decimal numbers uses digits from 0..9.
These are the regular numbers that we use.
Example:
253810 = 2×103+5×102+3×101+8×100
Hexadecimal Numeral System - Base-16
Hex numbers uses digits from 0..9 and A..F.
H denotes hex prefix.
Examples:
2816 = 28H = 2×161+8×160 = 40
2F16 = 2FH = 2×161+15×160 = 47
BC1216 = BC12H = 11×163+12×162+1×161+2×160= 48146
Numeral systems conversion table
Decimal Binary Octal Hexadecimal
Base-10 Base-2 Base-8 Base-16
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
16 10000 20 10
17 10001 21 11
18 10010 22 12
19 10011 23 13
20 10100 24 14
21 10101 25 15
22 10110 26 16
23 10111 27 17
24 11000 30 18
25 11001 31 19
26 11010 32 1A
27 11011 33 1B
28 11100 34 1C
29 11101 35 1D
30 11110 36 1E
31 11111 37 1F
32 100000 40 20
1. Decimal to Binary
(12)/2 6 0 0
(6)/2 3 0 1
(3)/2 1 1 2
(1)/2 0 1 3
= (1100)2
How to convert decimal to binary
Conversion steps:
1. Divide the number by 2.
2. Get the integer quotient for the next iteration.
3. Get the remainder for the binary digit.
4. Repeat the steps until the quotient is equal to 0.
Example #1
Convert 1310 to binary:
Division Quotien
Remainder Bit #
by 2 t
13/2 6 1 0
6/2 3 0 1
3/2 1 1 2
1/2 0 1 3
So 1310 = 11012
Example #2
Convert 17410 to binary:
Division Quotien
Remainder Bit #
by 2 t
174/2 87 0 0
87/2 43 1 1
43/2 21 1 2
21/2 10 1 3
10/2 5 0 4
5/2 2 1 5
2/2 1 0 6
1/2 0 1 7
So 17410 = 101011102
Decimal to binary conversion table
Decimal
Binary Hex
Numbe
Number Number
r
0 0 0
Decimal
Binary Hex
Numbe
Number Number
r
1 1 1
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
16 10000 10
17 10001 11
18 10010 12
19 10011 13
20 10100 14
21 10101 15
22 10110 16
Decimal
Binary Hex
Numbe
Number Number
r
23 10111 17
24 11000 18
25 11001 19
26 11010 1A
27 11011 1B
28 11100 1C
29 11101 1D
30 11110 1E
31 11111 1F
32 100000 20
64 1000000 40
128 10000000 80
power of 2: 25 24 23 22 21 20
0 0 0
1 1 1
10 2 2
11 3 3
100 4 4
101 5 5
110 6 6
111 7 7
1000 8 8
1001 9 9
1010 10 A
1011 11 B
1100 12 C
1101 13 D
1110 14 E
1111 15 F
10000 16 10
10001 17 11
10010 18 12
10011 19 13
10100 20 14
Binary Decimal Hex
Number Number Number
10101 21 15
10110 22 16
10111 23 17
11000 24 18
11001 25 19
11010 26 1A
11011 27 1B
11100 28 1C
11101 29 1D
11110 30 1E
11111 31 1F
100000 32 20
1000000 64 40
10000000 128 80
Convert every 4 binary digits (from bit0) to hex digit (see conversion table below):
1100
= 1100
=C
=C
Convert every 4 binary digits (start from bit 0) to 1 hex digit, with this table:
Binary Hex
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
Example
Convert binary 11011002 to hex:
Convert every 4 binary bits (from bit0) to hex digit:
11011002 = 110 1100 = 6 C = 6C16
Convert every hex digit (start lowest digit) to 4 binary digits, with this table:
Hex Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Example
Convert hex 6C16 to binary:
6C16 = 6 C = 110 1100 = 11011002