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

Practical Practice Questions

The document outlines a series of programming tasks and SQL queries related to various tables such as Workers, LAB, Products, Teacher, Games, Hospital, Employee, and Club. Each task includes writing programs in Netbeans IDE for mathematical operations and SQL commands to manipulate and retrieve data from specified tables. The tasks are structured to assess understanding of programming and database management concepts.

Uploaded by

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

Practical Practice Questions

The document outlines a series of programming tasks and SQL queries related to various tables such as Workers, LAB, Products, Teacher, Games, Hospital, Employee, and Club. Each task includes writing programs in Netbeans IDE for mathematical operations and SQL commands to manipulate and retrieve data from specified tables. The tasks are structured to assess understanding of programming and database management concepts.

Uploaded by

Somesh
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/ 5

1. Write a program to add two numbers using Netbeans IDE.

5 marks
2. Write a Program to calculate area of a circle using Netbeans IDE. 5 marks
3. Consider following table named Workers, write commands of following questions 5 marks
ECode Name Desig PLevel Doj Dob
11 Radhe Shyam Supervisor P001 13-sep-2004 23-Aug-1981
12 Chander Nath Operator P003 22-feb-2010 12-jul-1987
13 Fizza Operator P003 14-jun-2009 14-oct-1983
15 Ameen Ahmed Mechanic P002 21-aug-2006 13-mar-1984
18 Sanya Clerk P002 19-dec-2005 09-jun-1983
a) Write a query to display the details of all WORKERs in descending order of DOB.
b) Write a query to display NAME and DESIG of those WORKERs, whose PLEVEL is either P001 or P002.
c) Write a query to display the content of all the WORKERs table, whose DOB is in between ’19-JAN-1984’
and ’18-JAN-1987’.
d) Write a query to add a new row with the following:
19, Daya Kishore’,’Operator’, ‘P003’,’19-jun-2008’, ’11-jul-1984’
e) Write a query to display the name of all the P003 from WORKER.

4. Consider following table named LAB, write output of SQL of following questions 5 marks
No. Itemname CostPerItem Quantity Date of Purchase Warranty Operational
1 Computer 6000 9 21/5/96 2 7
2 Printer 15000 3 21//5/97 4 2
3 Scanner 18000 1 29/8/98 3 1
4 Camera 21000 2 13/6/96 1 2
5 Hub 8000 1 31/10/99 2 1
6 Ups 5000 5 21/5/96 1 4
7 Plotter 25000 2 11/1/2000 2 2

a) SELECT MIN(DISTINCT Quantity) from LABORATORY;


b) SELECT MIN(WARRANTY) FROM LAB WHERE Quantity =2;
c) SELECT SUM(CostPerItem) FROM LAB WHERE Quantity >2;
d) SELECT AVG (CostPerItem) FROM LAB WHERE Date of Purchase<{1/1/9};
e) SELECT MAX(Quantity) FROM LAB;
1. Write a program to multiplication of two numbers using Netbeans IDE. 5 marks
2. Write a Program to calculate area of a square using Netbeans IDE. 5 marks
3. Consider following table named Products, write commands of following questions 5 marks

PId PName Qty Price Company


101 DIGITAL CAMERA 120 12000 RENIX
102 DIGITAL PAD 100 22000 DIGI POP
104 PEN DRIVE 500 1100 STOREKING
106 LED SCREEN 70 28000 DISPEXPERTS
105 CAR GPS SYSTEM 60 12000 MOVEON

a) To display the details of all the products in ascending order of product names.
b) To display the price, product name and quantity (i.e. qty) of those products which have quantity more than
100.
c) To display product name and price of all those products, whose price is 22000.
d) To display the maximum price Product Name.
e) To display the Pname, Qty, Price whose company is RENIX.
4. Consider following table named Teacher, write output of SQL of following questions 5 marks
NO Name Department DateofJoining Salary Status
1 Raja Computer 21/5/98 8000 M
2 Sangita History 21/5/97 9000 F
3 Ritu Sociology 29/8/98 8000 F
4 Kumar Linguistics 13/6/96 10000 M
5 Venkatraman History 31/10/99 8000 M
6 Sidhu Computer 21/5/86 14000 M
7 Aishwarya Sociology 11/1/1988 12000 F

a) SELECT MIN(DISTINCT Salary) from Teacher;


b) SELECT MIN(Salary) FROM Teacher WHERE Status = “M”;
c) SELECT SUM(Salary) FROM Teacher WHERE Department = “History” ;
d) SELECT AVG (Salary) FROM Teacher WHERE Dateofjoining<{1/1/98};
e) SELECT MAX(Salary) FROM LAB;
1. Write a program to check even and odd numbers 5 marks
2. Write a Program to calculate to division of two numbers. 5 marks
3. Consider following table named Games, write commands of following questions 5 marks
GCode Game Name Type Number Prize Money Schedule Date
101 CAROM BOARD INDOOR 2 5000 23-JAN-2004
102 BADMINTON OUTDOOR 2 12000 12-DEC-2003
103 TABLE TENNIS INDOOR 4 8000 14-FEB-2004
105 CHESS INDOOR 2 9000 01-JAN-2004
108 LAWN TENNIS OUTDOOR 4 25000 19-MAR-2004

a) Write a query to display the names of all GAMES with their GCODES.
b) Write a query to display details of those GAMES which are having Prize Money more than 7000.
c) Write a query to display the content of the GAMES table in ascending order of schedule Date.
d) Write a query to display sum of Prize Money for each types of GAMES.
e) Write a query to display the names of all the indoor games.
4. Consider following table named Hospital, write output of SQL of following questions 5 marks
NO Name Age Department Dateofadm Charges status
1 Arpit 62 Surgery 21/01/98 300 M
2 Zarina 22 ENT 12/12/97 250 F
3 Kareem 32 Orthopedic 19/02/98 200 M
4 Arun 12 Surgery 11/01/98 300 M
5 Zubin 30 ENT 12/01/98 250 M
6 Ketaki 16 ENT 24/02/98 250 F
7 Ankita 29 Cardiology 20/02/98 800 F
8 Zareen 45 Gynecology 22/02/98 300 F
9 Kush 19 Cardiology 13/02/98 800 M
10 Shilpa 23 Nucl medicine 21/02/98 400 F

a) SELECT COUNT(DISTINCT Charges) from HOSPITAL;


b) SELECT MIN(Age) FROM HOSPITAL WHERE Status = “F”;
c) SELECT SUM(Charges) FROM HOSPITAL WHERE DEPARTMENT= “ENT”;
d) SELECT AVG (Charges) FROM HOSPITAL WHERE Dateofadm<{12/08/98};

e) SELECT MAX(Age) FROM LAB;

1. Write a program to calculate simple interest using Netbeans IDE. 5 marks


2. Write a Program to calculate subtraction of two numbers using Netbeans IDE. 5 marks
3. Consider following table named Employee table, write commands of following questions 5 marks
ECODE NAME DESIG SGRADE DOJ DOB
101 Abdul EXECUTIVE S03 23-MAR-2003 13-JAN-1980
102 Ravi HEAD-IT S02 12-FEB-2010 22-JUL-1987
103 John RECEPTIONIST S03 24-JUN-2009 24-FEB-1983
105 Nazar GM S02 11-AUG-2006 03-MAR-1984
108 Priyam CEO S01 29-DEC-2004 19-JAN-1982

a) To Display the details of all EMPLOYEEs in descending order of DOJ.


b) To Display NAME and DESIG of those EMPLOYEEs, whose SALGRADE is either S02 or S03.
c) To Display the Content of all the EMPLOYEEs table, Whose DOJ is in between ’09-Feb-2006’ and ’08-Aug-2009’
d) To add a new row with the following:
19, ‘Harish’, HEAD-IT’, ‘S02’, ’09-Sep-2007’, ’21-Apr-1983’
e) Write a query to display all the records of a table EMPLOYEE.

4. Consider following table named Club, write output of SQL of following questions 5 marks
NO COACHNAME AGE SPORTS DATEOFAPP PAY STATUS
1 Kukreja 35 Karate 27/03/1996 1000 M
2 Ravina 34 Karate 20/01/1998 1200 F
3 Karan 34 Squash 19/02/1998 2000 M
4 Tarun 33 Basketball 01/01/1998 1500 M
5 Zubin 36 Swimming 12/01/1998 750 M
6 Ketaki 36 Swimming 24/02/1998 800 F
7 Ankita 39 Squash 22/02/1998 2200 F
8 Zareen 37 karate 22/02/1998 1100 F
9 Kush 41 swimminh 13/01/1998 900 M
10 shailya 37 Basketball 09/02/1998 1700 M

a) SELECT COUNT(DISTINCT SPORTS) from CLUB;


b) SELECT MIN(Age) FROM CLUB WHERE STATUS = “F”;
c) SELECT SUM(PAY) FROM CLUB WHERE DEPARTMENT= “KARATE”;
d) SELECT AVG (PAY) FROM CLUB WHERE DATEOFAPP >{31/01/98};

e) SELECT MAX(Age) FROM LAB;

You might also like