Академический Документы
Профессиональный Документы
Культура Документы
CLASS – XII
SUBJECT : INFORMATICS PRACTICES (065)
a) What is the purpose of DROP TABLE command in SQL? How is it different from DELETE
command? [2]
b) Write the SQL command for (i) to (iv) and write the output of the (v) on the basis of the table
SUPPLIER:
Table:SUPPLIER
SNo PName SName Qty Price City
S1 Bread Britannia 150 8.00 Delhi
S2 Cake Britannia 250 20.00 Mumbai
S3 Coffee Nascafe 170 45.00 Mumbai
S4 Chocolate amul 380 10.00 Delhi
S5 Sauce kissan 470 36.00 Jaipur
(i) Display details for all products whose quantity is between 170 and 370.
[1]
(ii) Display data for all products sorted by their quantity.
[1]
(iii) Find all the products that have no supplier.
[1]
(iv) Give SName for that entire product whose name starts with “C”. [1]
(v) Give the output of the following SQL commands:
[2]
(a) Select AVG(Price) from SUPPLIER where price <30;
(b) Select MAX(Price) from SUPPLIER where price >30;
(c) Select COUNT(*) from SUPPLIER Group By City;
CUSTOMER PURCHASE
Cust_ID Date PurchaseAmount
Cust_I First_Name Last_Nam DOB 3 11/09/2010 200
d e 1 14/10/2010 199
1 Alisha Madan 20/01/1989 2 21/09/2010 600
2 Akhil Sachdeva 01/02/1990 1 01/09/2010 99
3 Rajesh Mehta 10/09/1986 4 23/11/2010 300
4 Rani Garg 24/11/1986
With reference to these tables, write commands in SQL for (i) and (ii) and output for (iii)
(i) Display the first name, last name and purchase amount of all the customers.
(ii) Display the names of all customers whose purchase amount is more than Rs. 200
(iii) SELECT CUSTOMERS.First_Name, CUSTOMERS.Last_Name,
PURCHASE.Date
FROM CUSTOMER JOIN PURCHASE
ON CUSTOMER.Cust_Id=PURCHASE.Cust_Id
ORDER BY Date;
7.
a) What is front end? What is its significance? [2]
b) Identify the various types of relationships from the following and also show them
diagrammatically. [1]
(i) A student enrolls for various courses in a college.
.
c) What controls would you suggest for following types of inputs? [2]
(i) To display some information.
(ii) Enter password.
(iii) To choose more than one subject from a set of subjects.
(iv) To enter multiline text.
KENDRIYA VIDYALAYA, ITI, MANKAPUR
Pre-Board 2014-15
CLASS – XII
SUBJECT : INFORMATICS PRACTICES (065)
Marking Scheme
Q1.
a) SMTP (Simple Mail Transfer Protocol) [1 Marks for correct Answer]
b) MAN [1 Marks for correct Answer]
c) Telephone Cable ,Ethernet Cable, Co-axial Cable, Optical Fiber [1 Marks for correct Answer]
d) Linux,MySql [1 Marks for correct Answer]
e) Freeware (from "free" and "software") is computer software that is available for use at no cost (or
for an optional fee).Though the definition of "freeware" covers both proprietary and closed
source software that is available for use at no cost as well as free and open source software, in common
usage it tends to refer more often to proprietary and closed source software that is available for use at
no cost. Software that is commercial but not available free of charge is occasionally referred to as
"payware" or commercial software.
Free Soft Ware:
Free software, software libre or libre software is software that can be used, studied, and modified
without restriction, and which can be copied and redistributed in modified or unmodified form either
without restriction, or with minimal restrictions only to ensure that further recipients can also do these
things and that manufacturers of consumer-facing hardware allow user modifications to their hardware.
Free software is generally available without charge, but can have a fee, such as in the form of charging
for CDs or other distribution medium among other ways.
[1 Marks for each correct Answer]
f)
(i) HTTP: The Hypertext Transfer Protocol (HTTP) is a networking protocol for distributed,
collaborative, hypermedia information systems. HTTP is the foundation of data communication for
the World Wide Web.
(ii)FTP The Hypertext Transfer Protocol (HTTP) is a networking protocol for distributed,
collaborative, hypermedia information systems. HTTP is the foundation of data communication for
the World Wide Web.
Q2
a) Yes, Using <Br> in HTML in the text proprerty of label. [1 Marks for correct Answer]
b)The java method would you use for setting the password character as ‘$’ is setEchoChar( ).[1 Marks for each
correct Answer]
c)<INPUT TYPE= “PASSWORD” NAME= PWD> [1 Marks for each correct Answer]
d) <OL type =”a” start=4> Type and start attributes are not used in UL tag. [1 Marks for each correct Answer]
e)1.HTML is presentaton language where as XML is not either a programing language or a presentation
language. It is used to transfer data between applications and databases.
2 .HTML is not case-sensitive where as XML is case-sensitive.
3 .In XML we can define our own tags as it is not possible in HTML.
4. In XML it is mandatory to close each and every tag where as in HTML it is not required.
5. XML describes the data where as HTML only defines the data. [1 Marks for correct answer]
(f) CSS: Cascading Style Sheet
DTD: Document Type Definition [1/2 Marks for correct abbreviation ]
g) import java.sql.*;
Class.forName(“con.mysql.jdbc.Driver”); [1 marks for correct answer]
Q3.
a) Use database STATUS;
Show tables; [1 marks for correct answer]
d) The the difference between Primary key constraint and Unique constraint is that we can store null
values in unique constraint but not in the case of primary key.In any table there is only one primary
key but many unique constraints can be present. [1 marks for correct answer]
f) In Equi join between two tables on the basis of equality join condition
Natural Join: In Natural join between two tables on the basis of equality join condition but the joining
column comes in the resultant table once.
g) Rollback is used undo all the changes applied on the database and send the database to previous
commit or save point status.
Q4.
(a) method overloading is the primary way polymorphism is implemented in Java
Overloading methods
overloaded methods:
appear in the same class or a subclass
have the same name but,
have different parameter lists, and,
can have different return types
an example of an overloaded method is print() in the java.io.PrintStream class
public void print(boolean b)
public void print(char c)
public void print(char[] s)
public void print(float f)
public void print(double d)
public void print(int i)
public void print(long l)
public void print(Object obj)
public void print(String s)
the actual method called depends on the object being passed to the method
Java uses late-binding to support polymorphism; which means the decision as to which of the many
methods should be used is deferred until runtime
Overriding methods
late-binding also supports overriding
overriding allows a subclass to re-define a method it inherits from it's superclass
overriding methods:
appear in subclasses
have the same name as a superclass method
have the same parameter list as a superclass method
have the same return type as as a superclass method
the access modifier for the overriding method may not be more restrictive than the access
modifier of the superclass method
class LB_1 {
public String retValue(String s) {
return "In LB_1 with " + s;
}}
class LB_2 extends LB_1 {
public String retValue(String s) {
return "In LB_2 with " + s;
}}
if you create an LB_2 object and assign it to an LB_1 object reference, it will compile ok
at runtime, if you invoke the retValue(String s) method on the LB_1 reference, the LB_2 retValue(String s)
method is used, not the LB_1 method
LB_2 lb2 = new LB_2();
LB_1 lb3 = lb2; // compiles ok
System.out.println(lb3.retValue("Today"));
Output:
In LB_2 with Today [1 Marks for each correct definition]
(b) noitamrofnI
(c) An Abstract Class can contain default Implementation where as an Interface should not
contain any implementation at all. An Interface should contain only definitions but no
implementation. where as an abstract class can contain abstract and non-abstract methods.
When a class inherits from an abstract the derived class must implement all the abstract
methods declared in the base class. an abstract class can inherit from another non-abstract
class.
(d) the most important difference between String and StringBuffer/StringBuilder in java is
that String object is immutable whereas StringBuffer/StringBuilder objects are mutable.
By immutable, we mean that the value stored in the String object cannot be changed. Then the next
question that comes to our mind is “If String is immutable then how am I able to change the contents of
the object whenever I wish to?” . Well, to be precise it’s not the same String object that reflects the
changes you do. Internally a new String object is created to do the changes.
So suppose you declare a String object:
String myString = “Hello”;
Next, you want to append “Guest” to the same String. What do you do?
myString = myString + ” Guest”;
When you print the contents of myString the output will be “Hello Guest”. Although we made use of
the same object(myString), internally a new object was created in the process. So, if you were to do
some string operation involving an append or trim or some other method call to modify your string
object, you would really be creating those many new objects of class String.
e)
it is a.
it is b.
it is c.
Ans
f) int a, b=20;
do
{ a=b*2;
b=a/b;
}while(b>40); [1 Marks for each correcting error]
g)
1 public int Calculate(int noday)
{
int noofday=0,total=0;
noofday=noday;
int wage;
if(jRadioButton1.isSelected())
{
wage=150;
}
else
wage=130;
if(jCheckBox1.isSelected())
{
wage=wage+50;
}
wage=wage*noofday;
return wage;
}
2. private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jRadioButton1.setSelected(false);
jRadioButton2.setSelected(false);
jCheckBox1.setSelected(false);
}
3.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int w;
w=Calculate(Integer.parseInt(jTextField2.getText()));
jTextField3.setText("" + w);
StringBuffer s=new StringBuffer(jTextField1.getText());
s.reverse();
JOptionPane.showMessageDialog(null,s );
}
Q5.
(a) The drop table command destroys the table i.e. data and structure of the table both are deleted. Where
as in delete command the only data is deleted from the table. [1 Marks for writing correct differnce]
1. SELECT * FROM SUPPLIERS WHERE Qty BETWEEN 170 AND 370;
2. SELECT * FROM SUPPLIERS ORDER BY Qty;
3. SELECT Pname FROM SUPPLIERS WHERE SName IS NULL;
4. SELECT SName FROM SUPPLIERS WHERE PName LIKE ‘C%’;
5.
i. 12.66 [1/2 Marks]
ii. 45.00 [1/2 Marks]
iii. 2 [1Marks]
1
2
6. asa
Q6.
(a) create table EMPLOYEE(EmpId number(6) Primary Key,
EmpName Varchar(20) NOT NULL,
EmpAddress varchar(30),
EmpSal Number(9,2) Check EmpSal>5000,
DeptId varchar(2),
Forign Key(DeptId) references DEPARTMENT(Dept_Id));
(b) create table Employee2
(Empno integer(3) primary key
salary double (6,2));
create table Employer
(id integer (3) primary key,
Employeeno(2) integer ,
Foreignkey(Employeeno) refrences Employee2(Empno) on delete cascade);
(c) i) select First_Name, Last_Name, Purchase_Amount from Customer, Purchase where Customer.CustId
= Purchase. Cust_Id;
Student School