0% found this document useful (0 votes)
18 views4 pages

Class 12 Computer Science Question Bank

The document is a question bank for Class 12 Computer Science at Mount Hill Academy, covering five units: Computer Networks, Relational Database & SQL, Review of Python Basics, Functions & Exception Handling, and Interface of Python with MySQL. It includes questions of varying marks (2, 3, 4, and 5) on topics such as network definitions, SQL commands, Python programming, and database connectivity. Each unit is structured to assess students' understanding of key concepts and practical applications in computer science.

Uploaded by

sagarchjaat15
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)
18 views4 pages

Class 12 Computer Science Question Bank

The document is a question bank for Class 12 Computer Science at Mount Hill Academy, covering five units: Computer Networks, Relational Database & SQL, Review of Python Basics, Functions & Exception Handling, and Interface of Python with MySQL. It includes questions of varying marks (2, 3, 4, and 5) on topics such as network definitions, SQL commands, Python programming, and database connectivity. Each unit is structured to assess students' understanding of key concepts and practical applications in computer science.

Uploaded by

sagarchjaat15
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

MOUNT HILL ACADEMY, CHANDANVAN

CLASS - 12
SUBJECT - Computer Science (Question Bank)
UNIT 1: COMPUTER NETWORKS
 Each question carries 2 marks:
1. Define a computer network.
2. What is the difference between LAN and WAN?
3. Define bandwidth and data transfer rate.
4. What is the purpose of a switch in a network?
5. Write two uses of an IP address.
6. What is a protocol? Give two examples.
7. Differentiate between hub and switch.
8. Write two advantages of networking.
9. What is the difference between IPv4 and IPv6?
10. What is DNS? State its use.
 Each question carries 3 marks:
1. Explain client-server and peer-to-peer architecture with diagrams.
2. Describe any three types of transmission media.
3. What is a MAC address? How is it different from an IP address?
4. Explain the difference between packet switching and circuit switching.
5. What are the main advantages of optical fiber cables over copper cables?
 Each question carries 4 marks:
1. Describe the various network topologies with suitable diagrams.
2. Explain the OSI reference model and its layers.
3. Differentiate between guided and unguided transmission media with examples.
4. Discuss different types of network devices used in networking.
 Each question carries 5 marks:
1. Compare LAN, MAN, and WAN in terms of area covered, speed, and example use.
2. Explain how data travels across the internet, mentioning the role of routers, DNS, and IP addresses.
3. Discuss the need, advantages, and challenges of network security.
UNIT 2: RELATIONAL DATABASE & SQL
 Each question carries 2 marks:
1. Define a database.
2. What is a primary key? Give an example.
3. Differentiate between CHAR and VARCHAR data types.
4. Write SQL commands to create a table STUDENT with columns (RollNo, Name, Marks).
5. Write an SQL statement to display all records from a table EMPLOYEE.
6. What is a foreign key?
7. Define the term ‘tuple’.
8. Write the use of the SELECT command in SQL.
9. What is the purpose of the ORDER BY clause?
10. Write an example of the BETWEEN operator.
 Each question carries 3 marks:
1. Explain the differences between DDL, DML, and DCL.
2. Write SQL statements for:
o Creating a table EMP(ENO, ENAME, SALARY)
o Inserting one record
o Displaying all employees with salary > 50000
3. Explain the use of aggregate functions in SQL with examples.
4. Write SQL queries for the following table STUDENT(Name, Class, Marks):
o Display names of students with marks > 80
o Count total students
o Display students in Class = 12
5. What is normalization? Explain its importance.
 Each question carries 4 marks:
1. Explain the different types of SQL joins with examples.
2. What are constraints in SQL? Explain PRIMARY KEY, FOREIGN KEY, UNIQUE, and CHECK constraints.
3. Differentiate between GROUP BY and HAVING clauses with examples.
4. Write SQL queries for a database with EMPLOYEE and DEPARTMENT tables showing JOIN, ORDER BY, and GROUP
BY operations.
 Each question carries 5 marks:
1. Consider the following tables and answer the queries:
TABLE: STUDENT(RollNo, Name, Class, Marks, Gender)
TABLE: COURSE(CourseID, CourseName, Fee)
Write SQL queries to:
a. Display all students with Marks > 80.
b. Count number of male and female students.
c. Display average marks class-wise.
d. Display student names with their course names (using JOIN).
e. Display students sorted by Marks in descending order.
2. Discuss the advantages and disadvantages of the relational database model.
UNIT 3: REVIEW OF PYTHON BASICS
 Each question carries 2 marks:
1. Define a variable in Python.
2. What is the difference between mutable and immutable data types?
3. Write the output of:
4. x = 5
5. y = 2
6. print(x**y)
7. Name two data types used in Python.
8. What is the purpose of indentation in Python?
9. Differentiate between = and ==.
10. Write an example of a conditional statement in Python.
11. What is the difference between list and tuple?
12. What is the output of print(type({1,2,3}))?
13. Write a Python statement to take input from the user.
 Each question carries 3 marks:
1. Explain the use of loops in Python with examples.
2. Write a program to find the sum of numbers from 1 to 10 using a loop.
3. Explain any three string functions in Python with examples.
4. What are data structures in Python? Explain with examples.
5. Write a program to check whether a number is prime or not.
 Each question carries 4 marks:
1. Write a Python program to find the largest and smallest numbers in a list.
2. Write a Python program to count vowels in a given string.
3. Differentiate between shallow and deep copy with examples.
4. Explain mutable and immutable objects in Python with examples.
 Each question carries 5 marks:
1. Write a Python program to input a list of numbers and display:
o The sum
o The average
o The maximum and minimum numbers
2. Discuss different types of operators in Python with examples.
UNIT 4: FUNCTIONS & EXCEPTION HANDLING
 Each question carries 2 marks:
1. What is a function?
2. Differentiate between built-in and user-defined functions.
3. What is recursion?
4. What is an exception in Python?
5. Write the syntax of a function definition in Python.
6. What is the difference between return and print()?
7. Define try and except blocks.
8. What is the purpose of finally block?
9. What is a lambda function?
10. Write one example of an exception.
 Each question carries 3 marks:
1. Write a function to calculate the factorial of a number.
2. Explain the use of default arguments in Python functions.
3. Write a function that takes a list and returns its sum.
4. Write a program to demonstrate try, except, and finally blocks.
5. Explain the need for exception handling in Python.
 Each question carries 4 marks:
1. Write a program using a function to check whether a string is a palindrome.
2. Write a Python function to count even and odd numbers in a list.
3. Explain different types of function arguments with examples.
4. Write a program to handle multiple exceptions in Python.
 Each question carries 5 marks:
1. Explain in detail the types of errors and exceptions in Python with examples.
2. Write a Python program using functions and exception handling to:
o Accept two numbers
o Divide them
o Handle ZeroDivisionError and ValueError
3. Discuss the advantages of modular programming using functions.
UNIT 5: INTERFACE OF PYTHON WITH MYSQL
 Each question carries 2 marks:
1. What is MySQL Connector in Python?
2. What is a cursor object?
3. Write the steps to connect Python with MySQL.
4. Write Python code to connect to a MySQL database named "school".
5. What is the use of the execute() method?
6. Name two methods to fetch data from a table using Python.
7. What is the purpose of commit() and rollback()?
8. What is a query in Python-MySQL connectivity?
9. What is the role of the import [Link] statement?
10. Mention any two advantages of connecting Python with MySQL.
 Each question carries 3 marks:
1. Write Python code to insert a record into the STUDENT table using MySQL connectivity.
2. Explain the steps involved in reading data from a MySQL table in Python.
3. Write Python code to fetch and display all rows from a table.
4. What are the steps to update a record in MySQL using Python?
5. Write a short note on exception handling during database operations.
 Each question carries 4 marks:
1. Write a complete Python script to connect to a MySQL database, create a table, and insert a record.
2. Explain the process of CRUD operations (Create, Read, Update, Delete) in Python-MySQL connectivity.
3. Write a Python program to display records of students having marks greater than 80.
4. Explain cursor operations with suitable examples.
 Each question carries 5 marks:
1. Write a Python program to:
o Connect to a database “school”
o Create a table STUDENT (RollNo, Name, Marks)
o Insert 3 records
o Fetch and display all records
2. Explain the importance and use of Python-MySQL connectivity in real-world applications.

Common questions

Powered by AI

To display student names along with their course names and sort them by marks in descending order, a query would involve a JOIN between the STUDENT and COURSE tables, followed by an ORDER BY clause. The SQL statement might look like: 'SELECT STUDENT.Name, COURSE.CourseName, STUDENT.Marks FROM STUDENT JOIN COURSE ON STUDENT.CourseID = COURSE.CourseID ORDER BY STUDENT.Marks DESC;' .

Packet switching divides data into packets sent independently through the network, reassembled at the destination, maximizing the use of available bandwidth and offering flexibility and efficiency in data transmission. Circuit switching, used in traditional telephony, establishes a dedicated communication path between endpoints for the duration of the connection, which can ensure a reliable and consistent data rate but is less efficient in resource utilization. Packet switching is generally more suited for data and internet communications, while circuit switching remains advantageous for real-time voice calls .

SQL joins such as INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN provide versatile methods to combine rows from two or more tables based on a related column. INNER JOIN is best for extracting rows with matching values in both tables. LEFT JOIN retrieves all rows from the left table and matched rows from the right, useful in maintaining primary table data when a match is not required. RIGHT JOIN acts conversely, while FULL JOIN includes all records from both tables, filling in nulls where no match exists. Each type is suitable depending on query requirements and data relationships .

DDL (Data Definition Language) involves commands like CREATE and ALTER to define and modify schema structures. DML (Data Manipulation Language) includes commands like SELECT, INSERT, and DELETE, allowing manipulation of data stored in the database. DCL (Data Control Language) comprises commands like GRANT and REVOKE, which manage access permissions and security within the database .

IPv4 uses a 32-bit address format, allowing for 4.3 billion unique addresses, while IPv6 uses a 128-bit format, significantly increasing the address capacity to accommodate the growth of internet-connected devices . IPv6 also offers improved routing and autoconfiguration capabilities, which will be crucial as IoT and mobile internet usage expand .

Exception handling is crucial in Python to manage runtime errors gracefully, ensuring the program's integrity and providing informative error messages. During database operations, exceptions like connection errors or query issues can be caught using try-except blocks, helping maintain operational flow and allowing for error logging and user notification. An effective implementation involves wrapping potentially failing code in try blocks and using except clauses for specific exceptions .

Network security provides critical advantages such as protection against unauthorized access and potential cyber threats, ensuring data integrity and privacy. However, challenges include the need for constant updates and monitoring to counteract evolving threats, the complexity of managing security measures, and potential impacts on network performance .

CRUD operations—Create, Read, Update, Delete—can be implemented in Python-MySQL connectivity using MySQL connector commands within Python scripts. CREATE and INSERT functions define and add records to tables, SELECT retrieves data, UPDATE modifies existing records, and DELETE removes records. These operations are fundamental in developing dynamic applications as they facilitate the manipulation of database content in response to user inputs and system requirements .

Shallow copy creates a new object but copies references to the original memory locations for nested objects, while deep copy creates a new object along with new copies of all nested objects. Shallow copy is suitable for objects with immutable elements, while deep copy should be used when changes to a copy shouldn't affect the original object, as in complex nested data structures .

A switch is a networking device that connects devices within a network and uses MAC addresses to forward data only to the designated recipient. Unlike hubs, which broadcast information to all ports, switches improve network efficiency by reducing unnecessary data collisions and enhancing security by segmenting networks into different collision domains .

You might also like