Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

12 Python + SQL

The document outlines a comprehensive curriculum covering Python programming, object-oriented programming, data structures, databases, Boolean algebra, networking, emerging trends, and practical programming problems. It includes detailed questions and programming tasks designed to assess knowledge and skills in each area. The curriculum is structured into sections with specific topics and practical exercises to enhance learning.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

12 Python + SQL

The document outlines a comprehensive curriculum covering Python programming, object-oriented programming, data structures, databases, Boolean algebra, networking, emerging trends, and practical programming problems. It includes detailed questions and programming tasks designed to assess knowledge and skills in each area. The curriculum is structured into sections with specific topics and practical exercises to enhance learning.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

I.

Python Programming (General)

1. What are the different data types in Python? Give examples.

2. Explain the difference between mutable and immutable data types.

3. What are operators in Python? Explain arithmetic, logical, and relational operators with
examples.

4. Explain operator precedence in Python.

5. What are control flow statements? Explain if, elif, and else with examples.

6. Explain for and while loops with examples.

7. What is the purpose of the break and continue statements?

8. Explain the concept of indentation in Python. Why is it important?

9. What are comments in Python? How are they used?

10. What are variables in Python? How are they declared and assigned values?

11. Explain the difference between local and global variables.

12. What are functions in Python? Why are they used?

13. Explain the difference between built-in functions and user-defined functions.

14. How do you define and call a function in Python?

15. What are function arguments and parameters?

16. Explain the different types of arguments (positional, keyword, default).

17. What is recursion? Write a recursive function to calculate factorial.

18. What are lambda functions (anonymous functions)?

19. What are modules in Python? How are they imported?

20. Explain the use of the import, from, and as keywords.

21. What are packages in Python?

22. How do you handle exceptions in Python? Explain try, except, finally.

23. What are different types of exceptions in Python (e.g., TypeError, ValueError)?

24. What is file handling in Python?

25. Explain how to open, read, write, and close files in Python.

26. What are different file modes (e.g., 'r', 'w', 'a', 'x', 'b')?

27. Explain the use of with statement for file handling.

28. What are strings in Python?

29. Explain string slicing and indexing.


30. What are different string methods (e.g., upper(), lower(), strip(), split(), join())?

31. What are lists in Python?

32. Explain list indexing, slicing, and methods (e.g., append(), insert(), remove(), pop(), sort()).

33. What are tuples in Python? How are they different from lists?

34. What are dictionaries in Python?

35. Explain dictionary methods (e.g., keys(), values(), items(), get()).

36. What are sets in Python?

37. Explain set operations (e.g., union, intersection, difference).

38. How to convert between different data types in Python?

39. Explain the use of input() and print() functions.

40. What are docstrings in Python? How are they used?

II. Object-Oriented Programming (OOP) in Python

41. What is OOP? What are its advantages?

42. What are classes and objects?

43. How do you define a class in Python?

44. What are attributes and methods?

45. What is the self parameter?

46. What is a constructor (__init__())?

47. Explain inheritance.

48. What are different types of inheritance (single, multiple, multilevel)?

49. What is polymorphism?

50. Explain method overriding.

51. What is encapsulation?

52. What are access modifiers (public, protected, private)?

53. What are abstract classes and methods?

III. Data Structures

54. What are linear data structures? Give examples.

55. What are non-linear data structures? Give examples.

56. What are stacks? Explain LIFO principle.

57. Implement stack operations (push, pop, peek, is_empty).

58. What are queues? Explain FIFO principle.


59. Implement queue operations (enqueue, dequeue, is_empty).

60. What are linked lists?

61. Explain different types of linked lists (singly, doubly, circular).

62. Implement linked list operations (insertion, deletion, traversal).

63. What are trees?

64. Explain different types of trees (binary tree, binary search tree).

65. Explain tree traversals (inorder, preorder, postorder).

IV. Databases

66. What is a database?

67. What is a DBMS?

68. What are the advantages of using a DBMS?

69. What are different types of database models (relational, hierarchical, network)?

70. What is a relational database?

71. What are tables, rows, and columns?

72. What is a primary key?

73. What is a foreign key?

74. What is a composite key?

75. What are SQL commands?

76. Explain DDL commands (CREATE, ALTER, DROP).

77. Explain DML commands (SELECT, INSERT, UPDATE, DELETE).

78. What is a query?

79. Write SQL queries for selecting data with different conditions (WHERE clause).

80. Write SQL queries for sorting data (ORDER BY clause).

81. Write SQL queries for grouping data (GROUP BY clause).

82. Write SQL queries for joining tables (INNER JOIN, LEFT JOIN, RIGHT JOIN).

83. What are aggregate functions (COUNT, SUM, AVG, MAX, MIN)?

84. What is normalization? Why is it important?

85. Explain different normal forms (1NF, 2NF, 3NF).

V. Boolean Algebra

86. What are Boolean operators (AND, OR, NOT)?

87. Draw truth tables for Boolean operators.


88. What are Boolean expressions?

89. Simplify Boolean expressions using Boolean laws (e.g., De Morgan's laws, distributive law).

90. What are logic gates (AND, OR, NOT, XOR, NAND, NOR)?

91. Draw logic gate symbols.

92. Construct logic circuits from Boolean expressions.

93. Derive Boolean expressions from logic circuits.

VI. Networking

94. What is a computer network?

95. What are the advantages of networking?

96. Explain different types of networks (LAN, MAN, WAN).

97. What are network topologies (bus, star, ring, mesh)?

98. What are network protocols?

99. Explain TCP/IP model.

100. Explain OSI model.

101. What is IP addressing?

102. Explain IPv4 and IPv6.

103. What is a MAC address?

104. What are network devices (routers, switches, hubs, modems)?

105. What is the internet?

106. What is the World Wide Web (WWW)?

107. What is a URL?

108. What is a domain name?

109. What is DNS?

VII. Emerging Trends

110. What is cloud computing?

111. What are different types of cloud services (IaaS, PaaS, SaaS)?

112. What is artificial intelligence (AI)?

113. What is machine learning (ML)?

114. What is big data?

115. What is the Internet of Things (IoT)?

116. What is cybersecurity?


117. What are different types of cyber threats?

VIII. Practical/Programming Problems

118. Write a Python program to find the largest of three numbers.

119. Write a Python program to check if a number is prime.

120. Write a Python program to generate Fibonacci series.

121. Write a Python program to calculate factorial of a number using recursion.

122. Write a Python program to reverse a string.

123. Write a Python program to check if a string is a palindrome.

124. Write a Python program to count the number of vowels in a string.

125. Write a Python program to read data from a file and count the number of words.

126. Write a Python program to write data to a file.

127. Write a Python program to implement a stack.

128. Write a Python program to implement a queue.

129. Write a Python program to implement a linked list.

130. Write SQL queries to create tables, insert data, and retrieve data based on various
conditions.

I. Basic Concepts & Data Types (20)

1. Write a program to input two numbers and print their sum, difference, product, and
quotient.

2. Write a program to check if a number is even or odd.

3. Write a program to find the largest of three numbers.

4. Write a program to calculate the area of a triangle given its base and height.

5. Write a program to swap two variables without using a temporary variable.

6. Write a program to convert Celsius to Fahrenheit and vice versa.

7. Write a program to find the roots of a quadratic equation.

8. Write a program to check if a year is a leap year.

9. Write a program to calculate the simple interest.

10. Write a program to calculate the compound interest.

11. Write a program to input a string and print its length.

12. Write a program to convert a string to uppercase and lowercase.

13. Write a program to check if a character is a vowel or consonant.

14. Write a program to count the number of vowels in a string.


15. Write a program to reverse a string.

16. Write a program to check if a string is a palindrome.

17. Write a program to remove spaces from a string.

18. Write a program to count the occurrences of a character in a string.

19. Write a program to split a string into words.

20. Write a program to join a list of strings into a single string.

II. Control Flow (25)

21. Write a program to print the multiplication table of a given number.

22. Write a program to print the Fibonacci series up to n terms.

23. Write a program to find the factorial of a number.

24. Write a program to check if a number is prime.

25. Write a program to print all prime numbers within a given range.

26. Write a program to find the sum of digits of a number.

27. Write a program to reverse a number.

28. Write a program to check if a number is an Armstrong number.

29. Write a program to print patterns using nested loops (e.g., triangle, pyramid, square).

30. Write a program to find the greatest common divisor (GCD) of two numbers.

31. Write a program to find the least common multiple (LCM) of two numbers.

32. Write a program to simulate a simple calculator using if-elif-else.

33. Write a program to validate user input (e.g., check if input is a number).

34. Write a program to implement a menu-driven program.

35. Write a program to generate random numbers within a given range.

36. Write a program to simulate a coin toss.

37. Write a program to simulate rolling a dice.

38. Write a program to find the sum of even numbers in a given range.

39. Write a program to find the sum of odd numbers in a given range.

40. Write a program to check if a number is divisible by both 5 and 7.

41. Write a program to print the factors of a number.

42. Write a program to find the perfect numbers within a given range.

43. Write a program to convert decimal to binary.

44. Write a program to convert binary to decimal.


45. Write a program to generate a multiplication table up to 10.

III. Functions (25)

46. Write a function to calculate the area of a circle.

47. Write a function to calculate the factorial of a number using recursion.

48. Write a function to check if a number is prime.

49. Write a function to find the sum of digits of a number.

50. Write a function to reverse a string.

51. Write a function to check if a string is a palindrome.

52. Write a function to find the maximum of three numbers.

53. Write a function to calculate the power of a number.

54. Write a function to generate Fibonacci series.

55. Write a function to find the GCD of two numbers.

56. Write a function to convert Celsius to Fahrenheit.

57. Write a function to calculate simple interest.

58. Write a function that takes a list as input and returns the sum of its elements.

59. Write a function that takes a string as input and returns the number of words.

60. Write a function that takes a list as input and returns a new list with unique elements.

61. Write a function to check if a number is an Armstrong number.

62. Write a function to find the LCM of two numbers.

63. Write a function to convert decimal to binary.

64. Write a function to convert binary to decimal.

65. Write a function to check if a given year is a leap year.

66. Write a function to find the average of numbers in a list.

67. Write a function to find the largest and smallest number in a list.

68. Write a function to remove duplicates from a list.

69. Write a function to count the occurrences of each element in a list.

70. Write a function to merge two sorted lists.

IV. Strings and Lists (25)

71. Write a program to count the number of words in a sentence.

72. Write a program to find the longest word in a sentence.

73. Write a program to sort a list of strings alphabetically.


74. Write a program to remove punctuation from a string.

75. Write a program to replace all occurrences of a character in a string.

76. Write a program to find the frequency of each character in a string.

77. Write a program to check if two strings are anagrams.

78. Write a program to rotate a string by n positions.

79. Write a program to find all substrings of a string.

80. Write a program to find the common characters in two strings.

81. Write a program to create a list of even numbers from a given list.

82. Write a program to create a list of odd numbers from a given list.

83. Write a program to find the sum of elements in a list.

84. Write a program to find the product of elements in a list.

85. Write a program to find the average of elements in a list.

86. Write a program to find the largest and smallest element in a list.

87. Write a program to sort a list in ascending and descending order.

88. Write a program to remove duplicates from a list.

89. Write a program to reverse a list.

90. Write a program to search for an element in a list (linear search).

91. Write a program to implement binary search in a sorted list.

92. Write a program to merge two lists.

93. Write a program to split a list into chunks of n size.

94. Write a program to find the intersection of two lists.

95. Write a program to find the union of two lists.

V. File Handling (25)

96. Write a program to read data from a text file and print it.

97. Write a program to write data to a text file.

98. Write a program to append data to a text file.

99. Write a program to count the number of lines in a file.

100. Write a program to count the number of words in a file.

101. Write a program to count the number of characters in a file.

102. Write a program to find the longest word in a file.

103. Write a program to copy the contents of one file to another.


104. Write a program to read data from a CSV file.

105. Write a program to write data to a CSV file.

106. Write a program to read data from a file and store it in a list.

107. Write a program to write a list of strings to a file.

108. Write a program to search for a specific word in a file.

109. Write a program to replace a word in a file.

110. Write a program to remove blank lines from a file.

111. Write a program to convert a text file to uppercase.

112. Write a program to convert a text file to lowercase.

113. Write a program to sort the lines of a file alphabetically.

114. Write a program to read data from a file and calculate the sum of numbers.

115. Write a program to read data from a file and find the average of numbers.

116. Write a program to read data from a file and find the largest and smallest number.

117. Write a program to count the frequency of each word in a file.

118. Write a program to read data from multiple files.

I. Basic SQL Commands (10)

1. Write an SQL statement to create a table named "Students" with columns: StudentID (INT,
Primary Key), Name (VARCHAR(50)), Age (INT), and Marks (DECIMAL(5,2)).

2. Write an SQL statement to insert a new student record into the "Students" table with values:
StudentID=1, Name='John Doe', Age=17, and Marks=95.50.

3. Write an SQL statement to select all columns and rows from the "Students" table.

4. Write an SQL statement to select only the Name and Marks columns from the "Students"
table.

5. Write an SQL statement to select all students whose Age is greater than 16.

6. Write an SQL statement to select all students whose Marks are between 80 and 90
(inclusive).

7. Write an SQL statement to update the Marks of the student with StudentID=1 to 98.00.

8. Write an SQL statement to delete the student record with StudentID=1.

9. Write an SQL statement to drop the "Students" table.

10. Write an SQL statement to add a new column named "City" (VARCHAR(50)) to the "Students"
table.

II. WHERE Clause and Operators (5)

11. Write an SQL statement to select all students whose Name starts with the letter 'A'.
12. Write an SQL statement to select all students whose Name contains the word 'Doe'.

13. Write an SQL statement to select all students whose Age is NOT equal to 18.

14. Write an SQL statement to select all students whose Marks are greater than 75 AND Age is
less than 18.

15. Write an SQL statement to select all students whose City is 'New York' OR 'London'.

III. Aggregate Functions and GROUP BY (5)

16. Write an SQL statement to find the average Marks of all students.

17. Write an SQL statement to find the highest and lowest Marks in the "Students" table.

18. Write an SQL statement to count the total number of students in the table.

19. Write an SQL statement to find the sum of all Marks in the "Students" table.

20. Write an SQL statement to find the average Marks of students grouped by their City. (Assume
"City" column exists).

IV. ORDER BY and DISTINCT (3)

21. Write an SQL statement to select all students and order the results by Name in ascending
order.

22. Write an SQL statement to select all students and order the results by Marks in descending
order.

23. Write an SQL statement to select all distinct City values from the "Students" table.

V. Joins (3)

Assume you have another table named "Courses" with columns: CourseID (INT, Primary Key),
CourseName (VARCHAR(50)). And a table "StudentCourses" with columns: StudentID (INT,
Foreign Key referencing Students), CourseID (INT, Foreign Key referencing Courses).

24. Write an SQL statement to select the Name of students and the CourseName they are
enrolled in using an INNER JOIN.

25. Write an SQL statement to select all students and the courses they are enrolled in, even if
they are not enrolled in any course (LEFT JOIN).

26. Write an SQL statement to retrieve all courses and the students enrolled, even if no students
are enrolled in a course (RIGHT JOIN).

VI. Constraints (4)

27. Write an SQL statement to add a CHECK constraint to the "Students" table to ensure that Age
is always greater than 0.

28. Write an SQL statement to add a UNIQUE constraint to the Name column of the "Students"
table (assuming it doesn't have one already).

29. Explain the difference between PRIMARY KEY and FOREIGN KEY.

30. Explain the purpose of the NOT NULL constraint.

You might also like