0% found this document useful (0 votes)
9 views5 pages

Annual Practice Questions

The document outlines various programming tasks including defining classes in a programming language, writing SQL queries for managing and retrieving data from tables, and working with Boolean functions. It specifies requirements for classes such as 'sum', 'rectangle', 'Time', and 'square', along with SQL operations for electricity bills, student records, employee details, and marks. Additionally, it includes tasks related to creating, updating, and deleting records in SQL tables.

Uploaded by

bhuvankumar9945
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)
9 views5 pages

Annual Practice Questions

The document outlines various programming tasks including defining classes in a programming language, writing SQL queries for managing and retrieving data from tables, and working with Boolean functions. It specifies requirements for classes such as 'sum', 'rectangle', 'Time', and 'square', along with SQL operations for electricity bills, student records, employee details, and marks. Additionally, it includes tasks related to creating, updating, and deleting records in SQL tables.

Uploaded by

bhuvankumar9945
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
You are on page 1/ 5

1. Define a class named sum with the following conditions.

a. Data members : x and y


b. Member functions : input( ) and output( )
c. Define member functions outside the class to input and output x and y
values.
2. Using given SQL table of electricity bill, write the appropriate SQL queries.

RRNumber Name Billdate Units Amount


R0001 FFFF 05-08-2024 210 1470
R0002 GGGG 04-08-2024 300 2100
R0003 HHHH 05-08-2024 260 1820

i. To develop the table with above fields.


ii. To display the structure of the table.
iii. To find total number of customers.
iv. To find the units consumed by all the customers.
v. To display all customers records.
3. Given the Boolean function F(A,B,C,D) = ∑(0,1,2,3,5,8,9,10,11,13)
4. Given the Boolean function F(A,B,C,D) = ∑(0,1,3,4,5,7,12,13,15)
5. Define a class named rectangle with the following criteria
i. Data members: length, breadth
ii. Member functions : input( ) and output( )
iii. Define member functions outside the class to input output
length and breadth of a rectangle.
6. Using the given SQL table write the appropriate SQL query
Reg No Name DOB Marks
40001 MMMM 15-06-2008 501
40002 NNNN 24-04-2008 325
40003 YYYY 10-07-2009 410

i. To develop the table with above fields


ii. To find the total number of students
iii. To find highest marks
iv. To find the lowest marks
v. To display all students information
7. Given the Boolean function F(A,B,C,D)= ∑(0,2,6,7,8,9,10,11,13)
8. Define a class Time with the following members and conditions
i. Data members : hours, minute, seconds
ii. Member function : getdata( ) and output( ).
iii. Define member function inside the class to input and output
hour, minute and seconds.
9. Write the SQL query for the following questions based on given employee
table.
Empid Name Age Salary
101 AAA 35 25000
102 BBB 28 18000
103 CCC 30 10000

i. Develop the table with the above fields


ii. Display the structure of the table
iii. Find the total number of employees
iv. Find the sum of all employee’s salary
v. Display all employee records with age > = 15
10.Given the Boolean function F(A,B,C,D) = ∑(0,1,3,5,6,7,10,14,15)
11.Given the Boolean function F(A,B,C,D) = ∑(1,3,8,9,10,11,12,14)
12.Define a class named square with the following criteria
i. Data member : side
ii. Member functions : input( ) and output( )
iii. Define member functions to input the data value and output
area of square.
13.Write the appropriate SQL query for the following:
Regno Name Sub1 Sub2 Total
2005 KKKK 98 95
2002 GGGG 96 99
2001 SSSS 85 80

i. Create a table marks with the above fields.


ii. Update Total with the sum of sub1 and sub2 marks.
iii. Find the highest marks in Total.
iv. Sort the table on regno field
v. View all records.
14.Write the SQL command to develop following table also find total,
percentage and result in the table.
Roll No Name Sub1 Sub2 Sub3 Total Perc Result

101 Smit 80 95 65
102 Anil 70 86 56
103 Rani 25 75 78

15. Given the Boolean function F(A,B,C,D) = ∑(1,2,3,5,7,8,9,11,13,15)


16.Given the Boolean function F(A,B,C,D) = ∑(0,1,3,4,5,7,9,10,11,13)
17.Give a set of SQL commands to create the following table, insert records
and calculate the net salary
Employee Name Basic DA HRA Professional Net
Salary Salary Tax Salary

DA = 45% of Basic Salary


HRA = 15% of Basic Salary
Professional Tax = 200
Net Salary = Basic Salary + DA + HRA – Professional Tax
18.Given the Boolean function F(A,B,C,D) = ∑(1,3,5,7,8,9,10,12,14)
19.Write the SQL commands to create the following table assuming proper
datatypes. Also calculate the gross salary, minimum and maximum of basic
salary.
Emp ID Name Basic Salary DA HRA
1001 ABC 28000 1400 2800
1002 GHI 22000 1100 2200
1003 PQR 36000 1800 3600

20. Given the Boolean function F(A,B,C,D) = ∑(1,3,5,7,8,9,10,12,14)


21. Write the SQL command to develop the following table also find total,
maximum and minimum marks.
REG NAME SUB1 SUB2 SUB3 TOTAL MAX MIN
101 AAA 45 67 78 98 98 45
102 BBB 89 67 34 56 89 34
103 CCC 92 99 67 76 99 67

22. Given the Boolean function F(A,B,C,D) = ∑(0,2,3,8,9,10,11,13,15)


23.Write the SQL commands
i. To develop the following table
ii. To find TA(5% of basic salary)
iii. To display all the employees whose basic salary is more than
30000.00
iv. To remove the record whose Emp_ID is 802.
Emp_ID Emp_Name Basic_Salary TA Total_Salary
801 AAA 38000.00 1900.00 39900.00
802 BBB 41000.00 2050.00 43050.00
803 CCC 29000.00 1450.00 30450.00

24.Given the Boolean function F(A,B,C,D) = ∑(0,2,3,4,6,7,8,10,11,12,14,15)


25.Develop SQL queries to perform the following functions.
i. To create the following table
ii. To insert the given records.
iii. To display the names of Employees having same DOJ
iv. To modify the table to add new column(EAddress
varchar2(25))
v. To delete employees who reached the age of 60 years.
EID EName EDept ESalary EDOJ EAge
1001 Amar Sales 90000 01-01-2005 56

1002 Akbar Purchase 95000 01-01-2001 60


1003 Anthony Inventory 95000 01-01-2001 59

26.Write the SQL commands for the following structure.


ECode EName Salary
A100 Raju 40000
A101 Sita 50000

1) Create the table employee with the following structure


Field name Type
ECode Varchar2(10)
EName Varchar2(20)
Salary Number(8)
2) Insert 2 records into the table
3) To count the number of employees
4) Update the employer salary by 5%
5) Delete a record whose salary is 50.000.

27.Create a class student and define the following function outside the class
a. Data members : regno, name
b. Member functions : getdata( ) nad display( ).

You might also like