Chapter summaries, key syntax, important algorithms, exam tips and exercise overviews for all 13 chapters — 129 NCERT questions covered.
| Concept | Key Fact |
|---|---|
| Error | An error is a mistake or bug in a program that causes it to behave unexpectedly or terminate abnormally. Errors can be broadly categorized as syntax errors and exceptions (logical/runtime errors). |
| Exception | An exception is an error that occurs during the execution of a program, disrupting the normal flow of instructions. Unlike syntax errors, exceptions happen at run-time. |
| Syntax Error | A syntax error occurs when the Python parser encounters a statement that does not conform to the rules (syntax) of the Python language. The program will not execute until all syntax errors are corrected. |
| Traceback | A traceback is a report that Python generates when an exception occurs. It shows the sequence of function calls that led to the error, along with the file name, line number, and the type of exception. |
| SyntaxError | Raised when the Python parser encounters a syntax error in the code. Example: print('Hello' — missing closing parenthesis. |
| ValueError | Raised when a built-in operation or function receives an argument that has the right type but an inappropriate value. Example: int('abc') raises ValueError. |
| IOError | Raised when an I/O operation (such as open(), read(), write()) fails for an I/O related reason. Example: trying to open a file that does not exist. |
| KeyboardInterrupt | Raised when the user presses the interrupt key (usually Ctrl+C or Delete). This can be used to gracefully exit an infinite loop or long-running process. |
| ImportError | Raised when an import statement fails to find the specified module, or when a from...import fails to find the specified name in the module. |
| EOFError | Raised when the input() function hits an end-of-file condition (EOF) without reading any data. |
| ZeroDivisionError | Raised when the second operand of a division or modulo operation is zero. Example: 5/0 or 10%0. |
| IndexError | Raised when a sequence (list, tuple, string) index is out of range. Example: accessing list[5] when the list has only 3 elements. |
| NameError | Raised when a local or global name (variable, function, etc.) is not found. Example: using a variable that has not been defined. |
| IndentationError | Raised when there is incorrect indentation. It is a subclass of SyntaxError. Example: inconsistent use of tabs and spaces in indentation. |
| TypeError | Raised when an operation or function is applied to an object of inappropriate type. Example: '2' + 2 raises TypeError because a string and integer cannot be added. |
raise ExceptionType('error message')
ExceptionType can be any built-in or user-defined exception class
assert condition, 'error message'
If condition is False, AssertionError is raised with the optional message
try:
# statements that may raise exception
except ExceptionType:
# handler code
The except block executes only if the specified exception occurs in the try block
try:
# statements
except ValueError:
# handle ValueError
except ZeroDivisionError:
# handle ZeroDivisionError
Each except clause handles a different type of exception
try:
# statements
except ExceptionType:
# handle exception
else:
# runs only if no exception occurred
The else block is optional and runs when try succeeds without any exception
try:
# statements
except ExceptionType:
# handle exception
finally:
# always executes (cleanup code)
The finally block is guaranteed to execute in all circumstances
try:
# risky code
except ExceptionType:
# handle error
else:
# no exception occurred
finally:
# cleanup — always runs
This is the most complete form of exception handling in Python
| Concept | Key Fact |
|---|---|
| File | A file is a named location on a secondary storage medium (disk) used to store data permanently. It is a sequence of bytes stored on the disk. |
| File Handle | A file handle (or file object) is a reference to a file on disk. It is created by the open() function and is used to perform read, write, and other operations on the file. |
| Text File | A text file stores data in the form of characters (strings). Each line is terminated by a special character called EOL (End of Line), which is the newline character ('\n') in Python. Text files are human-readable. |
| Binary File | A binary file stores data in the same format as it is stored in memory (as bytes). Binary files are not human-readable and are used for storing images, audio, video, and serialized objects. |
| EOL (End of Line) | EOL is a special character that marks the end of a line in a text file. In Python, the default EOL character is '\n' (newline). On Windows, it is '\r\n'. |
| open() Function | The open() function is used to open a file and returns a file object. Syntax: file_object = open(filename, mode). The filename is a string representing the path to the file, and mode specifies how the file should be opened. |
| File Mode 'r' | Opens the file for reading only. The file pointer is placed at the beginning. This is the default mode. Raises FileNotFoundError if the file does not exist. |
| File Mode 'w' | Opens the file for writing only. If the file exists, its contents are overwritten (truncated). If the file does not exist, a new file is created. |
| File Mode 'a' | Opens the file for appending. Data is written at the end of the file. The file pointer is placed at the end. If the file does not exist, a new file is created. |
| File Mode 'r+' | Opens the file for both reading and writing. The file pointer is placed at the beginning. Raises FileNotFoundError if the file does not exist. |
| File Mode 'w+' | Opens the file for both writing and reading. If the file exists, its contents are overwritten. If the file does not exist, a new file is created. |
| File Mode 'a+' | Opens the file for both appending and reading. The file pointer is placed at the end. If the file does not exist, a new file is created. |
| with Statement | The with statement is used to open a file and ensures that the file is automatically closed when the block inside the with statement is exited, even if an exception occurs. Syntax: with open('file.txt', 'r') as f: |
| write() Method | The write() method writes a string to the file and returns the number of characters written. It does not add a newline character at the end. Syntax: file_object.write(string) |
| writelines() Method | The writelines() method writes a list (or any iterable) of strings to the file. It does not add newline characters between the strings. Syntax: file_object.writelines(list_of_strings) |
file_object = open(filename, mode)
Default mode is 'r'. Returns a file object (file handle).
file_object.close()
Flushes any unwritten data and closes the file. Good practice to always close files.
with open('filename', 'mode') as file_object:
# file operations
Automatically closes the file when the with block is exited
file_object.write(string)
Returns the number of characters written. Does not add newline automatically.
file_object.writelines(list_of_strings)
Writes each string from the list. No newline added between strings.
content = file_object.read([size])
Without argument, reads the entire file. With size, reads at most that many characters.
line = file_object.readline()
Reads one line including newline. Returns empty string '' at EOF.
lines = file_object.readlines()
Returns a list of all lines. Each line includes the trailing newline character.
position = file_object.tell()
Returns an integer representing the current position of the file pointer in bytes
file_object.seek(offset, reference_point)
reference_point: 0 = beginning (default), 1 = current, 2 = end. For text files, only 0 is allowed as reference_point.
import pickle
pickle.dump(object, file_object)
file_object must be opened in binary write mode ('wb' or 'ab')
import pickle
object = pickle.load(file_object)
file_object must be opened in binary read mode ('rb'). Raises EOFError when no more objects to read.
| Concept | Key Fact |
|---|---|
| Data Structure | A data structure is a particular way of organizing and storing data in a computer so that it can be accessed and modified efficiently. It defines the relationship between the data and the operations that can be performed on it. |
| Linear Data Structure | A linear data structure is one in which data elements are arranged in a sequential order, where each element has a predecessor and a successor (except the first and last elements). Examples: arrays, stacks, queues, linked lists. |
| Stack | A stack is a linear data structure that follows the LIFO (Last In First Out) principle. Elements can only be added (pushed) or removed (popped) from one end called the TOP of the stack. |
| LIFO | LIFO stands for Last In First Out. It means the last element added to the stack is the first element to be removed. The most recently pushed element is always at the top and is the first to be popped. |
| TOP | TOP is a pointer/variable that keeps track of the topmost element of the stack. It indicates the position where the next element will be added or from where the next element will be removed. |
| Overflow | Stack overflow occurs when an attempt is made to push an element onto a stack that is already full (has reached its maximum capacity). |
| Underflow | Stack underflow occurs when an attempt is made to pop an element from an empty stack (no elements to remove). |
| PUSH | PUSH is the operation of adding (inserting) a new element to the top of the stack. After a push operation, the new element becomes the topmost element and TOP is incremented. |
| POP | POP is the operation of removing (deleting) the topmost element from the stack. The element at TOP is removed and returned, and TOP is decremented. POP on an empty stack causes underflow. |
| Infix Notation | In infix notation, the operator is placed between the two operands. Example: A + B, (A + B) * C. This is the most commonly used notation by humans but requires parentheses to override operator precedence. |
| Prefix Notation (Polish Notation) | In prefix notation, the operator is placed before its operands. Example: + A B, * + A B C. Named after Polish mathematician Jan Lukasiewicz. Does not require parentheses. |
| Postfix Notation (Reverse Polish Notation) | In postfix notation, the operator is placed after its operands. Example: A B +, A B + C *. Also called Reverse Polish Notation (RPN). Does not require parentheses and is easy for computers to evaluate using a stack. |
| A stack | a linear data structure that follows the LIFO (Last In First Out) principle. |
| Elements can only be inserted (PUSH) or removed (POP) from the TOP of the stack. | |
| Stack overflow occurs when pushing to a full stack; underflow occurs when popping from an empty stack. |
Step 1: If stack is full, print 'Overflow' and return
Step 2: Increment TOP by 1
Step 3: Set stack[TOP] = element
Step 4: Return
In Python using list, we use append() which handles resizing automatically
Step 1: If stack is empty, print 'Underflow' and return
Step 2: Set element = stack[TOP]
Step 3: Decrement TOP by 1
Step 4: Return element
In Python using list, we use pop() which removes and returns the last element
stack = [] # empty stack
stack.append(element) # PUSH
element = stack.pop() # POP
top = stack[-1] # PEEK
len(stack) # SIZE
len(stack) == 0 # isEmpty
Python lists grow dynamically, so no overflow check needed for list-based stacks
** (exponentiation) > *, /, //, % > +, -
** is right-associative; all others are left-associative
A + B -> A B +
A + B * C -> A B C * +
(A + B) * C -> A B + C *
A + B * C - D -> A B C * + D -
(A + B) * (C - D) -> A B + C D - *
Follow operator precedence and associativity rules during conversion
1. Create an empty stack and output list
2. Scan the infix expression left to right:
a. If operand, add to output
b. If '(', push onto stack
c. If ')', pop and add to output until '(' is found; discard '('
d. If operator, pop and add to output while stack top has >= precedence (for left-assoc) or > precedence (for right-assoc); then push current operator
3. Pop all remaining operators from stack to output
Handle operator associativity: left-to-right for +, -, *, /; right-to-left for **
1. Create an empty stack
2. Scan the postfix expression left to right:
a. If operand, push onto stack
b. If operator, pop two operands (op2 = pop, op1 = pop), compute op1 operator op2, push result
3. The final element in the stack is the result
op1 is the second popped element, op2 is the first popped. Order: op1 operator op2.
| Concept | Key Fact |
|---|---|
| Queue | A queue is a linear data structure that follows the FIFO (First In First Out) principle. Elements are inserted at the rear end and removed from the front end. |
| FIFO | FIFO stands for First In First Out. It means the element that is inserted first is the first one to be removed. The oldest element in the queue is always at the front. |
| Front | Front is the end of the queue from which elements are removed (dequeued). It points to the first (oldest) element in the queue. |
| Rear | Rear is the end of the queue at which new elements are added (enqueued). It points to the last (newest) element in the queue. |
| Enqueue | Enqueue is the operation of adding (inserting) a new element at the rear end of the queue. After enqueue, the new element becomes the last element and the rear pointer is updated. |
| Dequeue | Dequeue is the operation of removing (deleting) an element from the front end of the queue. The element at the front is removed and returned, and the front pointer is updated. |
| Peek | Peek (or front) is the operation of viewing the front element of the queue without removing it. It returns the element that would be dequeued next. |
| Deque (Double-Ended Queue) | A deque (pronounced 'deck') is a linear data structure that allows insertion and deletion of elements from both the front and the rear end. It is a generalization of both stack and queue. |
| Input-Restricted Deque | An input-restricted deque is a deque where insertion is allowed only at one end (rear), but deletion is allowed from both ends (front and rear). |
| Output-Restricted Deque | An output-restricted deque is a deque where deletion is allowed only at one end (front), but insertion is allowed at both ends (front and rear). |
| A queue | a linear data structure that follows the FIFO (First In First Out) principle. |
| Elements are added at the rear end (enqueue) and removed from the front end (dequeue). | |
| Queue overflow occurs when inserting into a full queue; underflow occurs when removing from an empty queue. | |
| In Python, a queue can be implemented using a list: append() for enqueue and pop(0) for dequeue. | |
| A deque (double-ended queue) allows insertion and deletion from both the front and rear ends. |
Step 1: If queue is full, print 'Overflow' and return
Step 2: Increment rear by 1
Step 3: Set queue[rear] = element
Step 4: If front is -1, set front = 0
Step 5: Return
In Python using list, we use append() which adds to the end automatically
Step 1: If queue is empty, print 'Underflow' and return
Step 2: Set element = queue[front]
Step 3: Increment front by 1
Step 4: If front > rear, reset front = rear = -1 (queue empty)
Step 5: Return element
In Python using list, we use pop(0) which removes the first element
queue = [] # empty queue
queue.append(element) # Enqueue
element = queue.pop(0) # Dequeue
front = queue[0] # Peek
len(queue) # Size
len(queue) == 0 # isEmpty
pop(0) is O(n) — for better performance, use collections.deque
deque = [] # empty deque
deque.append(element) # Add at rear
deque.insert(0, element) # Add at front
element = deque.pop() # Remove from rear
element = deque.pop(0) # Remove from front
insert(0, elem) and pop(0) are O(n). For O(1), use collections.deque with appendleft() and popleft()
| Concept | Key Fact |
|---|---|
| Sorting | Sorting is the process of arranging data elements in a specific order, either ascending (increasing) or descending (decreasing), based on some key value. |
| In-place Sorting | A sorting algorithm is said to be in-place if it requires only a constant amount O(1) of extra memory space, apart from the input array. |
| Stable Sort | A sorting algorithm is stable if two elements with equal keys appear in the same order in the sorted output as they appear in the input. |
| Bubble Sort | Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted. |
| Pass | A pass is one complete traversal through the list during which adjacent elements are compared and swapped if necessary. In Bubble Sort, after each pass, the largest unsorted element moves to its correct position. |
| Selection Sort | Selection Sort is a sorting algorithm that repeatedly selects the smallest (or largest) element from the unsorted portion and places it at the beginning (or end) of the sorted portion. It divides the input list into a sorted and an unsorted region. |
| Insertion Sort | Insertion Sort is a sorting algorithm that builds a sorted array one element at a time by picking each element from the unsorted portion and inserting it into its correct position in the sorted portion, shifting elements as needed. |
| Key Element | The key element is the current element being picked from the unsorted portion to be inserted into its correct position in the sorted portion during Insertion Sort. |
| Time Complexity | Time complexity of an algorithm is a measure of the amount of time required by an algorithm to run as a function of the input size n. It provides an estimate of the number of elementary operations performed. |
| Big-O Notation | Big-O notation O(f(n)) describes the upper bound of the time complexity of an algorithm. It represents the worst-case scenario of how the running time grows relative to the input size n. |
| Best Case Complexity | The minimum number of operations an algorithm performs for an input of size n. For example, Bubble Sort best case is O(n) when the array is already sorted. |
| Worst Case Complexity | The maximum number of operations an algorithm performs for any input of size n. For example, Bubble Sort worst case is O(n^2) when the array is in reverse sorted order. |
| Average Case Complexity | The expected number of operations an algorithm performs over all possible inputs of size n. It gives a realistic estimate of algorithm performance. |
| Sorting | the process of arranging data elements in ascending or descending order. |
| Bubble Sort compares and swaps adjacent elements; largest element bubbles to the end in each pass. |
O(n^2)
Occurs when the array is sorted in reverse order. Total comparisons = n(n-1)/2.
O(n)
Occurs when the array is already sorted (with optimized version using a flag). Only one pass with n-1 comparisons and no swaps.
O(1)
In-place sorting algorithm; only requires a temporary variable for swapping.
(n-1) + (n-2) + ... + 1 = n(n-1)/2
In pass i, the number of comparisons is (n - i).
O(n^2)
Always performs n(n-1)/2 comparisons regardless of input order. Best, worst, and average cases are all O(n^2).
O(1)
In-place sorting algorithm.
n - 1
At most one swap per pass, making it efficient when swapping is costly.
O(n^2)
Occurs when the array is sorted in reverse order. Total comparisons and shifts = n(n-1)/2.
O(n)
Occurs when the array is already sorted. Only n-1 comparisons and no shifts needed.
O(n^2)
On average, each insertion requires shifting half of the sorted portion.
O(1)
In-place sorting algorithm; only needs a variable to hold the key.
O(1)
Time does not depend on input size. Example: accessing an array element by index.
O(n)
Time grows linearly with input size. Example: Linear Search.
O(n^2)
Time grows quadratically. Example: Bubble Sort, Selection Sort, Insertion Sort (worst case).
| Concept | Key Fact |
|---|---|
| Searching | Searching is the process of locating a given element (called the search key) in a collection of data. If the element is found, the search is successful and typically returns the position; otherwise, it is unsuccessful. |
| Search Key | The search key is the specific value or element that is being looked for within a data collection during a search operation. |
| Linear Search | Linear Search (or Sequential Search) is a searching algorithm that checks each element of a list sequentially, starting from the first element, until the desired element is found or the end of the list is reached. |
| Binary Search | Binary Search is an efficient searching algorithm that works on sorted lists by repeatedly dividing the search interval in half. It compares the target value with the middle element and eliminates half of the remaining elements in each step. |
| Divide and Conquer | Divide and Conquer is an algorithmic paradigm that breaks a problem into smaller sub-problems, solves each sub-problem, and combines the results. Binary Search divides the search space in half at each step. |
| Hashing | Hashing is a technique used to uniquely identify a specific object from a group of similar objects. It uses a hash function to map data of arbitrary size to fixed-size values (hash codes) that serve as indices in a hash table. |
| Hash Function | A hash function is a function that takes a key as input and returns an index (hash value) in the hash table where the corresponding value can be stored or retrieved. A common hash function is h(key) = key % table_size. |
| Hash Table | A hash table is a data structure that stores key-value pairs. It uses a hash function to compute an index into an array of slots, from which the desired value can be found. |
| Collision | A collision occurs when two different keys produce the same hash value (index) through the hash function. Collisions must be resolved to store both values. |
| Linear Probing | Linear probing is a collision resolution technique in which, if a collision occurs at index i, the algorithm sequentially checks i+1, i+2, i+3, ... (wrapping around) until an empty slot is found. |
| Chaining | Chaining is a collision resolution technique where each slot in the hash table holds a linked list (or Python list) of all elements that hash to the same index. |
| Searching | the process of finding a specific element in a collection of data. |
| Linear Search checks each element sequentially; time complexity | O(n). |
| Binary Search works on sorted data using divide and conquer; time complexity | O(log n). |
| Binary Search | significantly faster than Linear Search for large sorted datasets. |
O(1)
Element is found at the first position. Only 1 comparison needed.
O(n)
Element is at the last position or not present. All n elements are compared.
O(n)
On average, n/2 comparisons are needed. Still linear.
O(1)
Only a few variables are used regardless of input size.
O(1)
Element is found at the middle position in the first comparison.
O(1)
Iterative version uses constant extra space.
mid = (low + high) // 2
low is the start index and high is the end index of the current search range.
h(key) = key \% table\_size
The modulo operation ensures the hash value falls within the valid index range [0, table_size - 1].
O(1)
Average-case search, insert, and delete are constant time with a good hash function.
O(n)
Worst case occurs when all keys hash to the same index (all collisions).
| Concept | Key Fact |
|---|---|
| Data | Data is a collection of raw, unprocessed facts and figures. It can be in the form of numbers, text, images, audio, or video. Data by itself has no meaning until it is processed and interpreted. |
| Information | Information is data that has been processed, organized, and structured in a meaningful way. It provides context and is useful for decision making. |
| Qualitative Data | Qualitative data (also called categorical data) describes qualities or characteristics. It is non-numerical and includes categories such as colors, names, labels, and opinions. |
| Quantitative Data | Quantitative data represents measurable quantities and is expressed as numbers. It can be discrete (countable, e.g., number of students) or continuous (measurable, e.g., height, weight). |
| Primary Data | Primary data is data collected directly by the researcher for a specific research purpose through surveys, experiments, interviews, or direct observation. It is original and first-hand. |
| Secondary Data | Secondary data is data that has already been collected by someone else for a different purpose and is available for reuse. Examples include government reports, published research, and databases. |
| Survey | A survey is a data collection method that involves asking a set of questions to a group of people to gather information about their opinions, behaviors, or characteristics. |
| Sampling | Sampling is the process of selecting a representative subset (sample) from a larger population to make inferences about the entire population. |
| CSV File | A CSV (Comma-Separated Values) file is a plain text file that stores tabular data where each line represents a row and values within a row are separated by commas. |
| Structured Data | Structured data is data that is organized in a predefined format, typically in rows and columns (tables), making it easy to search, sort, and analyze. Examples include relational databases and spreadsheets. |
| Unstructured Data | Unstructured data is data that does not have a predefined format or organization. Examples include text documents, images, audio files, and social media posts. |
| Data Cleaning | Data cleaning (or data cleansing) is the process of identifying and correcting (or removing) errors, inconsistencies, and inaccuracies in a dataset to improve its quality. |
| Data Transformation | Data transformation is the process of converting data from one format, structure, or value to another. Examples include converting units, encoding categorical variables, and normalizing values. |
| Missing Value | A missing value is a data point that is absent from the dataset. Missing values can result from data entry errors, equipment malfunction, or non-response in surveys. |
| Imputation | Imputation is the process of replacing missing data with substituted values, such as the mean, median, or mode of the available data. |
| Concept | Key Fact |
|---|---|
| Database | A database is an organized collection of structured data (or information) stored electronically, so that it can be easily accessed, managed, and updated. |
| Database Management System (DBMS) | A Database Management System (DBMS) is a software system that provides an interface for users and applications to define, create, maintain, and control access to a database. It acts as an intermediary between the user and the database. |
| Data Redundancy | Data redundancy is the unnecessary duplication of data across multiple files. It wastes storage and can lead to data inconsistency when one copy is updated but others are not. |
| Data Inconsistency | Data inconsistency occurs when multiple copies of the same data have different values due to redundancy, leading to unreliable and conflicting information. |
| Data Isolation | Data isolation is a problem in file systems where data is scattered in various files with different formats, making it difficult to write programs to retrieve appropriate data. |
| Data Abstraction | Data abstraction hides the complexity of data storage from users. It has three levels: Physical level (how data is stored), Logical level (what data is stored and relationships), and View level (part of database relevant to a particular user). |
| Data Independence | Data independence is the ability to modify the schema at one level without affecting the schema at the next higher level. Physical data independence means changing storage without affecting logical schema. Logical data independence means changing logical schema without affecting external views. |
| Database Administrator (DBA) | A Database Administrator (DBA) is a person responsible for managing the database system, including defining the schema, setting access permissions, backup and recovery, performance tuning, and ensuring data security and integrity. |
| Relation (Table) | In the relational model, a relation is a two-dimensional table consisting of rows and columns. Each relation has a unique name and stores data about a particular entity. |
| Attribute (Column) | An attribute is a column in a relation (table) that represents a particular property of the entity. For example, in a STUDENT table, Name, RollNo, and Marks are attributes. |
| Tuple (Row) | A tuple is a single row in a relation (table) that represents one record or instance of the entity. Each tuple contains values for all attributes of the relation. |
| Domain | The domain of an attribute is the set of all permissible values that the attribute can take. For example, the domain of Marks might be integers from 0 to 100. |
| Degree | The degree of a relation is the number of attributes (columns) in the relation. For example, a table with columns RollNo, Name, Marks has degree 3. |
| Cardinality | The cardinality of a relation is the number of tuples (rows) in the relation. Cardinality changes as rows are inserted or deleted. |
| Schema | A relation schema defines the structure of a relation, including its name, attribute names, and their domains. Example: STUDENT(RollNo, Name, Class, Marks). |
| Concept | Key Fact |
|---|---|
| SQL (Structured Query Language) | SQL is a standard programming language used to manage and manipulate relational databases. It allows users to create, read, update, and delete data (CRUD operations) using declarative statements. |
| MySQL | MySQL is a popular open-source Relational Database Management System (RDBMS) that uses SQL for querying and managing databases. It is widely used in web applications. |
| Query | A query is a request for data or information from a database. In SQL, queries are written using statements like SELECT to retrieve specific data from one or more tables. |
| DDL (Data Definition Language) | DDL is a subset of SQL used to define and modify the structure of database objects such as databases, tables, and indexes. DDL commands include CREATE, ALTER, DROP, and TRUNCATE. |
| DML (Data Manipulation Language) | DML is a subset of SQL used to retrieve, insert, update, and delete data in database tables. DML commands include SELECT, INSERT, UPDATE, and DELETE. |
| DCL (Data Control Language) | DCL is a subset of SQL used to control access to data in the database. DCL commands include GRANT (to give permissions) and REVOKE (to remove permissions). |
| CHAR(n) | CHAR(n) is a fixed-length string data type that stores exactly n characters. If the stored string is shorter than n, it is padded with spaces. Maximum size: 255 characters. |
| VARCHAR(n) | VARCHAR(n) is a variable-length string data type that stores up to n characters. It uses only as much space as the actual string length plus 1-2 bytes for length information. Maximum size: 65,535 characters. |
| INT | INT (or INTEGER) is a numeric data type that stores whole numbers (no decimal places). Range: -2,147,483,648 to 2,147,483,647. |
| FLOAT | FLOAT is a numeric data type that stores approximate floating-point numbers (numbers with decimal places). It uses 4 bytes of storage. |
| DATE | DATE is a data type that stores date values in the format YYYY-MM-DD. Range: '1000-01-01' to '9999-12-31'. |
| NOT NULL Constraint | The NOT NULL constraint ensures that a column cannot contain NULL (empty) values. Every row must have a value for this column. |
| UNIQUE Constraint | The UNIQUE constraint ensures that all values in a column (or combination of columns) are distinct. No two rows can have the same value in a UNIQUE column. |
| PRIMARY KEY Constraint | The PRIMARY KEY constraint uniquely identifies each row in a table. It is a combination of NOT NULL and UNIQUE. A table can have only one primary key. |
| DEFAULT Constraint | The DEFAULT constraint provides a default value for a column when no value is specified during insertion. Example: DEFAULT 0 for marks. |
SELECT COUNT(*) FROM table_name;
COUNT(*) counts all rows. COUNT(column) counts non-NULL values.
SELECT SUM(column) FROM table_name;
Returns the total of all values in the column. NULL values are ignored.
SELECT AVG(column) FROM table_name;
Returns the average. NULL values are excluded from the calculation.
SELECT MAX(column), MIN(column) FROM table_name;
Returns the largest and smallest values respectively.
| Concept | Key Fact |
|---|---|
| Computer Network | A computer network is an interconnection of computers and other devices that can communicate with each other and share hardware, software, and data resources. |
| Node | Any device connected to a network that is capable of sending, receiving, or forwarding information is called a node. Examples include computers, printers, servers, and smartphones. |
| Server | A server is a computer on a network that provides services and resources (such as files, printers, or applications) to other computers (clients) on the network. |
| Client | A client is a computer on a network that requests and uses the services and resources provided by a server. |
| Peer-to-Peer Network | A network in which each computer can act as both a server and a client, sharing resources directly with other computers without a dedicated server. |
| ARPANET | Advanced Research Projects Agency Network (ARPANET) was the first wide-area packet-switching network, developed by the US Department of Defense in 1969. It initially connected four universities: UCLA, Stanford, UC Santa Barbara, and University of Utah. |
| NSFNET | National Science Foundation Network (NSFNET) was a network established in 1986 by the US National Science Foundation to connect five supercomputer centers. It eventually replaced ARPANET as the backbone of the Internet. |
| Internet | The Internet is a global network of interconnected computer networks that use the TCP/IP protocol suite to communicate. It evolved from ARPANET and NSFNET and became publicly accessible in the 1990s. |
| PAN (Personal Area Network) | A PAN is a network of personal devices such as smartphones, tablets, laptops, and wearable devices, typically within a range of about 10 metres. Examples include Bluetooth and infrared connections. |
| LAN (Local Area Network) | A LAN is a network that connects computers and devices within a small geographical area such as a room, building, or campus. It typically spans up to a few kilometres and offers high data transfer rates (10 Mbps to 1 Gbps or more). |
| MAN (Metropolitan Area Network) | A MAN is a network that spans a city or a large campus, typically covering a range of 5 to 50 kilometres. It connects multiple LANs within a metropolitan area. Cable TV network is an example of MAN. |
| WAN (Wide Area Network) | A WAN is a network that spans a large geographical area, such as a country or the entire world. The Internet is the largest WAN. WANs typically use leased telecommunication lines and satellites. |
| Modem | Modem (Modulator-Demodulator) is a device that converts digital signals from a computer into analog signals for transmission over telephone lines (modulation) and converts incoming analog signals back to digital form (demodulation). |
| Ethernet Card (NIC) | An Ethernet card or Network Interface Card (NIC) is a hardware component that connects a computer to a network using an Ethernet cable. Each NIC has a unique MAC address. It operates at speeds of 10/100/1000 Mbps. |
| RJ45 Connector | RJ45 (Registered Jack 45) is a standard connector used to connect Ethernet cables to network devices. It has 8 pins and is used with twisted pair cables for LAN connections. |
Number of links = n(n-1)/2, where n is the number of devices
Each device has (n-1) ports. For example, 5 devices need 5(4)/2 = 10 links.
Ports per device = n - 1
Each device must have (n-1) I/O ports to connect to every other device.
2^32 = 4,294,967,296 (approximately 4.3 billion)
32-bit address space, each octet ranges from 0 to 255
2^128 = approximately 3.4 x 10^38
128-bit address space, providing virtually unlimited addresses
| Concept | Key Fact |
|---|---|
| Data Communication | Data communication is the exchange of data (in the form of 0s and 1s) between two devices via some form of transmission medium such as a wire cable or wireless medium. |
| Sender | The sender (also called source or transmitter) is the device that generates and sends the message or data. It can be a computer, telephone, camera, or any other device. |
| Receiver | The receiver (also called destination) is the device that receives the message or data sent by the sender. It can be a computer, telephone, printer, or any other device. |
| Message | The message is the data or information to be communicated. It can be in the form of text, numbers, images, audio, video, or any combination of these. |
| Communication Medium | The communication medium (also called transmission medium or channel) is the physical path through which the message travels from sender to receiver. It can be wired (cable) or wireless (air, vacuum). |
| Protocol | A protocol is a set of rules that governs data communication. It defines the format, timing, sequence, and error control methods for data exchange between devices. Both sender and receiver must follow the same protocol. |
| Bandwidth | Bandwidth is the range of frequencies available for transmission of data on a communication channel. It determines the maximum data transfer rate of the channel. Higher bandwidth means more data can be transmitted per unit time. |
| Data Transfer Rate | Data transfer rate (also called bit rate) is the number of bits transmitted per second over a communication channel. It is measured in bits per second (bps). |
| Simplex Communication | In simplex mode, communication is unidirectional — data can flow in only one direction. Only one device can transmit and the other can only receive. Examples: keyboard to computer, radio broadcasting, TV broadcasting. |
| Half-Duplex Communication | In half-duplex mode, data can flow in both directions but not simultaneously. Only one device can transmit at a time while the other receives. Example: walkie-talkie. |
| Full-Duplex Communication | In full-duplex mode, data can flow in both directions simultaneously. Both devices can transmit and receive at the same time. Example: telephone conversation, video calling. |
| Circuit Switching | In circuit switching, a dedicated communication path (circuit) is established between the sender and receiver before data transfer begins. The circuit remains reserved for the entire duration of the communication, even if no data is being transmitted. Example: traditional telephone network (PSTN). |
| Packet Switching | In packet switching, the message is broken into smaller units called packets. Each packet is sent independently and may take different routes to reach the destination. Packets are reassembled at the destination in the correct order. Example: the Internet. |
| Packet | A packet is a small unit of data that includes the actual data (payload), source address, destination address, sequence number, and error-checking information. Packets are the fundamental units of data in packet-switched networks. |
| Message Switching | In message switching, the entire message is sent from node to node. Each intermediate node stores the complete message and then forwards it to the next node (store-and-forward). No dedicated path is established. |
1 Kbps = 1,024 bps (or 10^3 bps); 1 Mbps = 1,024 Kbps (or 10^6 bps); 1 Gbps = 1,024 Mbps (or 10^9 bps); 1 Tbps = 1,024 Gbps (or 10^12 bps)
bps = bits per second, Kbps = Kilobits per second, Mbps = Megabits per second, Gbps = Gigabits per second, Tbps = Terabits per second
Time = File Size (in bits) / Data Transfer Rate (in bps)
Remember to convert file size from bytes to bits (multiply by 8) if given in bytes
| Concept | Key Fact |
|---|---|
| Cyber Threat | A cyber threat is any malicious activity or potential danger that targets computer systems, networks, or data. Threats can come from malware, hackers, phishing attacks, or other sources aiming to steal, damage, or disrupt digital assets. |
| Cyber Security | Cyber security refers to the practice of protecting computers, servers, networks, data, and electronic systems from digital attacks, unauthorized access, damage, or theft. It involves technologies, processes, and practices designed to safeguard information. |
| Cyber Crime | Cyber crime is any criminal activity that involves a computer, network, or digital device. It includes hacking, identity theft, phishing, cyberstalking, online fraud, and spreading malware. |
| Malware | Malware (malicious software) is any software intentionally designed to cause damage to a computer, server, network, or user. Types include viruses, worms, trojans, spyware, adware, and ransomware. |
| Virus | A computer virus is a malicious program that attaches itself to a legitimate program or file and replicates itself when the host program is executed. It spreads from one computer to another through infected files, email attachments, or removable media. It requires human action to spread. |
| Worm | A worm is a standalone malicious program that replicates itself and spreads automatically across networks without attaching to a host program or requiring human action. Worms exploit network vulnerabilities and can consume bandwidth and system resources. |
| Trojan Horse | A Trojan horse (or Trojan) is a malicious program disguised as legitimate or useful software. Unlike viruses and worms, Trojans do not replicate themselves. They trick users into installing them and then perform harmful actions such as stealing data, creating backdoors, or downloading other malware. |
| Spyware | Spyware is malicious software that secretly monitors and collects user information such as browsing habits, keystrokes, passwords, and personal data without the user's knowledge or consent. It transmits this information to a third party. |
| Adware | Adware is software that automatically displays or downloads unwanted advertisements on a user's computer. While not always malicious, it can slow down systems, track browsing habits, and redirect browsers to advertising sites. |
| Ransomware | Ransomware is a type of malware that encrypts the victim's files or locks them out of their system and demands a ransom payment (usually in cryptocurrency) to restore access. Examples include WannaCry and Petya. |
| Antivirus Software | Antivirus software is a program designed to detect, prevent, and remove malware (viruses, worms, trojans, spyware, etc.) from a computer. It scans files, monitors system activity, and provides real-time protection. Examples: Norton, McAfee, Kaspersky, Avast, Windows Defender. |
| Virus Signature | A virus signature (or virus definition) is a unique pattern of code or data that identifies a specific virus. Antivirus software maintains a database of known virus signatures and compares files against this database during scanning. |
| Spam | Spam refers to unsolicited, unwanted messages (usually emails) sent in bulk to a large number of recipients. Spam messages often contain advertisements, phishing links, or malware. They clog inboxes and waste bandwidth. |
| Spam Filter | A spam filter is a program or feature that detects and blocks unwanted spam messages from reaching a user's inbox. It works by analyzing message content, sender reputation, and known spam patterns. |
| HTTP | HTTP (HyperText Transfer Protocol) is a protocol for transferring data on the web. Data is sent in plain text, making it vulnerable to interception and eavesdropping. It uses port 80. |
| Concept | Key Fact |
|---|---|
| Project Based Learning (PBL) | Project Based Learning is an instructional methodology where students learn by actively working on meaningful projects over an extended period. Students investigate and respond to real-world problems, developing deeper knowledge and skills through hands-on experience. |
| Project | A project is a planned piece of work that involves investigation and creation of something, carried out over a period of time. In computer science, a project typically involves identifying a problem, designing a solution, writing code, and testing the final product. |
| Problem Identification | The first step in project development where the problem to be solved is clearly defined. This involves understanding the requirements, identifying the target users, and determining the scope and objectives of the project. |
| Planning and Analysis | The phase where the project requirements are analyzed in detail, resources are identified, a timeline is created, and a plan is developed. This includes deciding on programming language, database, and tools to be used. |
| Design | The phase where the solution architecture is planned. This includes designing the user interface, database schema, data flow diagrams, and algorithms. The design serves as a blueprint for implementation. |
| Implementation | The phase where the actual code is written based on the design. This involves programming the solution using the chosen language and tools, creating the database, and building the user interface. |
| Testing | The phase where the developed software is tested for errors (bugs), correctness, and performance. Types include unit testing (individual components), integration testing (combined components), and user acceptance testing. |
| Debugging | Debugging is the process of finding and fixing errors (bugs) in the code. It involves identifying the cause of incorrect behaviour, locating the faulty code, and correcting it. |
| Deployment | The phase where the completed and tested software is released to users. This includes installation, configuration, and making the application available for actual use. |
| Teamwork | Teamwork is the collaborative effort of a group of individuals working together to achieve a common goal. In software projects, teamwork involves dividing tasks, communicating effectively, resolving conflicts, and combining individual contributions into a complete product. |
| Version Control | Version control is a system that records changes to files over time, allowing you to recall specific versions later. It helps team members work on the same project simultaneously without overwriting each other's work. Examples: Git, SVN. |
| Project Manager | A project manager is the person responsible for planning, executing, and closing a project. They coordinate team activities, manage timelines and resources, and ensure the project meets its objectives. |
| Library Management System | A software application for managing library operations including cataloguing books, tracking book issues and returns, managing member records, calculating fines, and generating reports. It typically uses a database (like MySQL) and a programming language (like Python). |
| Student Database Management System | A software application for managing student records including personal details, enrollment information, marks, attendance, and reports. It uses database operations (CRUD — Create, Read, Update, Delete) to manage student data. |
| Quiz Application | A software application that presents questions to users, accepts answers, calculates scores, and displays results. It can be built using Python with a text-based or graphical interface, storing questions in a file or database. |