IT SQP For TERM1 CLASS 12 2024

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

INFORMATION TECHNOLOGY (SUBJECT CODE 802)

Sample Question Paper for Term1 examClass XII (Session 2024-2025)

Max. Time: 3 Hours Max. Marks: 60

General Instructions: All Questions are compulsory

SECTION A: OBJECTIVE TYPE QUESTIONS


Q. 1 Answer following questions (1 x 4 = 4 marks)
i. Tuple represents ____________in a table. 1
a.Attribute
b.column
c.record
d.Vertical line
c
ii. _____________ of the following key is refered as the primary key of other table 1
Foreign key
iii. Which of the following is not a ddl command 1
a.alter
b.create
c.drop
d.select
d
iv. Which command is used to change the structure of the table? 1
Alter table

Q. 2 Answer given questions (1 x 5 = 5 marks)


i. The size of double datatype in java is bit. 1
64
ii. is a special method that every Java application must 1
have.
main
iii. Choose the correct MySql command to display 5% of salary as allowance 1
a. select salary +0.5 as allowance from teacher;
b. select salary *0.5 as allowance from teacher;
c. select salary *0.5 rename as allowance from teacher;
d. select salary+salary *0.5 allowance from teacher;
b

802-Information Technology- Session 2023-2024 Page 1 of 7


iv. They are programmers who code in high level languages. 1
a. Application programmers
b. System analysts
c. End users
d. Database Administrators
a
v. What is a byte code? 1
Byte code is set of instructions or Java class file.

Q. 3 Answer the given questions (1 x 6 = 6 marks)


i. Name the command used to change existing data in the table 1
Update
ii. loop run at least once. 1
do while
iii. clause is used to remove duplicate values. 1
distinct
iv. 1
v. The main purpose of this constraint is to check that data entered in one relation is 1
consistent with the data entered in another relation. Name the constraint.
referential integrity
vi. Once the class is defined, we can create of the class and access its 1
members.
objects

Q. 4 Answer questions (1 x 5 = 5 marks)


i. Predict the output 1
double[]Qty = {46, 42, 13, 6.5, 87.5};
System.out.println(Qty[3]);

ii. State TRUE or FALSE 1


binary()method is used to arrange an array of integers in ascending order.
false
iii. Which component is used to compile, debug and execute java program? 1
a. JVM
b. JDK
c. IDE
d. JRE
b
iv. Which of the following is a fixed length string datatype? 1
a.char(n) b.varchar(n) c.both a n b d.none ans : a
v. The number of attributes in a relation is called the of a relation 1
degree
Q. 5 Answer any 5 out of the given 6 questions (1 x 5 = 5 marks)
i. State True or False 1
The data connectivity is established between the Front-End interface and Back-End
Database in the implementation phase.
true
ii. Once the database is created, you can check it in the list of databases that currently 1
802-Information Technology- Session 2023-2024 Page 2 of 7
exist on the server by using command.
Show databses
iii. Write MySQL statement that selects all products with a price between 10 and 20 1
from product table.
SELECT * FROM Products WHERE Price BETWEEN 10 AND 20;
iv. Java is case sensitive language. Justify the statement. 1
To use a prebuilt class and associated methods in those class, use the keyword import
v. A in java is a group of related classes. 1
a. Method
b. Package
c. Constructor
d. Variable
b

802-Information Technology- Session 2023-2024 Page 3 of 7


Q. 6 Answer 5 (1 x 5 = 5 marks)
i. Which of the following is an invalid variable declaration? 1
a) my_string_1
b) 1st_string
c) mystring1
d) _mystring1
b
ii. method takes a String as parameter and returns the equivalent 1
integer.
ParseInt()
iii. In Mysql_______value represents an unknown value 1
Null
iv. REEMA wants to arrange names of students in alphabetical order in the student 1
table. Give the MYSQL command to create a sorted list.
SELECT Name FROM student ORDER BY Name;
v. is not an aggregate function 1
a. Sum()
b. Count()
c. Round()
d. Avg()
e. c

SECTION B: SUBJECTIVE TYPE QUESTIONS

Answer the following

Q. 7 What is a constructor in java ? Example of contructor ? 2


A constructor is a special type of method whose name is same as class
name.Purpose of constructor is to initialize the object .Every java class has a
constructor by default. We do not call the constructor explicitly.
A constructor never contain any return type. Syntax:
Class class_name
{
class_name()
}

Q. 8 Access Modifiers : Data members of a class can be accessed from outside the class 2
by default.
Four types : Private ,Protected,Public,Friendly

Q. 9 Explain about Java Libraries? 2


Hundreds of Java classes that are already prebuilt and can be used in your
programs. To use a prebuilt class and associated methods in those class, all you
have to do is to use the keyword import to import the class from the package in
which it is contained into your space.
802-Information Technology- Session 2023-2024 Page 4 of 7
Q.10 Give the output of the following code segment- 2
public class Main {
public static void main(String[] args) {
int day = 4;
switch (day) {
case 6:
System.out.println("Today is Saturday");
break;
case 7:
System.out.println("Today is Sunday");
break;
default:
System.out.println("Looking forward to the Weekend");
}
}
}
Looking forward for weekend
Q.11 Explain Drop table with Cascade command in My SQL. 2
3 Drop Table will be dropped and with the CASCADE option, i.e. all the constraints that refer
this table would also be automatically dropped. Example Drop table teacher Cascade;
Q.12 Explain any two operations performed on database. 2
Defining the Database: It involves specifying the data type of data that will be stored in the
database and also any constraints on that data. 2. Populating the Database: It involves
storing the data on some storage medium that is controlled by DBMS. 3. Manipulating the
Database: It involves modifying the database, retrieving data or querying the database,
generating reports from the database etc. 4. Sharing the Database: Allow multiple users to
access the database at the same time.
Q.13 A hospital is making database of its doctors and patients. Doctor table includes doc 1+1
code, idoc name, dept . Give details of Patient Table along with its schema.
Patient(pid,doc_id,dateofapp,phone)
Name Type Remarks
pid INT(10) Patient number (Primary Key)
doc_id INT(10) Doctor number
dateofapp DATE Date of Appointment
phone int(10) Phone no
Pname int(50) Patient’s Name

Q.14 Find error and rewrite the correct 1+1


code i == 0;
while (i < 5) {
System.out.println(i)
i++;

int i = 0; while (i < 5){ System.out.println(i); i++;} (4 errors)

802-Information Technology- Session 2023-2024 Page 5 of 7


Answer questions (3 x 2 = 6 marks)
Q.15 Complete the code in JAVA using a loop to print "Yes" 5 times: 1+1+1

(int i = 0; i < 5; )
{
(”Yes”);
}
for i++
System.out.println
Q.16 a. Rina wants to display the details of employee whose name starts from s. 1+2
Find errors in given MySQL command and write the correct statement.
select* from employee where name like *s;
b. Classify them into DDL or DML
commands Update, delete, create , alter
a. select* from employee where name like ‘s%’;
b. Update- DML Delete- DML Create-DDL Alter-
DDL

802-Information Technology- Session 2023-2024 Page 6 of 7


Answer questions (4 x 3 = 12 marks)
Q.17 a.Write a single line Java code using String methods to perform the following tasks 3+1
String cl = ‘‘class xii’’;
i. Convert the characters to capital letters.
ii. Find the total length of string.
iii. Add a word ‘‘toppers” at the end of original string.
a.i. cl.toUpperCase( ) ii. cl.length(); iii. cl.concat(”toppers”);

c. What is the purpose of a constructor?


b. The constructor is a method used to initialize the data members of the class.

Q.18 What is an array? Write java statements to store marks of 5 subjects and print it. 1+3
Arrays are used to store a set of values of the same type under a single
variable name

Q.19 Consider the following tables and write Mysql Commands 4


STORE
StoreId StoreName Location NoOfEmployee OpeningYear OwnerId
S101 Libas Delhi 45 2007 A145
S102 Life Style Mumbai 68 2000 B178
S103 Vogue Mumbai 50 1999 B178
OWNER
Owner Id Owner Name
A145 Divyam Prakash
B178 Neha Sultan
D112 Gargi Chhabra

a. To display the number of employees present in each location.


b. To display Stores names, Location and Date of Opening of stores that
were opened before 2015.
c. To add a new column SALE of integer type.
d. To display Store Name and Owner Name of all stores in Mumbai.

a.Select SUM(NoOfEmployee), Location from STORE group by location ;


b. Select storename, location, OpeningYear
from store where OpeningYear <”2015”;
c. Alter table store add SALE integer;
d. Select StoreName, OwnerName from
STORE, OWNER where
802-Information Technology- Session 2023-2024 Page 7 of 7
store.OwnerId=Owner.OwnerId and
Location=”Mumbai”;

802-Information Technology- Session 2023-2024 Page 8 of 7

You might also like