Practice Paper of Informatics Practices (065) For XII Board Exam 2014
Practice Paper of Informatics Practices (065) For XII Board Exam 2014
Practice Paper of Informatics Practices (065) For XII Board Exam 2014
Informatics
Practices (065) for
XII Board Exam
2014
.
[Question# 1] NETWORKING & OPEN SOURCE SOFTWARE [TOTAL MARKS 10]
(1) Define / Make a short note of the followings (Computer Networking): [1-2 / 2-3 marks of each]
(a) Computer Network (b) PAN, LAN , MAN, WAN, (c) Node , Server , Hub , Workstation, TAP , NIU (d) Ring Topology , Star
Topology , Tree Topology , Bus Topology, Mesh Topology (e) Data Communication (f) Twist Pair Cable , Coaxial cable,
Optical fiber cable, Ethernet cable (g) Wireless Networking (h) Microwave, Radio wave, Satellite, (i) Infrared Communication (j)
Bluetooth , WiFi (k) Modem , Hub , Ethernet card, Repeater , Bridge , Gateway , Router (l) IP address , MAC address ,
Domain name (m) Define: 023.876.067.002 , www.indoaryan.org , URL (n) Differentiate: Domain Name & URL (o) .org ,
.com , .edu , .net , .gov (p) Network security , Threat to Network (q) Firewall , IDS , Snooping , Danial of Service Attack or
DoS Attack (r) SYN Fooding , Pentium F00F Bug , Ping Flooding , TearDrop / New Tear (s) HTTP , HTML , FTP , TCP/IP ,
SMTP
(2) Excel Industries has set up its new center at Lucknow for its office and web based activities. The company
compound has four building as shown in the diagram below :
Computers in each wing are net worked but wings are not networked. The company has now decided to connect the wings also.
i) Suggest a most suitable cable layout of the connection between the wings.
ii) Suggest the most suitable wing to house the server of this company with a suitable reason.
iii) Suggest the placement of the following devices with justification: 1) Router 2) Switch / Hub
iv) The company is planning to link its head office situated in India with the offices at Reliance. Suggest an economic way to
connect it; the company is ready to compromise on the speed of connectivity. Justify your answer.
(3) Short answer type question: [2 or 3 marks for each]
1) Which protocol is used to move Hyper Text document and simple file transferring through networks in wide area scale?
2) Which protocol will you use to transfer a file from the remote location?
3) Which transmission medium should be used to transfer data across two continents at very high speed?
4) How can you increase to signals between two networks if it is going down?
5) How the Indian languages are getting included in the application of computers easily? Name four such languages.
6) How do the web address is practically used in the net? Write the format of the same.
7) Is there any difference between an IP address (i.e. 239.004.994.010) and web address (i.e. www.indoaryan.org)?
8) Arrange the followings in ascending order according to their data transmission rate.
9) Sujata had some confusion between Domain name and URL. How do make her understand about the differences?
10) Which of the following is not a characteristic of Open Source Software: (i) There is a company owner (ii) Can be
downloaded freely (iii) Source code is available for modification.
11) There is a group presentation of two professors with their Palm Tops connected through Bluetooth. Which of the
following networks they are using: W AN LAN PAN MAN
12) How do you differentiate the OSS and Proprietary software in terms of customizability of the software?
13) Arrange the following communication channels in ascending order of their data transmission rates. ETHERNET
CABLE, OPTICAL FIBER, TELEPHONE CABLE, COAXIAL CABLE.
14) Which of the following softwares are open source: LINUX, MS WINDOWS 7, PHOTOSHOP, MYSQL
(4) Define / Make a short note of the followings (OSS): [1-2 / 2-3 marks of each]
(a) Free software, (b) Open source software, (c) Freeware, (d) Shareware, (e) Source code, (f) FLOSS, (b) FSF, (h) W3C, (i)
OSI, (j) GNU, (k) Tomcat, (l) MySQL, (m) Front-End & Back-End, (n) Pango, (o) PHP, (p) Open Office, (q) Python, (r)
Firmware, (s) UNICODE (t) ASCII code (u) Name 2 sites of OSS.
[ Question# 2 ] Java (with IDE) + HTML & XML [TOTAL MARKS 10]
(1)
a) Explain How and when do you use getText() & setText() methods?
b) Differentiate of its applications: isEditable() & isEnabled()
c) Write the use of valueOf() method and output of the statement: float x=999.101 ; jLabel1.setText(String.valueOf(x));
d) Write the function of toString() method.
e) What is a wrapper class? Explain the following in terms of wrapper class: String x=12345; int y=Integer.parseInt(x) ;
f) Why do you use import javax.swing.JOptionPane ? Describe the two applications of JOptionPane class of the package
javax.swing
g) Which swing components does javax.swing.JPanel container contain?
h) Write the application of the method getPassword() with a right example.
i) How do you insert single lined and multiple lines comments?
j) What are the members of Java Tokens?
k) Differentiate: (a) Identifiers & Keywords , (b) Primitive & Reference Datatype , (c) Local & Instance(object) variable , (d)
Logical & Relational operators, (e) \t & \n , (f) \b & \r , (g) / & % operators
l) Differentiate: (i) int x=10 & final int y=10; (ii) (int k=10) & (int k==10)
m) What is use of default in switch..case statement? When do you use break in switch..case?
n) What are pre and post increments? Can you explain pre & post decrement also with example?
o) What will happen if you run a break statement in for loop? When do you use for loop?
p) How do you differentiate the applications of: while and dowhile statements?
q) What are exit-control and entry-control looping statements? Explain with example.
r) In a Java application using Net Beans IDE, the user views the data on the Text Fields, he found that his name is
misspelled, now he wants to edit it, but cant. What was done by the programmer that does not allow the user to edit his
name?
s) How do you enable the jLabel1?
t) How do you insert values into the TextArea? Write the syntax in terms of inputing value of i: for(i=1;i<=10;i++)?
u) Rashmi in her desktop application wanted to show her friends names in the List Box and their city names in the Combo
Box. Which property of the List Box and Combo Box will she use to do her jobs?
v) When do you import javax.swing.DefaultListModel; & import javax.swing.DefaultComboBoxModel; ?
w) What is Panel Container? In which package does it stay?
x) When do you use Check Box and Radio Button? Establish the relation between the use/application of Radio Button and
Combo Box.
y) Differentiate: (i) String x = (String) jList1.getSelectedValue() & String x = (String) jComboBox1.getSelectedItem() (ii)
isSelected() & setSelected() (iii) Text1.setForeground() & Text1.setFont() (iv) getText() & setText() (v)
getSelectedIndex() & getSelectedValue() (vi) addElement() & insertElementAt() (vii) removeAllElements() &
removeElementAt() (viii) remove() & clear() (xi) getModel() & setModel() (x) isEnabled() & setEnabled() (xi)
JOptionPane.MessageDialog( ) and JOptionPane.InputDialog( )
z) What is swing control? (Z.1) Write the output of x in the following case:> int x = (5>=8) ? 1 : 2;
aa)What is ButtonGroup? How does it effect to select a Radio Button?
bb)How does the Model contain the data to be taken from a list of data?
cc) What is the concept of OOP in terms of Class and Object? Write the syntax of the object creation.
dd)Object of which class do you create when you are working with inheritance? Write the advantages of inheritance.
ee)How many times the following loops will run? Which one of these is entry control and which one is exit control? Show the
outputs: (A) int s=0 ; i=4 ; do { s+=i ; i++ ; } while (i<5) ; System.out.print( +s);
(B) int s=0 ; i=4 ; while(i<5) { s+=I ; i++ ; } System.out.print( +s);
ff) What are the final values of:
(A) int x ; int y=1 ; for(x=0 ; x<10 ; ++x) y = x++ ; - -y ; System.out.println(Value of x & y=> + x + + y;
(B) int a=2; int b=3; do{++b + b++; a++; a=++a ;} while(b<=12) ;System.out.println(Value of a & b=> + a + + b;
gg) What are ODBC and JDBC ?
hh) Write down the steps to create Menu & Sub-Menu. (FILE -> Open -> main.exe)
ii) What is purpose of user defined method? How do you pass parameters/arguments to a method?
jj) Explain methods call by value and call by reference .
kk) When a called method is called as void type and other data types? What do you understand value returned?
ll) Explain scope of variables in terms of Local and Global variables.
mm) Write a function that will take length and breadth of a rectangle as parameters and return the area of the rectangle.
nn) Write the use & Output of the following STRING Library Functions:
(1) contact( ) (2) Length( ) (3) substring( ) (4) toLowerCase() (5) toUpperCase()
(6) Trim() (7) String x=Indoaryan ; String y=Existentialism ; x=x.contact(y) ; System.out.print( +x) ;
oo) Write the use & Output of the following Library Functions from MATH class:
(1) Math.sqrt() (2) Math.abs() (3) Math.cell() (4) Math.pow() (5) Math.round() (6) Math.max()
(7) Math.min() (8) Math.floor(12.7) (9) Math.pow(2,3) (10) Math.sin(30) (11) Math.round(78.678)
pp)What is the use of new operator during creation of an object (instantination) of a class?
qq)What is a class? Explain the function of a constructor in a class?
rr) How does an inherited class use the parent class?
ss) How many kinds of Parent and Child class relationships can you mention?
tt) How do private , public , protected & default accessibility of variables and methods of a class can work?
uu)What is the use of an object? How do you call a method add() which is declared and defined in the child class?
vv) Differentiate: Method-Overloading and Method-Overriding with examples.
ww) Radha created a method add() in a super class named myclass and she also made another method of the same
name [ add() ] declared in the child class yourclass of myclass. But while she runs the program, method of the parent
class does not run, but method of child class does run? What is the reason behind it? Can she run the method of the
super class? If yes then how?
xx) Satya created three methods of the same name Calc_Val() in a class and called the three methods one by one with
three different sets of parameters/arguments such as (int a) ; (int x, String k) & (double i, long j, char p). Will Satya get
success to run these three methods consecutively? If so explain how?
yy) What is an Abstract Class? How do you use it, explain with an example?
zz) Explain the interface of class with an example.
aaa) Rathin has created a class, has no instantiation of objects (no objects created) and there is a method created inside
has no implementation and terminated with a semicolon ( ;) just after it defined. Now how Rathin does fill the gap of not
implementation of the method, by implementing the method in a sub-class (inherited) of the same?
bbb) What is Front-End Back-End connectivity? Write the application of JDBC and ODBC in 3Gl-4GL connectivity?
ccc) Write about JDBC-ODBC Bridge. What is JDBC Api?
ddd) How does JDBC driver work for MySQL?
eee) Write the statement (syntax) that makes driver loaded to establish connection between Java and MySQL?
fff) Write the statement (syntax) that makes the connection between Java and MySQL?
ggg) How can you run a SQL Command in a Java program, that is written for database connectivity?
hhh) Give the functions of: getConnection() , getDriver() , getLoginTimeout() , executeQuery() , executeUpdate() , first()
, previous() , getLong() , getRowCount() , setRowCount() , removeRow() .
(2) Write the answer of the following based on HTML & XML:
a) Write down the differences of HTML and XML.
b) Write mail 2 advantages of XML over HTML.
c) Expand the term HTML and its function.
d) Which tag in HTML will Subroto use place his photograph in the back ground of his web page? How will he use it?
e) What are the different four levels of HTML tags?
f) What is the file extention of a HTML code to be saved in a word processor? What type of file does it create?
g) What are the fundamental / document tags of HTML?
h) What are container tag and empty tag? Explain with examples.
i) Wrte the function of HEAD and TITLE tags.
j) Write the different elements / attributes of BODY tag.
k) Explain the function of the followings: BGCOLOR , BACKGROUND , TEXT , LINK , VLINK , ALINK
l) Write the differences of LEFTMARGINE and TOPMARGINE
m) Write the elements / attributes of FONT tag.
n) Write the functions of: FACE , COLOR , SIZE
o) What is BASEFONT?
p) Differentiate between <BASEFONT> and <FONT> tag?
q) How do you use the following tags? Give suitable examples to explain: (i) commsent (ii) paragraph (iii) center
r) Explain the uses of the following HTML text tags with example:
s) (a) <BR> (b) <P> (c) <B> (d) <I> (e) <U> (f) <STRIKE> (g) <SUP> (h) <SUB> (i) <TT>
(j) <BIG> (k) <SMALL> (l) <BIG> (m) <STRONG> (n) <FORM> (o) <METHOD> (p) <MAILTO>
(q) <RESET> (r) <SUBMIT> , <INPUT TYPE=submit VALUE=Submit Order> , <INPUT TYPE=Text> ,
2
t) How do you display H2SO4 & (A+B) in a HTML page?
u) What are the different levels of Heading tags? Give example.
v) Which of the tags : <H6> or <H1> gives a bigger size heading?
w) What is <HR> tag? Write the different elements/attributes of HR tag.
x) What are uses of the followig in terms of HR tag: ALIGN , NOSHADE , WIDTH (in Number) , W IDTH (in %age).
y) Answer the following in terms of LIST tags:
(a) <UL> (b) <OL> (c) <LI> (d) <DT> (e) <DL> (f) <DD> (g) <DIR> (h) <MENU>
z) What is the use of TYPE (A , a , I , i , 1 ) element in <OL> tag?
aa) What is the use of START element in <OL> tag?
bb) What are the different types of bulletes can be used in <OL> tag?
cc) What is use of VALUE element in <LI> tag?
dd) Explain with example nesting tag OR tags within tag?
ee) What is the HTML code for the following outputs (the Hyperlinks are indus.html & agre.html):
INDIA INDIA
1. Economy 1. Economy
2. Education Industry
3. Health Agriculture
INDIA INDIA
1. Economy 3. Economy
Industry Industry
Agriculture Agriculture
2. Education 4. Education
I. How do you insert an image in a web page? Write the HTML tag to display school.jpg.
II. IMG SRC is an empty or container tag?
III. What are the elements/attributes of <IMG SRC> tag?
IV. Write the most useful TWO attributes in <IMG SRC> tag?
V. What are the functions of: ALIGN , ALT , WIDTH , HEIGHT , BORDER elements in image tag?
VI. Explain the NAME attribute of anchor tag.
(3) Write the suitable HTML code to get the following outputs
Rs. 100001 to 150000 10% of amount exceeding Rs. 100000 2% of taxable income Nil
Rs. 150001 to 250000 Rs. 5000 + 20% of amount exceeding Rs. 150000 2% of taxable income Nil
Rs 250001 and above Rs. 25000 + 20% of amount exceeding Rs. 250000 2% of taxable income 1% of taxable income
Command cmdCalculate (d) Write the code for the click event of the command button to calculate the
Button cmdClear compound interest and amount depending on the principal, rate and time.
cmdExit
[Compound Interest=> P * (1+r/100)^T Amount=> Principal + Compound Interest]
(5)
Ms. Sheela works in a shopping mall. To calculate net payable amount she has developed the following GUI in NetBeans. The
shop accepts payments in three modes- Cash, Debit Card, Credit Cards. The discount given as per mode of payment is as
follows- If the Member check box is checked then the customer gets an additional discount of 5% on net payable amount.
I. Write the code to make the textfields for Discount( txtDiscount ) and Net Payable (txtNetPayable) un-editable.
II. Write code to do the following-
Mode of payment Discount
Cash 12%
Debit Card Nil
Credit Card 8%
a. Rewrite the following code segment using switch case b. Convert the following without using a for loop: [3]
instead of if else: [3] for( int j = 3; j>=1; j--)
int sal ; {
if (sal <=10000) if (x==1)
System.out.print(New year bonus is 2000); System.out.print (One);
else if( (sal>=12000) && (sal <=15000)) else if (x==2)
System.out.print(New year bonus is 5000); System.out.print (Two);
else if (sal=>20000) else if (x==3)
System.out.print(New year bonus is 7000); System.out.print (Three);
else }
System.out.print(Bonus not applicable);
c. Convert the following into a FOR loop: [3] d. Rewrite the following code segment using for loop
int total ; int n ; int I ;
int i=99; n= Integer.parseInt(TextNo.getText());
do { System.out.println(+ i+10) ; while( i< = n)
i=i-3; { total =total + I;
} i=i+1;
while (i<=33); }
e. Rewrite following while loop into a for loop f. Rewrite following while loop into a for loop
int s=0; int stripes =0;
while(s<=13) while(stripes<=13)
{ {
if (s%2==2) if(stripes%2==2)
{ System.out.println(color code red); } { System.out.println(colour code red); }
else else
{ System.out.println(color code blue); } { System.out.println(colour code blue); }
System.out.println(New color code ); System.out.println(new stripe);
s=s+1; stripes =stripes +1;
} }
g. Rewrite following for loop into a while loop h. Rewrite the following code using for loop.
(8) Find the ERRORS, Re-Write and Give the expected Output of the following questions:
(a) (b) switch(x)
Class one{ { case 1 :
Private int count; n1 =10 ;
} n2 =20 ;
Class two{ case 2 :
Public static void main (String args[]) n3 =30 ;
{ one ob = new one(); break;
ob.count=10;} n1 =40 ;
}
(c) (d)
int m=100;
while(m>0) int f =1,i=2;
{ while (++i <5)
if (m<10) f *=i;
break; System.out.println(f);
m=m-10;
} System.out.println(m is +m);
(e) Find the errors, if any (f) double i, sum=2 ;
int m=1; for(i=3;i<8;++i)
int n=0; { if(i%4= =0)
for( ; m+n <19; ++n); { break;
System.out.println(Hello \n); sum=Math.pow(sum,i);
m=m+10; }
else
sum+=i/2;
}
(g) int x=0; (h) int i=0;x=0;
for(i=1; i<10; i++) while ( i < 10 )
{ for(int j=5; j>i ; j--) {
{ if (i % 2 = 0)
System.put.print(The j is + j) { x == x + i ;
System.out.display(The i is + i); System.out.print(x + 1);
} }
X=i+j; i ++;
System.out.print(The x is + x) } }
(9) WRITE PROGRAM IN Java using Net Beans IDE: [Marks 3 / 4 each]
a) Write a method that calculates the sum of all even numbers less that N
b) Write a method that takes an integer argument N and calculates the sum of all even numbers less that N
c) Write a method that takes 2 integer arguments N & A and returns the sum of powers of A up to Nth term. [S=A1+A2++ ANth term]
d) Write a method in a class (myclass) that takes integer values of N and A and return the sum of the powers of A up to Nth
1 2 N
term. [S=A +A ++ A th. term]
e) Write a method in a sub-class (yourclass) of the super class myclass that takes an integer value of N from the user and
calculates the sum of the odd numbers up to Nth term.
f) Write a method in a child-class (yourclass) of parent class myclass that takes integer arguments/parameter of N from the
caller method sum() through the object myobj , and return the sum of the odd numbers up to N and display the result.
g) Write a method (sum()) in a class myclass and pass object (myobj) of the class as argument/parameter from the caller
method , and return the sum of the odd numbers up to Nth term and display it after the caller method called.
h) Write a method pere()in a class which will take 2 parameters Length & Breadth as reference through object and find area.
i) Write a program to store your name into an Array and display character wise reading from the Array.
j) Write a program to store natural numbers into a double dimension Array and print the sum of the numbers row wise.
k) Write a method will take New value and position as parameter, which are of integer type, insert the new value in the
specified position in an array.
(l) Write a function Power to raise a number m to power n. The function takes two integer value and returns the result
correctly, Use default value of 2 for n (to calculate squares) if argument is omitted. [3]
(m) A class Electbill contains consumer details and another class Bill calculates the monthly electricity bill of a consumer.
Details of the two classes are given below:
Class name : Electbill
Data members/Instance variable :
cno : consumer number
name : consumer name
add : consumer address
Member functions :
Electbill(....) : Parameterised constructor to assign values to consumer number, consumer name and address
void display() : Display consumers details
Class name : Bill
Data me mbers/Instance variable :
n : integer variable to store number of the units consumed
Member functions :
Billl(....) : Parameterised constructor to assign values to data members
void calculate() :Calculate the monthly bill of consumer according to following slabs and it should also display the
consumers details and total amount to be paid.
Table: STUDENT
STDCODE NAME CLASS SECTION AVGMARK DOB
S009 AJAY MALHOTRA 11 A 86.55 12-DEC-1995
S010 KUSUM VIMANI 12 C 79.85 22-MAR-1994
S012 SARITA VERMA 12 C 98 23-JAN-1992
S015 KAILASH SINGH 10 D 78.45 5-OCT-1993
S020 SANJAY SRIVASTAVA 11 K 85.45 10-MAY-1990
S033 KAVITA SAXSENA 9 K 66.50 12-SEPT-1993
S052 BIJAY MAJUMDAR 12 B 88 5-NOV-1989
Table : CLASS
(10.1)
a) Create the table Student, using constraints NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHEQUE, DEFAULT
value RANCHI for Address in appropriate attributes/fields/columns.
b) Enter a new record: S009, Swapan Pal, 11, E, 80.5, 15-8-1991.
c) Re-arrange the records in descending and ascending order on Date of Birth.
d) Display the Name Class Age and Date Of Birth of the students who have either less then 80 Average Marks, or year of
birth before 1993.
e) Display the Name, Admission number and Date of Birth of those whose first character of name is K.
th
f) Display the Name, Admission number and Date of Birth of those where 7 latter of the address is A.
g) Display the Different Sections present in the table.
h) Display the Different Sections and their corresponding numbers present in the table.
i) Replace the Name Ajay Malhotra by Ajit Mahapatra.
j) Increase each of the Average Mark by 2.0.
k) Display number of records present in the table.
l) Display Numbers of each section in the table of those who got Average Marks more than 75.
m) Include a new column Address in the table.
n) Delete the same column.
o) Make the column Admission number as a Primary Key.
p) Remove the existing record(s) of all who are not from classes 11 or 12.
q) Display the Maximum Average Marks from each section.
r) Display the Minimum Average Marks from each section.
s) Display the Total Average Marks of the table.
t) Display the values of Name and Date of Birth close together (concatinate).
u) Show the Name and number of characters of each name.
v) Show the first character of each name as Capital.
w) Show the each of the names in capitals and small as well separately.
x) Locate position of the character A in each of the name.
y) Display rest of the blank characters of a described field by * .
z) Remove all of the blank spaces from name field.
aa) Display first 5 characters of each of the name.
bb) Convert the date value into character value and number value of year of birth after 1990.
cc) Find the Square root and Reminder of division by 3 of Average marks.
dd) Display the Power 3 of the Average Marks of the sections A.
ee) Make StdCode of the Student table as FOREIGN KEY in reference to the Parent table Teacher.
ff) Display Students Code , Name , Address , Average Marks , Date of Admission of the tables Teacher and Student.
gg) Display Name , Date of Admission , Date of Birth from the tables Student and Class using Allies of the Tables.
hh) Write commands to: (i) DROP the common field STDCODE of Class table. (ii) Now display Name, Date of Admission,
Average Marks and Address from the both of the tables Teacher & Student. (iii) Again ADD the column Dropped before.
(10.2)
a) Display Name, Class, Address and Date of Admission from tables STUDENT and CLASS have similar student code.
b) Display all the Sections and Date of Birth from above two tables.
c) Create a view MyClass using the columns Name, DOB, and AvgMark from Student.
(10.3) Write the OUTPUT of the following commands from the above table Student.
a) SELECT Name from STUDENT where AvgMark > (SELECT AvgMark from STUDENT where Class=11);
b) SELECT X.Name, X.Roll, Y.Address From STUDENT X, STUDENT Y where X.AdmNo=Y.AdmNo;
c) SELECT Addres from CLASS where Section IN (SELECT Section from STUDENT where Class>=11);
d) SELECT Count(*), DISTINCT(Section) from CLASS;
e) SELECT Count(*), Section from STUDENT Group By Section Having Class>=10;
f) SELECT (AvgMark * 0.5 from STUDENT where Name like S%;
g) SELECT MIN (AvgMark) from STUDENT; (g.1) SELECT MAX (AvgMark) from STUDENT;
h) SELECT SUM (AvgMark) from STUDENT where DOB > 1990-12-13 AND DOB < 1995-1-1;
i) SELECT StdCode, Section from Student UNION SELECT StdCode, Section from Class;
j) UPDATE Class Set Address=Ranchi Where StdCode =(Select StdCode From Student Where DOB=1993-10-15);
NB: You must also go through the Solved Exercises of the chapter Review of SQL.
11. Answer the questions based on the table HOSPITAL given below: [16X1=16]
Table: HOSPITAL
Column Name Data type Size Constraint
Ptnt_No Number 4 Primary Key
Ptnt_Name Varchar2 15 Not Null
Dept Varchar2 15 -----
Doc_Name Varchar2 15 Not Null
Dt_Birth Date --- -----
Fees Number 6,2 Default 00.00
Ptnt_Phno Number 12 Check <=12
a) Write the SQL command to create the table Hospital including its constraints.
st
b) Write the SQL command to display the details of all the patients whose date of birth is after 1 January 2000.
c) Write the SQL command to display the type of Departments.
d) Write the SQL command to display the number of patients in each department for the names starts by character S.
e) Write the SQL command to increase the consultation fees by Rs 50.00 for the patients whose year of birth is before 1950.
f) Write the SQL command to change the length of the field Dept by 12.
g) Write the SQL command to display the Name of the Patients, corresponding Departments and Date of Birth, in
alphabetical order of the names of the patients.
h) Write the SQL command to remove a record of the Patient No 104.
i) Write the SQL command to remove the table.
j) Write the SQL command to Include a new attribute Srlno [Number(3)] to the table.
k) Write the SQL command to add Constraints NOT NULL & UNIQUE to Patient No.
l) Write the SQL command to display the first 5 characters of the patients name, who are from the department SURGERY.
m) Write the SQL command to display the total amount of fees collected.
n) Write the SQL command to display the oldest patients date of birth.
o) Write the SQL command to enter new record as per your choice to the corresponding attributes.
p) Write the SQL command to enter data to the attributes Department, Doctors and Patients Name
q) Write the SQL command to Discard / Undo the latest changes made in the table.
a) Categorize the DDL and DML commands :
CREATE, TRUNCATE, DELETE, GRANT, ROLLBACK, SELECT , COMMIT , ALTER
b) Write the output of the following SQL queries using library functions :
1) SELECT TRUNCATE(22.78,1);
2) SELECT DAYOFMONTH(2010-10-17) , MONTH(Sysdate());
3) SELECT DAYOFWEEK(CurDate());
4) SELECT SUBSTR(Common Wealth Games 2010,8,6);
5) SELECT CONCAT(LOWER(Class),UPPER(xii));
6) SELECT INSTR ( TRIM( Indoaryan , A);
7) SELECT LEFT(To the power of , 12) , POWER(5,3);
8) SELECT RIGHT(To the power of , 8) , POW(5,3);
9) SELECT ROUND(544.4583 , -2);
10) SELECT 15 / 4 , 15 * 2 , 15 + 5 ;
12. Consider another new table DEPARTMENT along with the table TEACHER having the fields: Srlno NUMBER(3),
Ptnt_No NUMBER(4), Deptname VARCHAR2(15), Address DATE. Now read the questions carefully and write the
SQL Commands of the followings. [2X2=4]
(a) Display the Department, Name and Address from the above tables (Hospital and Department).
(b) Display the records from both of the tables even those have no common records.
The laws of total development of individual and society are Concentricity, Self elevation and
Eugenics i.e. Ideal centric go-of-life, Accordingly self-manipulation and Bio-psychic compatible
marriage; lets uphold it
Hope we will be in touch for longer time, from any corner of the globe, I do wish - be a person with your evolving qualities and
efficiencies for your greater surroundings. Yours own forever S.M.
Developed and Designed by:
Dr. Srikumar Mukherjee, Dept. of Computers, Delhi Public School, Ranchi
Email: srikumar2005_ranchi@yahoo.co.in / seeence@gmail.com
Ph # +91-9470932544 / 909753620 (Mob)
www.indoaryan.org