Untitled Quiz
24 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which function should be created to calculate the cube of a number, using a default value if none is provided?

  • A function that takes two numbers as arguments
  • A function that calculates the average of two numbers
  • A function that calculates the square of a number by default
  • A function that takes a number as an argument and returns its cube (correct)
  • What is the expected output of a function that checks if two strings are of the same length?

  • Returns a boolean indicating if they are equal (correct)
  • Always returns True regardless of string lengths
  • Returns a message stating the length of each string
  • Returns a numerical difference of their lengths
  • In the menu driven program to input student details, what is the criteria for assigning a result as 'pass'?

  • If total marks are less than 33
  • If names contain more than 5 letters
  • If total marks are greater than or equal to 32
  • If average marks are more than 32 (correct)
  • What does the program to accept a list of numbers display apart from the highest and lowest numbers?

    <p>The reverse of the list</p> 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?

    <p>Not found message</p> 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?

    <p>Displays the number of capital letters in the file</p> Signup and view all the answers

    Which of the following is NOT a functionality of the string analysis program?

    <p>Sorting the characters of the string</p> Signup and view all the answers

    Which module is utilized in the Number Guessing Game?

    <p>random</p> Signup and view all the answers

    What operation is NOT included in the menu driven database connectivity program for the MySQL table MOV?

    <p>Display</p> Signup and view all the answers

    In the operation to read 'My School.TXT', which of the following counts is NOT described?

    <p>Number of paragraphs</p> Signup and view all the answers

    What information is included in the 'customer.dat' file?

    <p>Customer_Id, Cust_City, Cust_Name</p> Signup and view all the answers

    Which command is NOT part of the SQL tasks related to the Student table?

    <p>Display names of students with age above 18</p> Signup and view all the answers

    In the database operations for the EMP table, which of the following actions is NOT listed?

    <p>Update</p> Signup and view all the answers

    To find the number of distinct departments in the Student table, which SQL command would be utilized?

    <p>SELECT COUNT(DISTINCT Department) FROM Student;</p> Signup and view all the answers

    When creating the 'BANK' table, which field is NOT mentioned?

    <p>Transaction_History</p> Signup and view all the answers

    Which option describes the functionality of the menu driven program for the TEACHER table?

    <p>Create, Insert, Delete, Exit</p> 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%?

    <p>UPDATE Employee SET salary = salary * 1.10 WHERE age &gt; 30</p> 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?

    <p>SELECT name FROM Employee WHERE zone NOT IN ('West', 'Centre')</p> Signup and view all the answers

    What SQL command would return the names and salaries of employees not in department 20?

    <p>SELECT name, salary FROM Employee WHERE department NOT IN (20)</p> 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?

    <p>SELECT DISTINCT zone FROM Employee</p> Signup and view all the answers

    How would you display the highest, lowest, and average salary of each zone?

    <p>SELECT zone, MAX(salary), MIN(salary), AVG(salary) FROM Employee GROUP BY zone</p> Signup and view all the answers

    Which command will correctly display the names of employees working in departments 20 or 30?

    <p>SELECT name FROM Employee WHERE department IN (20, 30)</p> Signup and view all the answers

    What SQL command can be used to put grade 'B' for all employees whose grade is currently NULL?

    <p>UPDATE Employee SET grade = 'B' WHERE grade IS NULL</p> Signup and view all the answers

    How would you display the total number of employees in departments with more than 2 employees?

    <p>SELECT department, COUNT(employee_id) FROM Employee GROUP BY department HAVING COUNT(employee_id) &gt; 2</p> 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.

    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 and Department tables.
    • Display Records: Displays records from both the Employee and Department 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.

    Quiz Team

    Related Documents

    G12 Practical File 2024-25.docx

    More Like This

    Untitled Quiz
    6 questions

    Untitled Quiz

    AdoredHealing avatar
    AdoredHealing
    Untitled Quiz
    19 questions

    Untitled Quiz

    TalentedFantasy1640 avatar
    TalentedFantasy1640
    Untitled Quiz
    18 questions

    Untitled Quiz

    RighteousIguana avatar
    RighteousIguana
    Untitled Quiz
    50 questions

    Untitled Quiz

    JoyousSulfur avatar
    JoyousSulfur
    Use Quizgecko on...
    Browser
    Browser