0% found this document useful (0 votes)
343 views90 pages

Document 31 1

The document contains questions related to functions, strings, numbers, dates, SQL queries and database operations. It asks to write functions to check if a number is perfect, reverse a string, find square root, return sum of numbers etc. It also asks SQL queries to display data from tables, insert/update/delete records, perform aggregate functions and extract/manipulate strings and dates.

Uploaded by

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

Document 31 1

The document contains questions related to functions, strings, numbers, dates, SQL queries and database operations. It asks to write functions to check if a number is perfect, reverse a string, find square root, return sum of numbers etc. It also asks SQL queries to display data from tables, insert/update/delete records, perform aggregate functions and extract/manipulate strings and dates.

Uploaded by

Reya garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 90

Q1) Write a function to check whether a number is perfect or not.

Input:

Output:

Q2) Write a function to reverse a string.

Input:

Output:
Q3) Write a function to find the square root of a number.

Input:

Ouput:

Q4) Write a function to return sum of multiple numbers. (variable,length,argument)

Input:

Ouput:
Q5) Write a function to return the sum of three numbers.

Input:

Output:
Q6) Write a function to perform binary search in a sorted list.

Input:

Output:
Q7) Write a program to perform insert and delete operations on a queue containing member
details as member number, member name and member age.

Input:

Output:
Q8) Write a program to implement stack of book details. Each of the details contains book name,
and book number. Implement push, pop and display operations.

Input:

Output:
Q9) WAP to sort list using bubble sort.

Output:
Q8) Write a program to implement stack of book details. Each of the details contains book name,
and book number. Implement push, pop and display operations.

Input:

Output:
Q9) WAP to sort list using bubble sort.

Input:

Output:

Q10) WAP to sort list using insertion sort.

Input:

Output:
Q11) WAF recursive function to find factorial of number.

Input:

Output:

Q12) WAP using a recursive function to print fibonacci series upto n terms.

Input:

Output:
Q13) Write a random number generator that generate a random no b/w 1 and 6. (stimulate a die)

Input:

Output:

Q14) WAF that takes a +ve integer and returns the ones position digit of Integer.

Input:

Output:
Q15) WAP to read a text file line by line and display each word separated by #.

Input:

Output:

Q16) WAP to read a text file and display the count of vowel and consonant in the file.

Input:

Output:
Q17) WAP to get roll no, name and mark of students of a class and store the details in file called
marks.txt.

Input:

Output:
Q18) Consider a binary file, stu.dat containing student details. WAP to update the records of a file
so that those who have score more than 81 should get additional bonus marks of 2

Input:

Output:
Q19) WAP to open binary file and search for records with roll no 12 or 14 if found will display the
record.

Input:

Output:
Q20) WAP to read details of sports performance (score, competition, prizes won) of your school
and store it into csv file delimeted with tab character.

Input:

Output:

Q21) WAP to display number of lines in a file.

Input:

Output:
SQL
1.WAQ to display name, rollno and aggregate divided by 5. Name the column aggregate divided by
5 as percentage in a student table.

Input:

Output:
2. WAQ that produces result as student name, aggregate, age.

Input:

Output:
3. WAQ to display name, age and marks of students whose age is greater than or equal to 16 from
students table.

Input:

Output:
4. WAQ that displays all the details from pet table for species cat or dog and gender as male.

Input:

Output:
5. Display all the records from table empl.

Input:

Output:
6. Display Empno, ename of all employees in empl.

Input:

Output:
7. Display ename, sal and sal added with comm from table empl.

Input:

Output:
8.Write a query to display employee name, salary, and department number who are not getting
commission from table empl.

Input:

Output:
9. Write a query to display employee number, name, sal and sal*12 as annual salary whose
commission is not NULL from table empl.

Input:

Output:
10. List all department numbers in empl.

Input:

Output:
11.List all unique department numbers in table empl.

Input:

Output:
12. List details of all clerks who have not been assigned departments as yet.

Input:

Output:
13. List all the details of those employees who have four lettered names.

Input:

Output:
14. List the details of all the employees whose annual salary is between 25000-40000.

Input:

Output:
13. How many job types are offered?

Input:

Output:
14. List the details of employees who earn more commission than their salaries.

Input:

Output:
15. Write a query to display the name, job title, and salary of employee who do not have
manager.

Input:

Output:
16. Write a query to display the name of employee whose name contains ‘A’ as third alphabet.

Input:

Output:
17. Write a query to display the name of employee whose name has T as the last alphabet.

Input:

Output:
18. Write a query to display the name of the employee having L as any alphabet of the name.

Input:

Output:
19. Display the names of the students who have grade ‘C’ in either Game1 or Game2 or both.

Input:

Output:
20.Display the names of the students who have same game for both Game1 and Game2.

Input:

Output:
21. Display the games taken up by the students, whose name starts with ‘A’.

Input:

Output:
22.Find minimum average marks where average marks<75.

Input:

Output:
23.Find the sum of stipend where grade is B.

Input:

Output:
24.Find average stipend where class is 12A.

Input:

Output:
25. Display the number of fields available.

Input:

Output:
27. Update the record the last name, user id and salary with the ID 4.

Input:

Output:
28. Make the changes permanent.

Input:

Output:
29. Modify the last name of the employee 3 to Gautam.

Input:

Output:
30. Modify the salary and increase it by 1000, for all those who get less than 5000.

Input:

Output:
31. Delete the employee whose first name is Pranav.

Input:

Output:
32.Remove all the contents of the table.

Input:

Output:
33. Add one column email of data type VARCHAR and size 30 in the table customer.

Input:

Output:
34. Change the data type of column customer_address to VARCHAR(10) in the table Customer.

Input:

Output:
35. Add a primary key constraint to the table Employee2 using the EmpID.

Input:

Output:
36. Display records from the table in alphabetical order as per the name of the student.

Input:

Output:
37. To display Class, Dob and City whose marks is between 450 and 551. 

Input:

Output:
40. To display Name, Class and total number of students who have secured more than 450 marks,
class wise.

Input:

Output:
41. To increase marks of all students by 20 whose class is “XII”

Input:

Output:
42. Write sql commands to show all the information about the students of the history department.

Input:

Output:
43. Write sql commands to list the names of female students who are in Hindi department.

Input:

Output:
44. Write sql commands to list names of all the students with their date of admission in ascending
order.

Input:

Output:
45. Write sql commands to display the student’s name, fee, age for male students only.

Input:

Output:
46. Write sql commands to count the number of students with age <23.

Input:

Output:
47. Write sql commands to insert a new row in the table with the data:

9, “Zaheer”,36, “Computer”, {12/03/97}, 230, “M”.

Input:

Output:
48. Write sql commands to count the number of departments.

Input:

Output:
49. Write sql commands to find maximum age from female students.

Input:

Output:

50. Write sql commands to find average of fees where the date of admission is <{01/01/98}.

Input:

Output:
51. Write sql commands to find the sum of fees where the date of admission is <{01/01/98}.

Input:

Output:
52. Write a query to display Wno, Name, Gender from the table WORKER in descending order of
Wno.

Input:

Output:
53. Write a query to display the name of all the female workers from the table.

Input:

Output:
54. Write a query to display the Wno and Name of those workers who were born between 1987-
01-01 and 1991-12-01.

Input:

Output:
55. Write a query to count and display Male workers who have joined after 1986-01-01.

Input:

Output:
56. Write a query to display the number of dcodes more than 1 and their count.

Input:

Output:
57. Write a query to show the distinct departments.

Input:

Output:
58. Write a query to display the name, department and city of those workers with dcode<1003.

Input:

Output:
59. Write a query to show the maximum date of joining and minimum date of birth.

Input:

Output:
60. Display information of students in 11 B.

INPUT:

Output:
61. Display 11th and 12th class student information.

Input:

Output:
62.Display student information of those who aren’t in class 10.

Input:

Output:
63. Display the total fees paid.

Input:

Output:
64. Display the average of the total fees paid.

Input:

Output:
65. Display the maximum fees.

Input:

Output:
66. Display minimum fees.

Input:

Output:
67. Display the total number of students.

Input:

Output:

68. Display 4 characters extracted from 3rd left character onwards from ‘abcdefg’.

Input and Output:

69. Display first three characters extracted from jobs of emp 8888 or 8900.

Input and Output:


70. Remove leading and trailing spaces from “Bar one”.

Input and Output:

71. How many characters are there in ‘CANDIE’.

Input and Output:

72. WAQ to extract a substring from ‘Quadratically’ which should be 6 character long and should
start from 5th character.

Input and Output:

73. Find remainder of 11 / 4 and display 3^2.

Input and Output:


74. Truncate value of 15.79 to 1 decimal place.

Input and Output:

75. WAQ to display Current date.

Input and Output:

76. WAQ to display date 10 days after current date.

Input and Output:

77. WAQ to extract date from ‘2012-12-31 01:02:03’.

Input and Output:


78. WAQ to display current date and time.

Input and Output:

79. Write a program that displays first three rows fetched from student table of mysql database
‘school’.

Input:

Output:
80. Write a program that displays all records fetched from student table of mysql database
‘practical’.

Input:

Output:
81. Write a program to delete the record of student on the basis of name entered at run time from
‘student’ table.

Input:

Output:
82.Write a program to insert multiple records in ‘student’ table.

Input:

Output:
83. Write a program to update the marks of roll no 5 to 87 in a student table of mysql.

Input:

Output:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy