Informatics Practices cheat sheet
8 chapters. In each, the formulas come first, then the key facts. The number beside a line is the NCERT page it is printed on.
8 chapters · 18 formulas · 330 key facts
- 1Start hereComputer SystemInformatics Practices · 10 formulas · 41 key factsRead
- 2Emerging TrendsInformatics Practices · 42 key factsRead
- 3Brief Overview of PythonInformatics Practices · 42 key factsRead
- 4Working with Lists and DictionariesInformatics Practices · 38 key factsRead
- 5Understanding DataInformatics Practices · 3 formulas · 38 key factsRead
- 6Introduction to NumPyInformatics Practices · 5 formulas · 42 key factsRead
- 7Database ConceptsInformatics Practices · 44 key factsRead
- 8Introduction to Structured Query Language (SQL)Informatics Practices · 43 key factsRead
Computer System
4 topics · 10 formulas · 41 facts
- 1Introduction to Computer System
- 2Evolution of Computer
- 3Computer Memory
- 4Software
- Nibblep.6
- Bytep.6
- Kilobyte (KB)p.6
- Megabyte (MB)p.6
- Gigabyte (GB)p.6
- Terabyte (TB)p.6
- Petabyte (PB)p.6
- Exabyte (EB)p.6
- Zettabyte (ZB)p.6
- Yottabyte (YB)p.6
A computer is an electronic device that can be programmed to accept data as input, process it, and generate results as output.
p.1A computer system primarily comprises a central processing unit, memory, input/output devices, and storage devices that function together as a single unit.
p.1The Central Processing Unit carries out actual data processing and is placed on one or more integrated circuit microchips made of semiconductor materials.
p.2The CPU fetches instructions and data from memory, performs arithmetic and logical operations, and stores the resulting data back into memory.
p.2Registers are high-speed local memory units on the CPU chip, limited in size and number, used to store data, instructions, or intermediate results during processing.
p.2The Arithmetic Logic Unit (ALU) performs all arithmetic and logical operations required as per program instructions.
p.2The Control Unit (CU) interprets instructions, controls sequential instruction execution, and guides data flow through computer memory, ALU, and input or output devices.
p.2Input devices send control signals to the computer and convert incoming data into a digital form acceptable by the computer system.
p.2Output devices receive digital data from a computer system and convert it into human-understandable visual, auditory, or physical form.
p.3A braille display monitor assists visually challenged individuals in understanding textual output generated by a computer.
p.3Three commonly used physical output printers are inkjet, laserjet, and dot matrix, while 3D printers build physical replicas of digital three-dimensional designs.
p.3The Von Neumann architecture consists of a Central Processing Unit (CPU), memory to store data and programs, input/output devices, and communication channels.
p.3Electronic Numerical Integrator And Computer (ENIAC) was the first binary programmable computer built based on the Von Neumann architecture.
p.3Blaise Pascal invented the Pascaline mechanical calculator in 1642 to perform addition and subtraction directly, and multiplication and division through repeated additions or subtractions.
p.4Charles Babbage designed the Analytical Engine in 1834 as a mechanical computing device for inputting, processing, storing, and displaying output, which forms the basis of modern computers.
p.4Herman Hollerith designed the tabulating machine in 1890 to summarize data stored on punched cards, marking the first step towards programming.
p.4In 1947, vacuum tubes were replaced by transistors developed at Bell Labs using semiconductor materials, significantly increasing computer reliability and reducing size.
p.4Large Scale Integration (LSI) in the 1970s allowed the integration of an entire CPU on a single silicon microchip, known as a microprocessor.
p.4Moore’s Law predicted that the number of transistors on a microchip would double approximately every two years while the cost would be halved.
p.4In the 1980s, Very Large Scale Integration (VLSI) integrated around 3 million components on a small-sized chip, followed by Super Large Scale Integration (SLSI).
p.4Binary digits 0 and 1, known as bits, are the basic units of computer memory used to store and process data.
p.5Primary memory is directly accessible by the CPU for read and write operations and is divided into Random Access Memory (RAM) and Read Only Memory (ROM).
p.6RAM is volatile main memory that holds programs and data temporarily while the computer is operating, losing all stored contents when power is turned off.
p.6ROM is non-volatile permanent memory that retains startup programs, such as the boot loader that loads the operating system into RAM, even when power is lost.
p.6Cache memory is a very high-speed memory placed between the CPU and primary memory that stores copies of frequently accessed data to reduce memory access time.
p.7Secondary memory is non-volatile, cheaper, and has larger capacity than primary memory, but its contents must be transferred to main memory before CPU processing.
p.7Solid-State Drives (SSDs) support significantly faster data transfer speeds compared to traditional magnetic Hard Disk Drives (HDDs).
p.7When data is deleted, its address entry is marked as free without wiping data at the bit level, allowing the space to be reported as empty to the user.
p.8Recovery of deleted data from secondary storage is possible only if the physical memory space marked as deleted has not been overwritten by new data.
p.8To prevent unauthorized data recovery and protect confidentiality, data shredding tools must be used before disposing of faulty or old storage devices.
p.9Hardware comprises the physical components of a computer that can be touched, whereas software comprises sets of instructions and data that make the hardware functional.
p.9Software acts as an interface between human users and the hardware, making the computer hardware operational and enabling components to communicate.
p.10System software interacts directly with computer hardware to provide core operational capabilities and services for users and other application programs.
p.10An operating system is the essential system software that operates the computer, manages application programs, and provides security and user access control.
p.10System utilities are programs designed for computer maintenance and performance optimization, such as disk defragmenters, disk cleaners, and antivirus tools.
p.10A device driver acts as a mediator and translator between the operating system and an attached peripheral device, managing its hardware-level operations.
p.11A computer system can work in the absence of application software, but it cannot operate without system software like an operating system.
p.11General purpose software consists of pre-packaged application programs developed for generic tasks to cater to a broad audience, such as LibreOffice Calc and web browsers.
p.11Customized software is tailor-made application software developed specifically to fulfill the unique requirements of a particular individual or organization.
p.12Free and Open Source Software (FOSS) permits users to freely execute, study, modify, and distribute the software along with its source code.
p.12Freeware is distributed free of cost for use without access to its source code, whereas proprietary software requires purchase from a copyright holder.
p.12
Emerging Trends
7 topics · 42 facts
- 1Introduction to Emerging Trends
- 2Artificial Intelligence (AI)
- 3Big Data
- 4Internet of Things (IoT)
- 5Cloud Computing
- 6Grid Computing
- 7Blockchains
Emerging trends are state-of-the-art technologies that gain widespread popularity, persist over time, and make a significant impact on digital economy and digital societies.
p.15Unlike short-lived technologies that fail and fade away over time, emerging trends prosper and continually evolve by attracting sustained user attention and adoption.
p.15Artificial Intelligence endeavours to simulate human natural intelligence into machines, enabling them to imitate cognitive functions like learning, decision making, and problem solving.
p.16A knowledge base in an AI system is a store of information consisting of facts, assumptions, and rules that the system uses to make decisions with minimum human intervention.
p.16Machine Learning is a subsystem of AI wherein algorithms called models learn from data using statistical techniques without being explicitly programmed by humans.
p.16Machine learning models are trained and tested using training data and testing data respectively, and once acceptable accuracy is achieved, they make predictions on new data.
p.16Natural Language Processing deals with human-computer interaction using spoken human languages, enabling text-to-speech, speech-to-text conversion, and machine translation.
p.17Virtual Reality is a three-dimensional computer-generated environment simulating the real world, immersing the user through VR headsets and sensory inputs like sound and motion.
p.17Augmented Reality superimposes computer-generated perceptual information over the physical surroundings without creating a new environment, making it digitally manipulable.
p.18Location-based Augmented Reality applications allow users to access real-time reviews and information about historical places or nearby sites by pointing a smartphone camera.
p.18A robot is a programmable machine capable of carrying out tasks automatically with precision using sensors, ranging from wheeled and legged robots to humanoids like Sophia.
p.18Drones are unmanned aircraft that fly autonomously or via remote control using software flight plans, embedded systems, onboard sensors, and GPS for applications like mapping.
p.18Big Data refers to datasets of enormous volume and complexity that cannot be processed and analysed using traditional DBMS tools, with billions of users generating colossal data.
p.19A major portion of Big Data consists of unstructured formats such as social media posts, instant chats, photographs, tweets, and audio-video interactions.
p.20The five distinct characteristics of Big Data that distinguish it from traditional data sets are Volume, Velocity, Variety, Veracity, and Value.
p.20Velocity represents the exponentially high rate at which data is generated and stored, while Variety indicates diverse formats including structured, semi-structured, and unstructured data.
p.20Veracity refers to the trustworthiness of data, addressing inconsistencies, noise, and bias to prevent incorrect processing and misleading interpretations.
p.20Value refers to hidden patterns and actionable knowledge discovered in Big Data, requiring preliminary enquiry to ensure potential business returns justify processing costs.
p.20Data analytics is the process of examining datasets using specialised systems and software to draw conclusions, verify scientific hypotheses, and support informed business decisions.
p.21Pandas is an open-source Python library that provides high-level data structures and tools to make data analysis and manipulation much simpler.
p.21The Internet of Things is a network of devices embedded with hardware like microcontrollers and software to connect and exchange data with other devices on the same network.
p.21Connecting household appliances such as air conditioners, microwave ovens, door locks, and CCTV cameras to IoT allows users to remotely control and monitor them via smartphones.
p.22Web of Things allows the use of web services to integrate physical devices into the web, enabling heterogeneous devices to communicate through a unified web interface.
p.22In mobile devices, the accelerometer sensor detects the physical orientation of the phone, while the gyroscope sensor tracks rotation and twisting motions of the hand.
p.22A smart sensor is a device that takes input from the physical environment, uses built-in computing resources to perform predefined functions, and processes data before passing it on.
p.22Smart cities utilize computer networks, IoT, and WoT to monitor urban infrastructure such as detecting building tremors, bridge cracks, and tunnel congestion with wireless sensor nodes.
p.23Cloud computing delivers on-demand computer-based services including servers, databases, storage, and software over the Internet on a pay-per-use utility model.
p.23Cloud computing eliminates the need for expensive local processing power or storage by enabling users to execute large applications and store backups remotely via the Internet.
p.24Infrastructure as a Service offers remote computing infrastructure like servers, virtual machines, storage, and networking that users configure, deploy, and pay for as per usage.
p.24Platform as a Service provides a pre-configured platform to develop, test, and deliver software applications without requiring users to purchase or manage underlying system software.
p.25Software as a Service provides on-demand subscription access to application software like Google Docs or Microsoft Office 365 without requiring local installation or configuration.
p.25MeghRaj is the Government of India initiative known as GI Cloud that harnesses the benefits of cloud computing to provide reliable, scalable public digital services.
p.25Grid computing is a computer network of geographically dispersed and heterogeneous computational resources that temporarily pool their power to solve a single large task.
p.25Unlike cloud computing which primarily delivers services, a computing grid is application-specific and acts like a virtual supercomputer with enormous processing power.
p.25A Data Grid manages large distributed datasets requiring multi-user access, whereas a CPU or Processor Grid divides large computational jobs into subtasks for parallel execution.
p.26The Globus Toolkit is an open-source software middleware used to build computing grids by handling security, resource management, data management, and fault detection.
p.26Blockchain technology operates on a decentralized, shared database where each participating computer node maintains an identical copy of the transactional ledger.
p.26In a blockchain, each block consists of a publicly visible header across all network nodes and protected private transaction data accessible exclusively to its owner.
p.27A blockchain functions as an append-only distributed ledger that is updated only after all participating nodes in the network authenticate and verify the transaction.
p.27Data security and immutability in a blockchain are guaranteed because no single node can alter stored data without consensus from all members keeping copies of the ledger.
p.27Beyond digital currency, blockchain technology is applied in healthcare for secure data sharing, in land registration to avoid ownership disputes, and in transparent voting systems.
p.27Blockchain promotes operational transparency, accountability, and fraud prevention across diverse industries including banking, media, telecommunications, and hospitality.
p.28
Brief Overview of Python
12 topics · 42 facts
- 1Introduction to Python
- 2Python Keywords and Identifiers
- 3Variables
- 4Data Types
- 5Operators
- 6Expressions
- 7Input and Output
- 8Debugging
- 9Functions
- 10If..else Statements
- 11For Loop
- 12Nested Loops
Python is a high-level, interpreter-based programming language created by Guido van Rossum in 1991 for general-purpose programming, web development, and scientific computing.
p.31In interactive mode, the Python interpreter executes statements typed directly at the prompt >>> immediately and displays results, but it cannot save statements for future use.
p.32In script mode, Python programs are saved in files with a .py extension and executed by the interpreter, allowing multi-line programs to be permanently saved and reused.
p.33Keywords are reserved words that carry specific predefined meanings to the Python interpreter and must be written strictly in the specified case because Python is case-sensitive.
p.34An identifier must begin with an uppercase or lowercase letter or an underscore (_), followed by letters, digits, or underscores, and it cannot begin with a digit.
p.34Identifiers can be of any length but cannot contain special symbols such as !, @, #, $, or %, and cannot be a Python keyword.
p.34A variable is a named identifier that refers to a value that can change during program execution, and each variable name must be unique within a program.
p.34Variables must always be assigned a value using an assignment statement before they are used in an expression, otherwise an error occurs.
p.35In Python, a single-line comment begins with a hash sign (#) and everything following it until the end of that line is ignored by the interpreter.
p.35Python classifies numbers into three distinct types: int for integers, float for floating-point real numbers, and complex for complex numbers.
p.36The bool data type is a subtype of integer consisting of two constants: True (representing non-zero) and False (representing zero).
p.36A sequence is an ordered collection of items indexed by integers, which includes immutable strings, mutable lists, and immutable tuples.
p.36Lists are enclosed in square brackets [] and can hold mutable elements of different data types, whereas tuples are enclosed in parentheses () and are immutable once created.
p.37A tuple is an ordered sequence of comma-separated items enclosed in parentheses () whose elements cannot be changed once created.
p.37A dictionary is an unordered mapping of key-value pairs enclosed in curly brackets {}, where values are accessed using their corresponding keys in square brackets [].
p.38The addition operator (+) concatenates two sequences, while the multiplication operator (*) replicates a sequence when multiplied by an integer.
p.38The floor division operator (//) divides operands and returns the quotient by removing the decimal part, while the modulus operator (%) returns the remainder.
p.39The exponentiation operator (**) raises the base operand to the power of the exponent operand.
p.39Relational operators compare operand values and evaluate to either True or False, comparing strings lexicographically using their ASCII values.
p.40Python supports three logical operators written strictly in lowercase: and, or, and not.
p.40The membership operators in and not in test whether a given value exists within a sequence, returning True or False accordingly.
p.41An expression is a valid combination of constants, variables, and operators that always evaluates to a single value, whereas a standalone operator is not an expression.
p.41Operators with higher precedence are evaluated before lower precedence operators, but parentheses () can be used to override operator precedence.
p.42The input() function prompts the user for keyboard input and always returns the entered data as a string.
p.43To use user input in mathematical operations, the string returned by input() must be explicitly typecast to a numeric type using int() or float().
p.43The print() function evaluates the expressions passed to it and displays the resulting output on the standard output device.
p.43Debugging is the process of identifying and removing errors from a computer program to ensure it executes correctly.
p.44A syntax error occurs when code violates Python grammatical rules, causing the interpreter to show an error message and immediately stop execution.
p.44A logical error (semantic error) occurs when a program executes successfully without stopping but produces incorrect or undesired output.
p.44A runtime error occurs when a syntactically correct statement fails during execution due to an invalid operation, such as division by zero.
p.44A function is a named set of instructions that performs a specific task, which can be defined once and reused at multiple places by calling its name.
p.44A module is a Python file containing grouped functions that can be imported and reused in another program using the import statement.
p.45Arguments are values passed to a function within parentheses during a function call, and the function can return one or more results to the calling point.
p.45Built-in type conversion functions include int(), float(), str(), bool(), chr(), ord(), list(), tuple(), dict(), and set().
p.46The if statement evaluates a test condition and executes the statements in its indented body only if the condition evaluates to True.
p.46In an if..else statement, the if block executes when the condition is True, and the else block executes when the condition is False.
p.47The if..elif..else construct evaluates conditions sequentially, executing only the block of the first condition that evaluates to True and terminating the construct.
p.47Python associates statements into code blocks strictly using indentation (leading whitespace), and inconsistent indentation produces syntax errors.
p.47The for loop iterates over items of a sequence or range of values, executing the loop body once for each item until all items are exhausted.
p.48The range([start], stop[, step]) function generates a sequence of integers from start up to but excluding stop, incrementing by step.
p.49In range(), start defaults to 0 and step defaults to 1, while step can be any positive or negative integer excluding zero.
p.49A nested loop is a loop placed inside another loop, wherein the inner loop executes all its iterations for every single iteration of the outer loop.
p.50
Working with Lists and Dictionaries
9 topics · 38 facts
- 1Introduction to List
- 2List Operations
- 3Traversing a List
- 4List Methods and Built-in Functions
- 5List Manipulation
- 6Introduction to Dictionaries
- 7Traversing a Dictionary
- 8Dictionary Methods and Built-in Functions
- 9Manipulating Dictionaries
In Python, a list is an ordered mutable sequence of elements enclosed in square brackets and separated by commas, capable of holding mixed data types including numbers, strings, tuples, or other lists.
p.55List elements are accessed using zero-based indexing for forward access and negative indexing starting at -1 for backward access, where -n refers to the first element in a list of length n.
p.56Attempting to access a list element using an index that is outside the valid index range raises an IndexError.
p.56Lists are mutable in Python, meaning existing elements can be modified, replaced, or updated in-place using index assignment without creating a new list object.
p.57The concatenation operator + joins two or more lists into a new list without altering the original lists, and concatenating a list with a non-list operand raises a TypeError.
p.57The repetition operator * replicates the elements of a list a specified number of times to produce a new list without modifying the original list.
p.58The membership operator in evaluates to True if a specified element is present in the list and False otherwise, while not in evaluates to True if the element is absent.
p.58List slicing creates a new list from an existing list; if the stop index exceeds the list length, it truncates safely at the end of the list rather than raising an IndexError.
p.58Using a negative step size such as list[::-1] in a slice operation creates a new list with elements arranged in reverse order.
p.59Traversing a list involves visiting each of its elements sequentially, which can be accomplished using a for loop iterating directly over the items.
p.59A list can also be traversed by index using a for loop combined with range(len(list1)), where range(n) generates integers from 0 to n-1.
p.59The append() method adds a single element to the end of a list in-place, whereas extend() iterates through an iterable passed as an argument and appends each of its elements individually.
p.60The insert(index, element) method places an element at the specified index position, shifting subsequent elements to the right without overwriting them.
p.60The index() method returns the index of the first occurrence of a specified element in a list, raising a ValueError if the element is not found.
p.61The remove(x) method deletes the first occurrence of value x from the list in-place, raising a ValueError if x is not present.
p.61The pop() method removes and returns the element at the specified index, or removes and returns the last element of the list if no index argument is provided.
p.61The sort() method sorts elements of a list in-place in ascending order or descending order with reverse=True, modifying the original list and returning None.
p.61The built-in sorted() function returns a new sorted list from an iterable without modifying the original list, whereas min(), max(), and sum() return the smallest, largest, and total of list items.
p.62In menu-driven list manipulation, an existing element at index i can be updated by direct assignment myList[i] = newElement provided that index i is within the bounds of the list.
p.63To delete an element safely by value in a program, the membership operator in can verify its existence before invoking remove() to prevent a ValueError runtime crash.
p.64In list accumulation algorithms, an empty list initialized as [] dynamically stores input values using append(), allowing aggregate calculations such as total sum and average.
p.65Linear search on a list sequentially compares each element against the target value across the index range 0 to len(list1)-1 to determine its presence and position.
p.66A Python dictionary is a mapping data type consisting of key-value pairs called items enclosed in curly braces {}, where each key is separated from its value by a colon.
p.67Dictionary keys must be unique and belong to immutable data types such as strings, numbers, or tuples, while values can be duplicated and of any arbitrary data type.
p.67Accessing a dictionary value using square bracket notation with a non-existent key raises a KeyError.
p.68Membership operators in and not in test for the presence or absence of a specified key in a dictionary, not its values.
p.68Dictionaries are mutable, allowing new key-value pairs to be added using assignment syntax dict1[new_key] = value after the dictionary has been created.
p.68Assigning a value to an existing key in a dictionary overwrites the previous value mapped to that key in-place without creating a duplicate key.
p.69Iterating over a dictionary directly with a for loop yields each key in insertion order, from which corresponding values can be retrieved using dict[key].
p.69A dictionary can be traversed simultaneously for both keys and values using a for loop with dict.items(), which yields key-value tuple pairs on each iteration.
p.69The built-in len(dict) function returns the total number of key-value pairs or items contained within the dictionary.
p.69The get(key) method returns the value mapped to a given key, or None if the key does not exist in the dictionary, avoiding a KeyError exception.
p.70The keys(), values(), and items() methods return view objects displaying all keys, all values, and all (key, value) tuple pairs of the dictionary respectively.
p.70The update() method merges key-value pairs from another dictionary into the target dictionary, inserting new keys and overwriting values of existing keys.
p.70The del statement deletes a specific key-value pair from a dictionary using del dict[key], or removes the entire dictionary object from memory when applied as del dict_name.
p.71User-supplied tabular records such as employee names and salaries can be stored in a dictionary by reading inputs and assigning each unique name as a key mapped to its salary.
p.72Character frequency in a string can be counted using a dictionary by checking if each character is in the dictionary: incrementing its count if present, or initializing it to 1 if absent.
p.73A digit-to-word conversion program maps integer digits 0 through 9 to their word equivalents using a dictionary, retrieving words by indexing numberNames with int(ch).
p.73
Understanding Data
5 topics · 3 formulas · 38 facts
- 1Introduction to Data
- 2Data Collection
- 3Data Storage
- 4Data Processing
- 5Statistical Techniques for Data Processing
- Arithmetic Meanp.88
- Rangep.90
- Standard Deviationp.90
Governments systematically collect and record data about the population through census, which provides valuable information for planning and formulating policies.
p.81Data is defined as a collection of characters, numbers, and symbols that represents values of variables or situations, where data is plural and datum is singular.
p.82Using computers, data are stored in electronic forms because automated data processing is faster and easier compared to manual data processing done by humans.
p.82A knowledge base is a store of information consisting of facts, assumptions, and rules which an artificial intelligence system uses for decision making.
p.82Processing large volumes of data using computers reveals hidden patterns and behavioral traits that are otherwise not visible to human observers.
p.83Dynamic pricing systems in airlines and transport apps adjust fares automatically based on the relationship between demand and supply at a particular time.
p.83Electronic voting machines record votes cast and aggregate voting data across machines to declare election results in a shorter time than manual paper counting.
p.83Structured data is organised data recorded in a well-defined format, typically stored in computers in a tabular format of rows and columns.
p.84In a structured data table, each column represents a particular parameter termed an attribute, characteristic, or variable, while each row represents an observation.
p.84Spreadsheets and database systems perform calculations on structured tabular data, such as summing inventory quantities or multiplying unit prices by item quantities.
p.84Unstructured data refers to data that does not follow a traditional row and column structure, including newspapers, web pages, text documents, and multimedia.
p.85Metadata is defined as data about data, providing descriptive context such as subject, sender, and attachments in emails, or file size and resolution in images.
p.85Data collection is the process of identifying already available data or gathering data from appropriate sources prior to digital storage and processing.
p.85When sales data is maintained manually in paper diaries or registers, it must be digitised by entering it into spreadsheet software for computer processing.
p.85Data collection can ingest existing digital datasets stored in standardized plain-text formats such as CSV (comma-separated values) files.
p.85Custom software applications written in programming languages like Python can automate the collection, storage, and retrieval of data from CSV files and databases.
p.86Analysing transaction data collected by shopping malls enables business owners to identify items frequently purchased together and optimize store displays.
p.86Data storage is the process of storing gathered and processed data on digital storage devices so that the data can be retrieved for future use.
p.86Digital storage devices used to store data include Hard Disk Drives (HDD), Solid State Drives (SSD), CD/DVD, Tape Drives, Pen Drives, and Memory Cards.
p.86Data files such as images, documents, and videos stored on computers face file-processing limitations that can be overcome by Database Management Systems (DBMS).
p.86Data processing converts raw data in the form of numbers, text, or images into meaningful information presented as tables, charts, or text for decision making.
p.87The data processing cycle consists of three basic stages: input (collection, preparation, entry), processing (store, retrieve, classify, update), and output.
p.87Automated data processing systems validate submitted input details, verify business rules or account balances, update records, and generate formatted outputs.
p.87A measure of central tendency is a single summary value, such as the mean, median, or mode, that provides an overview of the central distribution of a dataset.
p.88Mean is the average of the numeric values of an attribute, computed by dividing the sum of all observed values by the total number of observations.
p.88An outlier is an exceptionally large or small value relative to the rest of the data that acts as an error and distorts the mean and other calculations.
p.88Median is the middle value of an attribute when all values are sorted in ascending or descending order, dividing the dataset into two equal halves.
p.89When a dataset contains an odd number of values, the median is the value at the middle position; when even, it is the average of the two middle values.
p.89Mode is the value that appears most frequently in a dataset, and it can be computed for both numerical and non-numerical (categorical) data attributes.
p.89A dataset has no mode if every value occurs exactly once, and it may have multiple modes if two or more distinct values share the highest frequency.
p.89Measures of variability or dispersion indicate the degree of diversity, spread, or difference of data values around their central mean value.
p.89Two different datasets can have identical mean, median, and mode values while exhibiting entirely different degrees of variation or dispersion.
p.89Range is a measure of dispersion computed as the difference between the maximum and minimum values in numerical data, indicating coverage of data values.
p.90Because Range is calculated exclusively from the two extreme values, the presence of any outlier in the dataset severely influences the result.
p.90Standard deviation measures data dispersion by considering all values, calculated as the positive square root of the average squared difference from the mean.
p.90A smaller standard deviation indicates that data points are clustered closely around the mean, whereas a larger standard deviation indicates wider dispersion.
p.90Python programming provides specialized libraries designed for data processing and analysis that implement standard statistical techniques.
p.91Summarizing data using statistical techniques aids in revealing data characteristics and patterns that facilitate effective comprehension and decision making.
p.92
Introduction to NumPy
10 topics · 5 formulas · 42 facts
- 1Array
- 2NumPy Array
- 3Indexing and Slicing
- 4Operations on Arrays
- 5Concatenating Arrays
- 6Reshaping Arrays
- 7Splitting Arrays
- 8Statistical Operations on Arrays
- 9Loading Arrays from Files
- 10Saving NumPy Arrays in Files on Disk
- Byte to bits unit conversionp.99
- Itemsize of an array element in bytesp.99
- Total elements in a two-dimensional arrayp.99
- Arithmetic mean of array elementsp.108
- Standard deviation of array elementsp.108
An array is a data type that stores an ordered collection of elements of the same data type using a single identifier.
p.96Array elements are allocated contiguously in memory, which makes operations on arrays fast.
p.96Each element in an array is uniquely referenced using zero-based indexing, where the first element has index 0 and the last element in an n-element array has index n-1.
p.96A NumPy ndarray takes up less space in memory than a Python list because it does not require storing separate datatype information for each element.
p.97NumPy arrays support element-wise operations directly across their elements, whereas core Python lists do not support element-wise operations.
p.97When creating an array from a list containing mixed data types, all integer and floating-point values are automatically promoted to strings.
p.98The ndarray.ndim attribute gives the number of dimensions or axes of an array, which is also referred to as the array rank.
p.98In a two-dimensional NumPy array, the row axis is designated as axis-0 and the column axis is designated as axis-1.
p.98The ndarray.shape attribute returns a tuple of integers indicating the size of the array along each dimension.
p.98The ndarray.size attribute gives the total number of elements of an array, which is equal to the product of the elements of shape.
p.99The ndarray.itemsize attribute specifies the memory size in bytes of each element, occupying 4 bytes for int32 and 8 bytes for float64.
p.99The np.zeros() and np.ones() functions create arrays with all elements initialised to 0 and 1 respectively, having float as their default data type.
p.100The np.arange() function creates a one-dimensional array containing numbers in a given range and sequence analogous to the range() function in Python.
p.100Elements in a two-dimensional array are referenced using two indices array[i, j], where i is the row index and j is the column index starting from 0.
p.100Attempting to access an index outside the boundaries of an array dimension results in an IndexError stating the index is out of bounds.
p.101In array slicing using the syntax [start:end], the value at the start index is included whereas the value at the end index is excluded.
p.101Specifying a negative step size in slicing syntax [::-1] reverses the sequence of elements in an array.
p.101Omitting slice indices for a dimension by writing a colon selects all elements along that row or column axis.
p.102Basic arithmetic operators perform element-wise addition, subtraction, multiplication, and division on corresponding pairs of elements in NumPy arrays.
p.102Matrix multiplication between two NumPy arrays is executed using the @ operator.
p.103Performing element-wise arithmetic operations between two arrays requires both arrays to have the exact same shape.
p.103The transpose() method turns rows into columns and columns into rows while leaving the original array unchanged.
p.104The sort() method sorts array elements in ascending order in place, performing row-wise sorting along axis=1 by default on a two-dimensional array.
p.104Specifying axis=0 in the sort() method sorts elements column-wise in ascending order within each column of a two-dimensional array.
p.104The np.concatenate() function joins two or more arrays along a specified axis, defaulting to concatenation along axis=0.
p.104All dimensions of arrays to be concatenated must match exactly except for the dimension along which they are joined, or else a ValueError occurs.
p.105The reshape() function modifies the dimensions of an array without changing its total number of elements.
p.105Attempting to reshape an array into dimensions that do not match the original total number of elements results in an error.
p.105The np.split() function divides an array into two or more subarrays along a specified axis, defaulting to axis=0.
p.106An array can be split by passing a sequence of index values marking split positions or by passing an integer indicating the number of equal parts.
p.106Specifying axis=1 in np.split() splits a two-dimensional array along its columns into vertical subarrays.
p.107The sum(), max(), and min() functions calculate the total sum, maximum value, and minimum value of array elements respectively, optionally along an axis.
p.108The mean() function calculates the arithmetic average of elements across an entire array or along a designated axis.
p.108The std() function computes the standard deviation of array elements across the whole array or along a specified axis.
p.108To load data from a text file into a NumPy array, each row in the file must contain the exact same number of values.
p.109The skiprows parameter in np.loadtxt() indicates how many initial rows, such as table headers, to skip while loading data.
p.110Setting unpack=True in np.loadtxt() transposes the loaded array, allowing data columns to be extracted directly into separate variables.
p.110The np.genfromtxt() function handles missing and non-numeric values in files by converting missing entries into nan by default.
p.111The filling_values parameter in np.genfromtxt() replaces missing or non-numeric entries in data files with a specified default value.
p.111The np.savetxt() function saves a NumPy array to a text file on disk using a specified delimiter character.
p.112The fmt parameter in np.savetxt() specifies the formatting of saved values, which defaults to floating-point representation.
p.112Once created, a NumPy array occupies a fixed memory allocation and cannot be dynamically resized or extended.
p.112
Database Concepts
4 topics · 44 facts
- 1File System
- 2Database Management System
- 3Relational Data Model
- 4Keys in a Relational Database
A computer file serves as a container on a storage device to store data such as plain text, program code, or comma separated values.
p.124Accessing and searching data stored in files through software applications requires writing custom computer programs.
p.125File systems lack internal retrieval mechanisms, making it difficult to access data in unexpected formats without developing new application programs.
p.126Data redundancy occurs when the same data is duplicated across different files, which wastes storage space and can lead to data inconsistency.
p.126Data inconsistency occurs when redundant copies of the same data stored in different files are updated mismatchingly or omitted in some files.
p.126Data isolation occurs in a file system because there is no link or mapping between related files, requiring separate application programs to access each file.
p.127Data dependence means that changing the file structure or format requires modifying all application programs that access that file.
p.127File systems cannot easily enforce granular access control, such as granting read-only permissions to certain users while allowing others to modify data.
p.127A Database Management System (DBMS) is software used to create, manage, store, update, and retrieve logically related data from a database.
p.127A DBMS provides an abstract view of data by hiding physical storage details and internal structures from end users and application programs.
p.128Retrieving data from a database using specialized commands is referred to as querying the database.
p.128Tables in a relational database are linked and related through one or more common fields to eliminate data redundancy.
p.128Splitting a single large file into multiple related tables eliminates duplicate storage of repeated entities such as guardian details.
p.129An artificial unique column like a guardian ID is introduced when natural attributes like names or phone numbers can duplicate or change over time.
p.129Transitioning from a file system to a DBMS incurs high costs for purchasing hardware and software, training users, and performing regular backup and recovery.
p.129A DBMS maintains a single centralized repository of data that can be accessed and manipulated concurrently by multiple users.
p.130Database schema is the visual or logical architecture that defines table structures, column data types, constraints, and relationships.
p.130Data constraints are limitations placed on table columns to enforce data accuracy, consistency, and reliability within the database.
p.131Metadata is data about data, encompassing the database schema and constraints stored in the DBMS database catalog or data dictionary.
p.131A database instance is the actual operational state or snapshot of a database populated with data at a specific point in time.
p.131While a database schema remains static, a database instance changes dynamically whenever data manipulation operations take place.
p.132Data manipulation in a database consists of three fundamental operations: insertion of new records, deletion of existing records, and update of stored values.
p.132A database engine is the underlying component of a DBMS that executes queries and handles data retrieval and manipulation.
p.132Using a DBMS increases complexity in maintaining security and integrity, and centralizing data increases data vulnerability in case of hardware or software failure.
p.132A data model describes the structure of a database, including how data are defined and represented, relationships among data, and constraints.
p.132In the relational data model, tables are known as relations, where each row represents a related set of values and relations are linked by common attributes.
p.133An attribute is a named characteristic or column in a relation that stores values for a specific field across all tuples.
p.134A tuple is a single row in a relation representing an association of related values corresponding to a real-world entity.
p.134A domain is the set of permissible values from which an attribute can draw its values, typically specified by a data type.
p.134The degree of a relation is the total number of attributes or columns it contains.
p.135The cardinality of a relation is the total number of tuples or rows it contains.
p.135Property 1 of a relation establishes that each attribute must have a unique name within the relation and the sequence of attributes is immaterial.
p.135Property 2 of a relation states that each tuple must be distinct and uniquely identifiable, and the sequence of tuples is immaterial.
p.135Property 3 of a relation requires that all attribute values must be atomic, indivisible, drawn from the same domain, and single-valued per tuple.
p.135The special value NULL is used in relational tables to represent values that are unknown, missing, or not applicable for an attribute.
p.135Relational tables require that no two tuples have identical values across all attributes, ensuring each tuple is uniquely distinguishable.
p.136A candidate key is any attribute or minimal set of attributes that takes unique, distinct values and can uniquely identify each tuple in a relation.
p.136A primary key is the specific candidate key selected by the database designer to uniquely identify the tuples of a relation.
p.136An alternate key is any candidate key in a relation that was not chosen as the primary key.
p.136A composite primary key is a primary key formed by combining two or more attributes together when no single attribute can uniquely distinguish tuples.
p.136A foreign key is an attribute in a referencing relation whose value is derived from and refers to the primary key of another referenced relation.
p.137The relation containing the foreign key is the foreign or referencing relation, whereas the relation with the referenced primary key is the master or primary relation.
p.137A foreign key can store a NULL value if it is not defined as part of the primary key in the referencing relation.
p.137In relational schema diagrams, a foreign key is represented as a directed arc pointing from the foreign key attribute to the referenced primary key attribute.
p.137
Introduction to Structured Query Language (SQL)
6 topics · 43 facts
- 1Structured Query Language (SQL)
- 2Data Types and Constraints in MySQL
- 3SQL for Data Definition
- 4SQL for Data Manipulation
- 5SQL for Data Query
- 6Data Updation and Deletion
Structured Query Language (SQL) is the standard query language used by relational database management systems such as MySQL, Oracle, and SQL Server to access, manipulate, and define data.
p.144SQL statements are case insensitive, meaning uppercase and lowercase keywords or identifiers are treated identically.
p.144SQL is non-procedural because the user specifies what data is to be retrieved rather than specifying the procedural steps of how to retrieve it.
p.144Every SQL statement in MySQL must terminate with a semicolon (;), and pressing Enter without a semicolon continues the statement to the next line with a -> prompt.
p.144The CHAR(n) data type specifies a fixed-length string of length n from 0 to 255 characters, and MySQL right-pads unused spaces with blanks.
p.145The VARCHAR(n) data type specifies a variable-length string of up to n characters from 0 to 65535, allocating only the storage bytes needed for entered characters.
p.145The INT data type occupies 4 bytes of storage for integers ranging from -2147483648 to 2147483647, whereas values larger than that require BIGINT occupying 8 bytes.
p.146The DATE data type stores calendar dates in YYYY-MM-DD format with a supported range from 1000-01-01 to 9999-12-31.
p.146The NOT NULL constraint ensures that a column cannot have NULL values, where NULL represents missing, unknown, or not applicable data.
p.146The UNIQUE constraint ensures that all values in a column are distinct.
p.146A PRIMARY KEY constraint uniquely identifies each row in a table, whereas a FOREIGN KEY refers to the primary key attribute of another table.
p.146Data Definition Language (DDL) commands are used to define, alter, and delete database structures including schemas, tables, and constraints.
p.146The CREATE DATABASE statement creates a new database, while the USE statement sets an existing database as the active database for subsequent operations.
p.146The SHOW TABLES statement lists the names of all existing tables within the currently selected database.
p.147In a CREATE TABLE statement, every attribute can take NULL values by default unless explicitly restricted by a PRIMARY KEY or NOT NULL constraint.
p.147The DESCRIBE statement, or its abbreviated form DESC, displays the schema structure, column types, nullability, keys, and default values of a table.
p.149The ALTER TABLE statement modifies the structure of an existing table by adding columns, modifying data types, or adding and dropping constraints.
p.149A foreign key added to a relation requires that the referenced table and attribute exist, and the referenced and referencing attributes share identical data type and size.
p.150The ALTER TABLE MODIFY clause changes the data type, size, NOT NULL constraint, or default value of an existing column.
p.151The ALTER TABLE DROP clause removes an attribute or drops a primary key constraint from an existing table.
p.152The DROP TABLE statement permanently deletes a table and its records, while DROP DATABASE permanently removes the entire database and all contained tables.
p.153Data Manipulation Language (DML) statements perform insertion of new data, retrieval of existing data, modification of existing data, and deletion of records.
p.153The INSERT INTO statement adds new records to a table using VALUES corresponding to the defined column order.
p.153Column names can be omitted in an INSERT INTO statement only when values are supplied for all attributes in exact schema sequence.
p.153When inserting values for only selected columns, attribute names must be explicitly specified in the INSERT INTO clause in the same order as the supplied values.
p.154String and date literals must be enclosed in single quotation marks when entered in SQL statements.
p.155Populating records with a foreign key requires that corresponding referenced records already exist in the referenced parent table.
p.153The SELECT statement retrieves data from one or more tables and presents the result in tabular form.
p.157In a SELECT query, the FROM clause specifies the source table, while the optional WHERE clause filters rows that satisfy given conditions.
p.157Using an asterisk (*) in the SELECT clause retrieves all columns for the matching records.
p.158The AS keyword assigns an alias to rename an output column header in the query result without changing the underlying table column name.
p.159The DISTINCT clause eliminates duplicate rows from the query output to display only unique values.
p.160The BETWEEN operator defines an inclusive range of values to filter records in a WHERE clause.
p.162The IN operator compares an attribute value against a parenthesized list of values and returns true if a match is found.
p.162The ORDER BY clause arranges query results in ascending order by default, and in descending order when the DESC keyword is appended.
p.163SQL uses NULL to represent missing or unknown values, and any arithmetic operation performed with NULL produces NULL.
p.164Checking for the presence or absence of NULL values in a query requires the IS NULL or IS NOT NULL operator instead of the equality operator.
p.164The LIKE operator performs pattern matching using percent (%) for zero or more characters and underscore (_) for exactly one character.
p.165The UPDATE statement modifies values in existing table records using the SET clause.
p.166Omitting the WHERE clause from an UPDATE statement results in modifying the specified column values across all records in the table.
p.167An UPDATE statement can update multiple columns simultaneously by separating column assignments with commas in the SET clause.
p.167The DELETE statement removes one or more records satisfying a WHERE condition from a table.
p.167Omitting the WHERE clause from a DELETE statement removes all records from the table while retaining the table structure.
p.168