Informatics Practices
Informatics Practices
1
HARWARE CONCEPTS
TYPE A: VERY SHORT ANSWER QUESTION
1. What is a computer? Name functional components of a digital computer?
2. What is the function of main memory? What are the measuring units of memory?
3. What do you mean by terms Hardware, software & firmware?
4. What are the functions of operating system and language processor? Give examples of
each.
5. What is Assembler, Compiler and Interpreter.
6. What do you understand by application software?
7. Write full forms of:
1. VDU
5. MICR
2. OMR
6. LCD
3. DMP
7. CRT
4. CD-ROM
8. DVD
8. What is the advantage of non-impact printers over impact printers?
9. Out of following devices, write whether they are input devices, output devices or
2. Flatbed plotter
3. Joystick
4. OMR
5. Web camera
6. Optical Disk
7. Magnetic Disk
8. MICR
10. What are the two types of RAM? Name various types of ROMs. Write their names in full
forms.
11. What is communication bus? What are its types?
12. What is a port? Name some ports types briefly.
13. Name two ports that allow wireless connection of devices.
2.
What is the function of CPU in a computer system? What are its subunits?
3.
Draw a block diagram of the main units of a computer hardware system and
explain its functionality.
4.
5.
How are computers classified? How are they different from one another?
6.
What do you understand by the term Super Computers? Give the name of super
computers installed in India.
7.
What are RAM and ROM? How are they alike? How are they different?
8.
9.
How is Optical Character Recognition (OCR) used for data input? What are the
advantages and disadvantages of OCR?
10. What do you mean by Storage Devices? Describe the function of Hard Disk with a
diagram.
11. Write brief notes on each of the following types of printer. Make clear the differences
between them in terms of speed, cost and method of operation and suggest suitable
application.
o
Inkjet printer
Laser printer
A track ball
A light pen
A graphic tablet
A touch screen
13. Briefly explain and differentiate between
(c) Impact printer & Non-Impact printers (d) VDU & LCD
(e) Hardware & Software
15. Why do you think USB ports are popular these days?
16. What is a memory card? Discuss briefly its types.
Assignment No. 2
SOFTWARE CONCEPTS
2.
3.
What is an Operating system? What is its role? Name some commonly used
Operating systems.
4.
5.
6.
1. Spam
2. Malware
4. Firewall
5. Digital Signature
TYPE B: SHORT ANSWER QUESTIONS
3. Phishing
6. Digital
Certificate
1.
What is system software? What role does it play in the functioning of the computer?
2.
What is Operating System? Why it is called Resource Manager? Explain its functions.
3.
ii.
iii.
iv.
4.
What is Utility software? Discuss the role of utility software in the context of
computer performance and tuning.
5.
6.
7.
8.
What do you mean by System Security? What are different types of threats to
computer security?
9.
What are Malware? What types of damages can they cause to your computer?
Assignment No. 3
GETTING STARTED WITH PROGRAMMING USING IDE
TYPE A: VERY SHORT ANSWER QUESTION
1.
2.
3.
4.
5.
6.
What happens to container control and its child controls if you delete the container
control
2.
3.
What is the role of JVM ? How byte code makes a Java program platform independent?
4.
5.
Define the Event, message and method? How they are interrelated?
6.
Name at least 3 commonly used swing controls. Also give some of their
properties and methods.
7.
Sketch a screen shot of NetBeans IDE and Name the various components.
8.
Make a list Swing Containers and Swing Controls available in Palatte. Also write their
use.
9.
(ii)
(iii)
(iv)
(v)
How to change the name of the push buttons to DisplayButton and of text
field to dispTextField.
b.
Assignment No. 4
PROGRAMMING FUNDAMENTALS
TYPE A: VERY SHORT ANSWER QUESTION
1.
2.
3.
4.
5.
6.
7.
8.
What is an integer constant? How Octal and Hexadecimal integers are represented in
Java.
9.
What kind of program elements are the following: 13, a, 4.38925, a, main() ?
10. What kind of constants are the following: 14, 011, 0X2A, 17, 014, 0XBC1, 2.50 ?
11. What is a character constant in Java? How are nongraphic characters represented in Java?
12. Which escape sequences represent the newline character & null character?
13. What is floating constant in Java? How many ways can a floating constant be
represented?
14. Write the following real constants into exponent form: 23.197, 7.214, 0.00005, 0.319.
15.
Write the following real constants into fractional form: 0.31E04, 0.471E-04, 0.4E-05.
17. Convert the 35, 30, 56 decimal numbers into its Binary form.
18. Convert the 010011 , 1010110, 01100011 into its Decimal form.
19. What
(ii) int?
20. Assuming that res start with the value 25, what will the following code fragment print
out?
System.out.println ( res-- ) ;
System.out.println
(++res) ;
21. What
22. What
23. What
24. What
will be the result of following expression if (i) age =25 (ii) age =65 (iii)
age =85 ? age > 65 ? 350 : 100.
25. What will be the result of following expression if (i) ans =700, val =300 (ii) ans
=800,val =700 ? ans - val < 500 ? 150 : 50
26. Write equivalent Java expressions for the following expressions :
(i) ut + ft2 (ii) |a| + b >= |b| + a (iii) [(3x +5y / 5x +3y) - (8xy/2xy)]3/2 (iv) e|2x^2 4x|
27. What is meant by implicit and explicit type conversion?
28. What do you mean by type casting? What is
29. What
(i)
30. Which class is used for using different mathematical methods in Java program?
31. The modulus operator (%) can be used only with integer operands. True/False?
32. The range of values for the long type data is
33. Which of the following represent(s) a hexadecimal number?
(a) 570
(b) (hex) 5
(c) 0X9G
(d) 0X5
(a) Math.ceil(x)
(b)Math.round(x)
(a) Math.floor(x)
(c)Math.abs(x)
(d)Math.floor(x)
(b) Math.abs(x)
(c) Math.round(x)
(d) Math.ceil(x)
What are literals in Java ? How many types of literals are allowed in Java ?
2.
What are data types? Make a list of primitive data types with size, initial values and
range of values available in Java.
3.
4.
What do you mean by parsing? Name some parsing methods available in Java.
Assignment No. 5
FLOW OF CONTROL
TYPE A: VERY SHORT ANSWER QUESTION
1.
2.
What are the three programming constructs that governs statement flow?
3.
In a nested-if, how does the default matching of dangling else take place?
4.
5.
6.
What is the significance of default clause in a switch statement? Can two case
labels in a switch have identical values?
7.
8.
(2)
(3)
(4)
9.
10.
2.
if and a ? : Operator.
(2)
(3)
(4)
3.
4.
5.
6.
Why is it suggested to put a break statement after the last case statement in a switch
even though it is not needed syntactically?
7.
8.
code = character.readChar();
if (code == A)
System.out.print ln (Accountant);
else if (code == C ll code == G)
System.out.print ln (Grade IV);
else if (code == F)
System.out.print ln (Financial Advisor);
(b) int inputnum, calcval;
If
(inputnum == 5)
{
calcval = inputnum * 25 20 ;
System.out.print ln (inputnum + calcval);
}
9.
n = n + 2;
.............}
10.
12.
13.
Rewrite following code using either while or do-while loop or both loops.
for(int i = 1 ; i < 4 ; ++i) { for(int
j = 3 ; j > 0 ; --j) {
System.out.print(### . .);
}
System.out.print ln();
}
14.
if(s<20)
if(s<20)
System.out.print(Under);
System.out.print(Under);
else {
System.out.print(Over);
System.out.print ln(the limit);
}
else
System.out.print(Over);
System.out.print ln(the limit);
(c) int s = 94; If
(s < 20) {
System.out.print(Under);
}
else {
System.out.print(Over);
}
System.out.print ln(the limit);
15.
What will be the output of the following code fragment when the value of ch is
(a) A
switch (ch)
(b) B
(c) D
(d) F
n++; i++;
n+=1;
} while (i<=5);
}
i=i+1;
}
System.out.print ln(n);
17.
(a) m=1;
n=0;
for(;m+n<19;++n)
System.out.print ln(Hello \n);
m=m+10;
Identify the possible error(s) in the following code fragment : Discuss the
reason(s) of error(s) and correct the code.
:
f = 1;
Assignment No. 6
JAVA GUI PROGRAMMING USING SWING - I
TYPE A: VERY SHORT ANSWER QUESTION
1.
2.
3.
4.
5.
6.
What is the default name of action event handler of a button namely TestBtn?
7.
8.
9.
Which method can programmatically performs the click action of a push button?
What are various categories of swing controls? Give some examples for each of them.
2.
3.
4.
(ii)
(iii)
5.
6.
7.
8.
(2)
(3)
To set the title as My First Java application displayed at title bar of a window.
(4)
(5)
(6)
To set the HTML command to display PRINT as text of a jButton1 in Bold style.
(7)
To set the Access Key ALT+P for jButton1 having text PRINT.
(8)
(9)
To set the tool tip as Click to get print when mouse is place on PRINT button.
Assignment No. 7
JAVA IDE PROGRAMMING USING SWING II
TYPE A: VERY SHORT ANSWER QUESTION
1.
2.
3.
4.
5.
6.
Which import code line, you must write before you add images in labels?
7.
Write names of Swing API classes, most common events, event-listener, and
event handler methods for the following types of components:
(i) label
(ii) dialog
(iii) button
(iv) password
(v) text area
(vi) check box
(vii) radio button (viii) button
8. Which property would you set for setting the password character as $ ?
9.
10. What
14. How
Identify the error in the following code that is written in action event
handler of a button namely OKBtn.
double d = nameTF .getText( ) ; String
age = ageTF.getText( ) ;
double marks = Double.parseDouble (marksTF.getText( )) ;
2.
3.
4.
5.
6.
7.
isEditable( )
(ii) setEditable ( )
(iii) getEchoChar( )
8.
What major events and methods are associated with the following:
(i) Text
Field
Write code for the event handler of a radio button so that when it
is selected/unselected, its text changes to I am selected or I am
unselected.
11. Write code for action event handler of a slider control so that its current value is
Assignment No. 8
JAVA GUI PRGRAMMING USING SWING III
TYPE A: VERY SHORT ANSWER QUESTION
1.
Name the swing API classes that create (1) a list (2) a combo box.
2.
Which list property do you set for specifying the contents of the list?
3.
Which method would you use to determine which index has been selected in a list?
5. How would you determine whether 7th item in a list of a list namely MyList is selected or
not?
4.
6.
You want to clear the selection in a list namely ChkList. How would you do this?
7.
Name the event that gets fired when a user selects or unselects an item in a list.
8.
Name the event handler of ListSelection Listener interface that handles the event in
case of selection change in a list.
9.
2)
3)
namely CityList. Which method would you use to add an element at the end of
CityList?
14. Can you display graphics in a list?
15. Is a combo box by default editable? If not, then how you make it editable?
16. How would you obtain selected item from a combo box?
17. How would you determine whether a combo box is editable or not?
18. You want to remove all the items from a combo box. Which method would you
2.
Write code to obtain text of selected items from a list namely List1.
3.
4.
5.
Write code to add items (Rai and Shivpuri) in list CityList. Rai should be
added at 5th position and Shivpuri should be added at 9th index.
6.
What method obtains the current selection of a combo box? Give a code- example.
7.
Discuss about some commonly used properties of lists & combo boxes.
8.
Assignment No. 9
LAB - ACTIVITY
1. Develop an application to display a Welcome message when
Show Message button is pressed.
Charges per
Km.5/Rs.
Rs. 6/Rs. 7/Rs.8/Rs.5/-
13. ABC Public School uses an application for calculating Total marks,
percentage and grades of students for given marks in five subjects with
maximum marks of 100. The Screen shot and Grade calculation rule is
given below.
Total Marks
>=90
80-89
70-79
60-69
50-59
40-49
<40
Grade
A+
A
B
C
D
E
Detained
14. Develop an application which determines and display day for given Day
16. Read the following case study and answer the question that follows: Sagar electronics has the
following products with their list prices given. The store gives 10% discount on every
product. However at the time of festival season the store gives additional 5% discount.
Product Name
Washing Machine
TV
Refrigerator
OTG
Music System
Note the product name is stored in JComboBox and use of switch case is mandatory to choose the
product from JComboBox.
number is Prime or not. Prime numbers are those numbers which are
divisible by one or itself only.
20. Develop a Java application to print a Pattern for given character and
25. Develop a Billing application for Happy Shoping- A retail chain involve
27. Develop an application as per given screen shot to display the given
28. Redesign the application developed in Experiment 26, using combo control.
29. Develop an application as per given screen shot to Add , Remove the
given members of list and display the selected item in a text field
using List control.
30. Develop an application to compute the Factorial and Checking Prime for
31. Develop an e-Mail sending Application which facilitates the login and
Assignment No. 10
PROGRAMMING GUIDELINES
TYPE A : VERY SHORT ANSWER QUESTIONS
1.
Prologue,
(ii)
Robustness
2.
3.
4.
What does the compilation do? Under which phase, the program is executed?
5.
Name the three types of errors? Name two types of compilation errors?
Why a program should have good presentation style? Discuss some Stylistic
guidelines to write a good program.
2.
3.
What do you mean by the clarity of expressions in a program? What is its significance?
4.
5.
What are main error types? Which types are most dangerous and why?
6.
A properly designed and coded program, reduces the probability of bugs and
hence the Maintenance cost. Do you agree with the statement? Why?
7.
Differentiate between-
What do mean by Program testing? What is differentiate between Unit testing &
Integration testing.
10. What do you mean by Program Maintenance? Why it is considered very important?
Assignment No. 11
DBMS CONCEPTS
TYPE A : VERY SHORT ANSWER QUESTIONS
1.
What is data redundancy? What are the problems associated with it?
2.
3.
4.
5.
(ii) View
(vi) domain (vii) tuple
(v) Relation
(x) cardinality
6.
7.
8.
Primary key
2.
3.
4.
5.
What do you mean by data model? Discuss various data model with their
major characteristics.
Assignment No. 12
INTRODUCTION TO MYSQL
TYPE A : VERY SHORT ANSWER QUESTIONS
1.
2.
3.
What LAMP stands for? Write the use of its element applications.
4.
DDL
3. TCL
5.
2. DML
4. System control commands
2.
3.
4.
5.
Assignment No. 13
SIMPLE QUERIES IN SQL
TYPE A: VERY SHORT ANSWER QUESTION
1.
2.
What are fixed length fields? What are variable length fields?
3.
4.
What is null value in MySQL database? Can you use nulls in arithmetic expressions?
5.
6.
7.
8.
9.
To change/open a database
(i) Patterns
ename
SMITH
ANYA
SETH
MAHADEV
MOMIN
BINA
SHIVANSH
SCOTT
AMIR
KULDEEP
job
CLERK
SALESMA
SALESMA
MANAGE
SALESMA
MANAGE
MANAGE
ANALYST
PRESIDEN
SALESMA
mgr
8902
8698
8698
8839
8698
8839
8839
8566
NUL
8698
hiredate
sal
comm deptno
800.00
1990-12-18
NULL
20
1600.00
1991-02-20
300.00 30
1250.00
1991-02-22
30
500.00
1991-04-02 2985.00 NULL 20
1991-09-28 1250.00 1400.00 30
1991-05-01 2850.00 NULL 30
1991-06-09 2450.00 NULL 10
1992-12-09 3000.00 NULL 20
1991-11-18 5000.00 NULL 10
1991-09-08 1500.00
0.00
30
Consider the Empl table and write SQL command to get the following.
a.
Write a query to display EName and Sal of employees whose salary are greater
than or equal to 2200?
b.
Write a query to display details of employs who are not getting commission?
c.
Write a query to display employee name and salary of those employees who
dont have their salary in range of 2500 to 4000?
d.
Write a query to display the name, job title and salary of employees who
dont have manager?
e.
Write a query to display the name of employee whose name contains A as third
alphabet?
f.
Write a query to display the name of employee whose name contains T as last
alphabet?
g.
Write a query to display the name of employee whose name contains M as First
and L as third alphabet?
h.
Write a query to display details of employs with the text Not given, if commission is
null?
2.
Write SQL command for the following in the basis of given table (STUDENT)?
Student No. Class Name Game
Grade 1
10
7
Sameer Cricket
B
11
8
Sujit
Tennis
A
12
7
Kamal Swimmin
B
13
7
Veena Tennis
C
SUPW
Grade 2
Photograph
A
Gardening
C
Photograph
B
Cooking
A
(i)
Display the names of the student who are getting a grade C in either games or
SUPW.
(ii)
(iii) Display the SUPW taken up by the student whose names starts with A
3.
Write SQL command for the following on the basis of given table sports.
Student No. Class
10
7
11
8
12
7
13
7
14
8
Name
Sameer
Sujit
Kamal
Veena
Kamal
Game 1
Grade 1
Cricket
B
Tennis
A
Swimming
B
Tennis
C
Cricket
A
Game 2
Swimmin
Skating
Football
Tennis
Tennis
Grade 2
A
C
B
A
B
(i)
Display the name of the students who have grade C In either game 1 or game 2 or
both.
(ii)
Display the name of the students who have same grade for both game 1 and game 2.
(iii) Display the games taken up by the student whose name starts with A
4.
Write SQL command for the following in the basis of given table (Club)?
COACH_I
1
2
3
COAC
AGE
KUKRE
35
RAVIN
34
KARAN 34
SPORTS
KARATE
KARATE
SQUASH
Dsteofapp
27/3/1996
20/01/1998
19/02/1998
PAY
1000
1200
2000
SEX
M
F
M
4
5
5.
TARUN
ZUBIN
01/01/1998
12/01/1998
1500
750
M
M
b.
To list names of all coaches with their date of appointment in descending order.
c.
To display report, showing coachmen pay, age and bonus (15% of pay).
Write SQL command for the following in the basis of given table (Student)?
Name
Karan
Diwakar
Divyu
Arun
Sabeena
Stipend
400
450
300
350
500
Stream
Medical
Commerce
Commerce
Humanities
Non
Avg
78.5
89.2
68.6
73.1
90.6
Grad
B
A
C
B
A
Clas
12B
11C
12C
12C
11A
a.
Select all the Non medical stream students from this table.
b.
c.
d.
Write SQL commands for the following on the basis of given table.
No.
1
2
3
4
5
7.
SWIMMI
SWIMMI
a.
No
1
2
3
4
5
6.
33
36
Table: LIBRARY
Title
Author
Lipschu
Data Structure
Computer studies French
Advanced Pascal Schildt
Dbase dummies Palmer
Mastering C++ Gurewi
Type
DS
FND
PRO
DBM
PRO
Pub
McGraw
Galgotia
McGraw
PustakM
BPB
Qty
4
2
4
5
3
Price
217
75
350
130
295
a.
b.
Display a list of all books with Price more than 130 and stored by Qty.
c.
Write SQL commands for the following on the basis of given table MOV.
No
1
2
3
4
5
6
Title
Gone with the wind
Friday the 13th
Top sun
Splash
Independence Day
Risky business
Type
Drama
Horror
Drama
Comed
Drama
Comed
Ratin
G
R
PG
PG13
R
R
Stars
Gable
Jason
Cruise
Hanks
Turner
Cruise
Qty
4
2
7
3
3
2
Price
39.95
69.95
49.95
29.95
19.95
44.95
a.
Display a list of all movies with Price over 20 and sorted by Price.
b.
c.
8.
Display a report listing a movie number, current value and replacement value
for each movie in the above table. Calculate the replacement value for all
movies as QTY
*Price* 1.15.
Write SQL commands for the following on the basis of given table relation Teacher.
No.
1
2
3
4
5
6
7
8
9.
NAME
Jugal
Sharmila
Sandeep
Sanggeta
Rakesh
Shaym
Shiv Om
Shalakha
Age
33
31
32
35
42
50
44
33
Department
Computer
History
Maths
History
Maths
History
Computer
Math
Dateofjoin
10/01//97
23/03/98
12/12/96
01/07/99
05/09/97
27/06/98
25/02/97
31/07/97
Salary Sex
12000 M
20000
F
30000 M
40000
F
25000 M
30000 M
21000 M
20000
F
a.
b.
c.
To list names of all teachers with their date of joining in ascending order.
Write the Syntax of Select command and describe various options/ keywords
used, with example.
10. What do you mean by Operator Precedence? Make a ordered list of operators from
Assignment No. 14
MySQL FUNCTIONS
TYPE A: VERY SHORT ANSWER QUESTION
1.
2.
3.
b.
c.
d.
4.
5.
6.
7.
Write command to print the day of the week of your birthday in the year 1999.
8.
9.
Consider two fields B_date, which stores the birth date and J_date, which stores the
joining date of an employee. Write commands to find out and display the
approximate age of an employee as on joining date.
10. Consider a field B_date, which stores the birth date of student.
Write commands to
find out and display the approximate age of student as on today.
COACHNA
KUKREJA
RAVINA
KARAN
TARUN
ZUBIN
KETAKI
ANKITA
ZAREEN
KUSH
SHAILYA
TABLE: CLUB
AGE
SPORTS
35
KARATE
34
KARATE
34
SQUASH
33
BASKETBA
36
SWIMMING
36
SWIMMING
36
SQUASH
37
KARATE
41
SWIMMING
37
BASKETBA
DATOFAP
1996-03-27
1998-01-20
1998-02-19
1998-01-01
1998-01-12
1998-02-24
1998-02-20
1998-02-22
1998-01-13
1998-02-19
PAY
1000
1200
2000
1500
750
800
2200
1100
900
1700
SEX
M
F
M
M
M
F
F
F
M
M
(iii)
(iv)
2.
3.
Write a query against the ADDRESS table to show the names (first name, last
name) and phones of all persons concatenated in the following form:
TinaSeth23456789
MoradK.22211890
4. Write a query for EMPL table to show the names of employees concatenated
with their jobtypes.
5.
No
1
2
3
4
5
6
7
8
9
10
Name
Karan
Divakar
Divya
Arun
Sabina
John
Robert
Rubina
Vikas
Mohan
TABLE: STUDENT
Stipend Stream
AvgMar
400
Medical
78.5
450
Commerce 89.2
300
Commerce 68.6
350
Humanities 73.1
500
Nonmedica 90.6
400
Medical
75.4
250
Humanities 64.4
450
Nonmedica 88.5
500
Nonmedica 92.0
300
Commerce 67.5
Grade
B
A
C
B
A
B
C
A
A
C
Class
12B
11C
12C
12C
11A
12B
11A
12A
12A
12C
6.
TABLE: LIBRARY
No.
Title
Author
Type
Pub
Qty
1. Data Structure
Lipschut DS
McGraw 4
2. Computer Studies
French
FND
Galgotia
2
3. Advanced Pascal
Schildt
PROG
McGraw 4
4. Dbase dummies
Palmer
DBMS
PustakM 5
5. Mastering C++
Gurewic PROG
BPB
3
6. Guide Network
Freed
NET
BPB
3
7. Mastering FoxPro
Seigel
DBMS
BPB
2
8. DOS Guide
Norton
OS
PHI
3
Give the output of following SQL commands on the basis of table library.
Price
217
75
350
130
295
200
135
175
7.
Column Name
Data Type
Column Name
Data Type
LastName
VARCHAR(2 State
CHAR(2)
FirstName
VARCHAR(2 Zip
NUMBER
Street
VARCHAR(2 Phone
VARCHAR(1
City
VARCHAR(2 Ext
VARCHAR(5
8. Write a query against the ADDRESS table to select a list of names and phone
numbers. The output should match these requirements:
(i)
(ii)
The name column should contain both the first and last names with a blank space
between them.
The second column will contain the phone number in (999)999-9999 format.
9.
Make summery tables with category of MySQL commands, syntax and use.
10. Explain the following functions with syntax, purpose and example.
1) CONCAT()
5) MID()
9) CURDATE()
2) SUBSTR()
6) MOD()
10) NOW()
3) TRIM()
7) POW()
11) SYSDATE()
4) INSTR()
8) ROUND()
12) DAYNAME()
Assignment No. 15
Table Creation & DML Commands
TYPE A: VERY SHORT ANSWER QUESTION
1.
2.
Which is a constraint? Name some constraint that you can apply to enhance
database integrity.
3.
4.
5.
6.
7.
8.
9.
Table NewEmpl has same structure as that EMPL. Write a query to insert data from
EMPL table into NewEmpl, where salary is more than Rs 4000 and commission is
greater than 500.
UPDATE EMPL;
TYPE B: SHORT ANSWER QUESTION
1.
2.
What is FOREIGN key? How do you define foreign key in your table?
3.
4.
What are table constraints? What are column constraints? How are these two different?
5.
What is default value? How do you define it? What is default value for a column for
which no value is defined?
6.
Differentiate between:
7.
(i)
(ii)
Table: Empl
empno
8369
8499
8521
8566
8888
8839
8844
.
.
ename
SMITH
Anya
SETH
MAHADEV
SCOTT
AMIR
Gates
.
.
job
CLERK
SALESMA
SALESMA
MANAGE
ANALYST
MANAGE
PRESIDEN
mgr
8902
8839
8839
8844
8566
8844
NULL
..
..
hiredate
1990-12-18
1991-02-20
1991-02-22
1991-04-02
1992-12-09
1991-11-18
1991-11-18
.
.
sal
800.00
1600.00
1250.00
2985.00
3000.00
5000.00
5000.00
.
.
comm deptno
NULL
20
300.00
30
500.00
30
NULL
20
NULL
20
NULL
10
NULL
10
..
.
..
.
a)
Update all Ename so that it contains the entire name in capital letters.
b)
c)
Give commission of Rs 500 to all employees who joined in year 1982 in Empl table
d)
Modify table Empl, add another column called Grade of VARCHAR type size 1 into
it.
e)
8.
g)
h)
a)
b)
c)
Decrease price by 10% for all those products for which order were placed 10
months before.
d)
Write a query to delete all those records from table Orders whose payment has
been made.
9.
Create the table Employee based on the following table instance Chart.
FirstName
Column name ID
NUMBE VARCHAR
Data Type
8
25
Length
10. Write the command for the followinga)
LastName
VARCHAR
25
DeptID
NUMBER
8
CustID
CustName CustAdd1 CustAdd2 CustPhone
Column
NUMBE VARCHA VARCHA VARCHA VARCHAR
Data Type
7
30
20
30
10
Length
b) Add one column Email of data type VARCHAR and size 30 to table Customer.
c)
d)
e)
Col. name
Key type
Nulls /Unique
Fk Table
Fk Column
Datatype
Length
EmpID
Primary
EmpName
EmpAdd
EmpPhone EmpSal
DeptID
Foreign
NOT NULL
NUMBE
6
Department
Dept_ID
VARCHAR VARCHA VARCHA NUMBE VARCHAR
20
30
10
9,2
2
Assignment No. 16
LAB ACTIVITY
I.
Open MySQL and Login with your ID and password given by your Teacher. Write
and Execute the SQL command for the following and also write the
steps/commands in your Practical notebook.
1
hiredate
Date
sal
comm
Number Number
empno
ename
job
hiredate
sal
8369
SMITH
CLERK
1990-12-18 800.00
8499
ANYA
SALESMAN 1991-02-20 1600.00
8521
SETH
SALESMAN 1991-02-22 1250.00
8566
MAHADEVA MANAGER 1991-04-02 2985.00
8654
MOMIN
SALESMAN 1991-09-28 1250.00
8698
BINA
MANAGER 1991-05-01 2850.00
8882
SHIVANSH MANAGER 1991-06-09 2450.00
8888
SCOTT
ANALYST
1992-12-09 3000.00
8839
AMIR
PRESIDENT 1991-11-18 5000.00
8844
KULDEEP
SALESMAN 1991-09-08 1500.00
5 Write a query to display all the records with all the columns.
comm
NULL
300.00
500.00
NULL
400.00
NULL
NULL
NULL
NULL
0.00
Write a query to display EName and Sal of employees whose salary are
greater than or equal to 2200
10
Write a query to display the ename and sal with 50% of sal as DA.
11
12
Write a query to display details of employs with the text Not given, if
commission is null.
13
14
15
II.
Open MySQL and load MYORG database. Write and Execute the SQL
command for the following and also write the steps/commands in your Practical
notebook.
1
Write command to print the day of the week of your birthday in the year
2015.
Write a query to display employee names in lower case from Emp table.
Write a query to display ename and two characters from 2nd position in
job column from Emp table.
Write a query to display ename and weekday on which they joined from
Emp table.
Write a query to display ename, Job and Date of retirement (60 years
after Hiredate) from Emp table.
3
11 Write a query to find out the result of 6 .
10
12
Write a query to find out the result of 301/2 (Square root of 30)
13
Write the command to display the ename and its length from Emp table.
14
Write the command to round off value 15.193 to nearest tens i.e. 20.
15
Assignment No. 17
I.
Write and Execute the SQL command for the following and also write the
steps/commands in your Practical notebook.
1.
CustID
CustName CustAdd
CustCity
CustPhone
Column
Name
Data Type
NUMBE VARCHA VARCHA VARCHA VARCHAR
Length
7
30
40
30
10
Constraints
Primary
Not Null
2. Insert 5 records with relevant information in the Customer table.
3.
4.
Add one column Email of data type VARCHAR and size 30 to table
Customer.
5.
6.
7.
8.
9.
Create table ORDER as per following Table structure. Also make CustNo as
Foreign Key which refers CustID of CUSTOMER table.
Column
OrderNo CustNo ItemName Qty
Name
Data Type
NUMBE NUMBE VARCHA NUMBER
Length
5
7
30
5
Constraints
Primary
>=2
10. Add 5 records as per defined constraints in Order table.
Price
NUMBER
6,2
Not Null
11.
12.
13.
14.
15.
II.
Write SQL Commands for the questions i) to x) on the basis of table Teacher.
Table : Teacher
No.
1
2
3
4
5
Name
Jugal
Shanti
Sandeep
Radhika
Rakesh
Age
34
31
32
45
35
Department
Computer
History
Maths
History
Computer
Dateofjoin
2007-02-10
2008-03-24
2009-02-25
2007-04-15
2007-05-17
Salary
12000
20000
14000
20000
21000
Tripcharge
NULL
NULL
4000
5000
NULL
III.
Write SQL Commands for the questions i) to vi) on the basis of table Movie.
Gender
M
F
M
F
M
Assignment No. 18
IT APPLICATIONS
TYPE A: VERY SHORT ANSWER QUESTION
1.
E-Governance
b) E-Business
c) E-Learning
2.
List any five web portal with their purposes involved in E-Governance.
3.
List any five web portal with their purposes involved in E-Commerce or Business.
4.
List any five web portal with their purposes involved in E-Learning
5.
How has society benefitted from e-governance? What are the limitations of e-governance?
2.
3.
4.
5.
6. Suruchi works for a Shopping Mart. She wants to create controls on a form for the
following operations: Choose most appropriate controls out of Text box, Label, Radio
Button, List box, Combo box, Check box and Command button.