0% found this document useful (0 votes)
35 views6 pages

Class 12 Computer Science Notes PDF

Uploaded by

alokkumarg105
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views6 pages

Class 12 Computer Science Notes PDF

Uploaded by

alokkumarg105
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Class 12 Computer Science Notes

Based on Sumita Arora's Textbook

Computer Network - 2

Computer Network - 2:

Definition and Purpose:

- Computer networks connect multiple computers, enabling data exchange.

- Types include LAN, WAN, MAN, etc., each suitable for different scopes of use.

Network Topologies:

- Bus: Single cable connecting all nodes; one fault affects the whole network.

- Star: Central hub connects all nodes, providing better fault tolerance.

- Ring: Nodes form a circular path; data travels in one direction.

- Mesh: Each node connects to multiple nodes, enhancing redundancy.

- Hybrid: Combines different topologies, improving versatility.

Network Protocols:

- TCP/IP: Fundamental suite for internet communication.

- HTTP/HTTPS: Used for web browsing, HTTPS adds encryption.

- FTP: File Transfer Protocol for uploading/downloading files.

- SMTP/POP3: Used for sending and receiving emails.

Transmission Media:

- Wired: Coaxial cables, fiber optics provide high speed, but need physical links.
- Wireless: Wi-Fi and Bluetooth offer flexibility, though signal strength can vary.

Network Devices:

- Router: Directs data packets across networks.

- Switch: Connects devices within a single network, handling data traffic.

- Modem: Enables access to the internet by modulating digital signals.

Relational Database

Relational Database:

Introduction to RDBMS:

- RDBMSs organize data in tables and allow relationships between tables.

- Essential for structured storage and retrieval of data.

Database Models:

- Hierarchical: Data organized in a tree-like structure.

- Network: More complex connections, useful for networks.

- Relational: Data stored in tables with columns and rows.

Key Terms:

- Table: Data is organized in rows and columns.

- Record: Single entry in a table.

- Field: Specific attribute (column) in a table.

- Primary Key: Unique identifier for records.

- Foreign Key: Links records across tables.


Advantages of RDBMS:

- Maintains data integrity, reduces redundancy, enables complex queries.

Normal Forms:

- 1NF, 2NF, 3NF: Levels of database normalization to reduce redundancy and dependencies.

Simple Queries in SQL

Simple Queries in SQL:

SQL Basics:

- SQL is used to manage and query relational databases.

- Common SQL commands include SELECT, INSERT, UPDATE, DELETE.

Basic SQL Commands:

- SELECT: Retrieves data from a database.

- FROM: Specifies the table to query.

- WHERE: Filters results based on a condition.

- ORDER BY: Sorts results by specified column.

- DISTINCT: Removes duplicate values from results.

Filtering Data:

- Conditions use operators like =, >, <, AND, OR, NOT to refine searches.

Sorting and Limiting Results:


- ORDER BY organizes data in ascending or descending order.

- LIMIT restricts the number of returned results.

Table Creation and Data Manipulation Commands

Table Creation and Data Manipulation Commands:

Creating Tables:

- CREATE TABLE command initializes a table in the database.

- Syntax: CREATE TABLE table_name (column1 datatype, column2 datatype, ...).

Data Types:

- INT, VARCHAR, DATE, and others specify the nature of each column's data.

Data Manipulation:

- INSERT INTO: Adds new records.

- UPDATE: Modifies existing records.

- DELETE: Removes records from a table.

Altering Tables:

- ALTER TABLE allows adding, modifying, or dropping columns.

Grouping Records, Joins in SQL

Grouping Records, Joins in SQL:


Grouping Records:

- GROUP BY groups rows sharing a common field.

- HAVING applies a condition to groups.

Joins:

- INNER JOIN: Returns records with matching values in both tables.

- LEFT JOIN: Returns all records from the left table and matched records from the right.

- RIGHT JOIN: Returns all records from the right table and matched records from the left.

- FULL JOIN: Returns records when there's a match in one of the tables.

Interface Python with MySQL

Interface Python with MySQL:

Connecting Python to MySQL:

- Python's MySQL connector enables database interactions.

Basic Steps:

1. Install MySQL connector (pip install mysql-connector-python).

2. Import [Link] module.

3. Use connect() function with database credentials.

Performing CRUD Operations:

- Cursor object in Python executes SQL commands.

Error Handling:
- Handle exceptions for robust code execution.

Common questions

Powered by AI

Normalization involves structuring a relational database according to normal forms (1NF, 2NF, 3NF) to minimize redundancy and dependencies, which are common culprits of data anomalies and integrity issues . By organizing data into related tables, normalization ensures that each piece of data resides in one place, preventing unnecessary duplication and hence maintaining consistency . This is essential for data integrity as it allows for efficient updates and reduces risks associated with data anomalies during operations such as insert, update, and delete.

Python's MySQL connector enables database interactions by allowing connections using specific credentials, executing CRUD operations through a cursor object . The connector provides functions like execute() for running SQL commands, enabling tasks such as inserting, updating, and deleting records in a database . Error handling is crucial as it addresses possible exceptions while executing SQL commands, ensuring robust and reliable database operations by preventing data corruption and ensuring continuous application execution .

The TCP/IP protocol suite provides the foundational framework for data exchange across networks and the Internet by defining how data is packetized, addressed, transmitted, routed, and received at the destination . TCP (Transmission Control Protocol) ensures that data is transferred reliably by managing error correction and packet sequencing, while IP (Internet Protocol) handles logical addressing to ensure data reaches the right destination . Without this suite, modern Internet communications would lack the necessary structure for interoperability and reliability, making it integral to nearly all network operations today.

In a star topology, each node is connected to a central hub, so if one connection fails, the rest of the network remains unaffected, providing better fault tolerance . In contrast, a bus topology uses a single cable to connect all nodes, meaning that a breach or failure in the cable can disrupt the entire network, demonstrating a significant vulnerability . The centralized structure of star topology ensures that a single failure does not ripple through the entire network as it does in a bus topology.

Wired transmission media such as coaxial cables offer higher speeds and more reliable connections but require physical installation, making them ideal for scenarios where performance and data integrity are critical, like in data centers . Wireless options like Wi-Fi provide flexibility and ease of reconfiguration, suitable for dynamic environments like office spaces or residential areas, despite potential signal interference and limited speed . The choice between these depends on factors such as installation environment, budget, required speed, and reliability.

LAN (Local Area Network) is designed for small geographic areas like a single building, making it cost-effective for smaller installations . WAN (Wide Area Network), on the other hand, covers large geographic areas, such as countries or continents, and is suitable for organizations with broader connectivity needs despite higher costs . MAN (Metropolitan Area Network) serves a city or a large campus, balancing between LAN and WAN in both coverage and cost, suitable for city-wide connectivity like for government or large enterprises . The choice between these networks depends on factors like geographic scope, budget, and the specific needs of the organization.

SQL queries like SELECT, INSERT, UPDATE, and DELETE enable structured data retrieval and manipulation, facilitating users to execute complex data operations with minimal syntax . SELECT retrieves specific data based on conditions, ORDER BY sorts data, and WHERE filters results, optimizing data management tasks . These features allow users to efficiently access and modify large datasets, ensuring data accuracy and efficiency in processing.

INNER JOIN returns records with matching values in both tables, making it ideal for scenarios where only fully matching data sets are needed . In contrast, LEFT JOIN returns all records from the left table and the matched records from the right table, with nulls where no match exists, useful when all entries from the left table should be included regardless of matching criteria in the right table . This allows LEFT JOIN to better handle incomplete data scenarios where the principal focus is on retaining data from the primary dataset regardless of matches.

A hybrid network topology, which combines multiple standard topologies like star, mesh, or bus, offers enhanced versatility and reliability by leveraging the strengths and mitigating the weaknesses of various topologies . It is particularly advantageous in complex, large-scale networks where different departments or sections require distinct configurations—such as combining a star configuration for end-user devices and a mesh structure for server connections—ensuring efficient fault tolerance, scalability, and performance . This makes hybrid topologies ideal for large enterprises with varied network needs.

Primary keys uniquely identify each record in a database table, ensuring no duplicate entries, which is critical for data integrity . Foreign keys create a link between two tables, enabling the establishment of relationships between data, enforcing referential integrity by ensuring that the value in one table matches a value in another or is null, maintaining consistency across the database . Together, they help eliminate redundancy and maintain data accuracy and consistency.

You might also like