Podcast
Questions and Answers
Which function should be created to calculate the cube of a number, using a default value if none is provided?
Which function should be created to calculate the cube of a number, using a default value if none is provided?
What is the expected output of a function that checks if two strings are of the same length?
What is the expected output of a function that checks if two strings are of the same length?
In the menu driven program to input student details, what is the criteria for assigning a result as 'pass'?
In the menu driven program to input student details, what is the criteria for assigning a result as 'pass'?
What does the program to accept a list of numbers display apart from the highest and lowest numbers?
What does the program to accept a list of numbers display apart from the highest and lowest numbers?
Signup and view all the answers
In the Employee dictionary program, what will be displayed when searching for an employee name that does not exist?
In the Employee dictionary program, what will be displayed when searching for an employee name that does not exist?
Signup and view all the answers
What functionality does the program that creates a text file 'Story.txt' provide regarding the number of capital letters?
What functionality does the program that creates a text file 'Story.txt' provide regarding the number of capital letters?
Signup and view all the answers
Which of the following is NOT a functionality of the string analysis program?
Which of the following is NOT a functionality of the string analysis program?
Signup and view all the answers
Which module is utilized in the Number Guessing Game?
Which module is utilized in the Number Guessing Game?
Signup and view all the answers
What operation is NOT included in the menu driven database connectivity program for the MySQL table MOV?
What operation is NOT included in the menu driven database connectivity program for the MySQL table MOV?
Signup and view all the answers
In the operation to read 'My School.TXT', which of the following counts is NOT described?
In the operation to read 'My School.TXT', which of the following counts is NOT described?
Signup and view all the answers
What information is included in the 'customer.dat' file?
What information is included in the 'customer.dat' file?
Signup and view all the answers
Which command is NOT part of the SQL tasks related to the Student table?
Which command is NOT part of the SQL tasks related to the Student table?
Signup and view all the answers
In the database operations for the EMP table, which of the following actions is NOT listed?
In the database operations for the EMP table, which of the following actions is NOT listed?
Signup and view all the answers
To find the number of distinct departments in the Student table, which SQL command would be utilized?
To find the number of distinct departments in the Student table, which SQL command would be utilized?
Signup and view all the answers
When creating the 'BANK' table, which field is NOT mentioned?
When creating the 'BANK' table, which field is NOT mentioned?
Signup and view all the answers
Which option describes the functionality of the menu driven program for the TEACHER table?
Which option describes the functionality of the menu driven program for the TEACHER table?
Signup and view all the answers
What SQL command is used to increase the salary of all employees above 30 years of age by 10%?
What SQL command is used to increase the salary of all employees above 30 years of age by 10%?
Signup and view all the answers
Which query would display the names of employees who are working neither in West zone nor in Centre zone?
Which query would display the names of employees who are working neither in West zone nor in Centre zone?
Signup and view all the answers
What SQL command would return the names and salaries of employees not in department 20?
What SQL command would return the names and salaries of employees not in department 20?
Signup and view all the answers
Which SQL query displays the names of various zones from the Employee table, ensuring each name appears only once?
Which SQL query displays the names of various zones from the Employee table, ensuring each name appears only once?
Signup and view all the answers
How would you display the highest, lowest, and average salary of each zone?
How would you display the highest, lowest, and average salary of each zone?
Signup and view all the answers
Which command will correctly display the names of employees working in departments 20 or 30?
Which command will correctly display the names of employees working in departments 20 or 30?
Signup and view all the answers
What SQL command can be used to put grade 'B' for all employees whose grade is currently NULL?
What SQL command can be used to put grade 'B' for all employees whose grade is currently NULL?
Signup and view all the answers
How would you display the total number of employees in departments with more than 2 employees?
How would you display the total number of employees in departments with more than 2 employees?
Signup and view all the answers
Study Notes
Python Programs
- Area Calculator: Program takes user input to select a shape and calculates its area.
-
Number Guessing Game: Uses the
random
module to generate a random number and allows the user to guess it. -
String Analysis: Program takes a string from the user and provides options:
- Palindrome Check: Verifies if the string is a palindrome.
- Character Count: Displays the total number of characters in the string.
- Word Count: Displays the total number of words in the string.
- Lowercase and Uppercase Count: Displays the number of lowercase and uppercase letters.
- Digit Count: Displays the number of digits in the string.
-
List Operations: Program takes a list of numbers from the user and displays:
- Maximum and Minimum: Identifies the highest and lowest numbers in the list.
- Reverse: Displays the list in reverse order.
-
Student Records: Program uses a nested tuple to store information about students:
- Result: Calculates and displays each student's results based on their average marks.
- Display All: Shows information about all students.
- Search: Allows users to search for a student by name and retrieve their details.
- Merit List: Displays a list of students with average marks above 74.
-
Employee Data: Program uses a dictionary to store employee information:
- Total Salary, Allowance, and Deductions: Calculates and displays the total salary, allowance, and deductions for all employees.
- Search: Allows users to search for an employee by name.
- Fibonacci Series: Generates and stores the first 12 terms of the Fibonacci series in a list.
-
Functions: Program demonstrates two functions:
- Cube Calculator: Calculates the cube of a given number, defaulting to 5 if no argument is provided.
-
String Length Comparison: Checks if two strings are of the same length and returns
True
if they are.
-
Text File Analysis: Program analyzes a text file
Story.txt
:- Blank Space Count: Counts the number of blank spaces in the file.
- Line Count: Counts the number of lines in the file.
- Capital Letter Count: Counts the number of capital letters in the file.
- Word Count: Counts the number of words in the file.
- Lowercase Letter Count: Counts the number of lowercase letters in the file.
-
File Content Replacement: Reads the file
Poem.txt
and replaces every space with a '#' character. -
School Information: Program reads the file
My School.TXT
and displays:- Character Count: Counts the number of characters in the file.
- Vowel Count: Counts the number of vowels in the file.
- Consonant Count: Counts the number of consonants in the file.
- Words Starting with 'A': Counts words that start with the letter 'A'.
-
Customer Information: Program manages a data file
customer.dat
that stores customer information. -
Stack Operations: Program implements a stack (EMP) that stores employee information:
- Push: Adds an employee to the stack.
- Pop: Removes an employee from the stack.
- Peek: Displays the top element of the stack.
- IsEmpty/IsFull: Checks if the stack is empty or full.
-
MySQL Database Connectivity: Programs connect to MySQL and perform operations on tables:
-
EMP Table:
- Create: Creates the EMP table with the specified columns.
- Insert: Inserts new records into the EMP table.
- Display: Displays all records in the EMP table.
-
TEACHER Table:
- Create: Creates the TEACHER table with the specified columns.
- Insert: Inserts new records into the TEACHER table.
- Delete: Deletes records from the TEACHER table.
-
BANK Table:
- Create: Creates the BANK table with the specified columns.
- Insert: Inserts new records into the BANK table.
- Update: Updates existing records in the BANK table.
-
MOV Table:
- Create: Creates the MOV table with the specified columns.
- Insert: Inserts new records into the MOV table.
- Search: Searches for records in the MOV table.
-
EMP Table:
SQL Program
-
Student Table: Program works with a
Student
table. -
Insert Records: Inserts data into the
Student
table. -
Select Queries:
- Display by Department: Displays information about students in the 'Computer' department.
- Female Students in Hindi: Displays names of female students in the 'Hindi' department.
- Ascending Order: Displays student names and their date of joining in ascending order.
- Male Student Details: Displays the admission number, name, and age of male students.
- Students Older than 19: Counts the number of students older than 19 years of age.
- Insert New Row: Adds a new student record to the table.
- Distinct Departments: Displays the number of different departments in the table.
- Student Count per Department: Shows the number of students in each department.
- Names Starting with 'A': Displays student details whose names start with the letter 'A'.
- Female Students After 2016: Displays female student details who joined after 2016.
SQL Program: Employee & Department Tables
-
Table Creation: Programs create the
Employee
andDepartment
tables. -
Display Records: Displays records from both the
Employee
andDepartment
tables. - Employee Salary Calculation: Calculates and displays the annual salary for all employees.
- Employees in North Zone: Displays details of all employees working in the 'North' zone.
- Employees with NULL Grade: Displays details of all employees whose grade is NULL.
-
Distinct Zones: Displays unique zone names from the
Employee
table. - Employees with Salary over 35000 in Department 30: Displays details of employees working in department 30 and earning more than 35000.
- Employees not in Department 20: Displays names and salaries of employees who are not working in department 20.
- Employees not in West or Centre: Displays details of employees who work neither in the 'West' nor 'Centre' zone.
- Employees in Department 20 or 30: Displays details of employees working in either department 20 or 30.
- Grade Range: Displays details of employees with grades between 'A' and 'C'.
- Employee Names Containing 'a': Displays names, salaries, and ages of employees whose names contain the letter 'a'.
- Salary Summary: Calculates and displays the sum and average salary of all employees.
- Salary Statistics per Zone: Calculates and displays the maximum, minimum, and average salary in each zone.
- Assign Grade 'B': Assigns grade 'B' to all employees whose grade is NULL.
- Salary Increase for Older Employees: Increases the salary of all employees over 30 years of age by 10%.
- Delete Specific Records: Deletes records of employees with grade 'C' and salary less than 30000.
-
Add Hire Date Column: Adds a new column named 'hiredate' to the
Employee
table. - Employees in Sales: Displays details of employees working in the 'Sales' department.
- Employee Name and Department: Displays the name and department name of each employee.
- Department and HOD: Displays the department names and corresponding HOD names.
- Department Wise Employee Detail: Displays employee details sorted by department in descending order.
- Departments with More than 2 Employees: Displays departments with a total number of employees greater than 2.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.