0% found this document useful (0 votes)
112 views6 pages

11th IP Sample Paper

Uploaded by

pmegh764
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views6 pages

11th IP Sample Paper

Uploaded by

pmegh764
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CLASS: XI SESSION: 2023‐24

INFORMATICS PRACTICES (065)


SAMPLE QUESTION PAPER (THEORY)

Differentiate between Primary key and Candidate key.

Ans. A candidate Key can be any column or a combination of columns that can qualify as
unique key in database. There can be multiple candidate Keys in one table where as
A Primary Key is a column or a combination of columns that uniquely identify a record.
Only one candidate key can be primary key.

What are some common clauses used with SELECT queries in SQL?

Ans. There are many SELECT statement clauses in SQL. Some of the most used clauses are:
• FROM

The FROM clause defines the tables and views from which data can be interpreted. The tables and views
listed must exist at the time the question is given.
• WHERE

The WHERE clause defines the parameters that would be used to limit the contents of the results table. You
can test for basic relationships or for relationships between a column and a series of columns using sub
selects.

• GROUP BY

This GROUP BY clause is commonly used for aggregate functions to produce a single outcome row for each
set of unique values in a set of columns or expressions.
• ORDER BY

ORDER BY clause helps you to choose the columns on which the table's result should be sorted.
• HAVING

By using an aggregate function, the HAVING clause filters the results of the GROUP BY clause.
What is meant by disk fragmentation?
Or
What are the securities threats involved when you throw away electronic gadgets that are non‐
functional?

Ans:‐ When sufficient disk space is not available for storing a program, the complete program in
decomposed into a number of sections. When different sections of the program are stored in
separate areas of the hard disk, it is known as disk fragmentation.
Or
Ans:‐ Users frequently discard obsolete, broken , or malfunctioning storage devices without first
ensuring that all data is deleted. The contents of deleted files are assumed to be permanently
erased. However, if these storage devices come into the hands of malicious individuals, they will
be able to easily recover data from them, posing a risk to data privacy. This risk can be reduced by
properly deleting or removing data before discarding any outdated or malfunctioning storage
device.
What is difference between public cloud and private cloud.
Or
How big data is useful in transportation?
Ans:‐ Public Cloud: It is common and open for everyone. It enables user to store and access
information using the internet and pay‐per‐use or subscription method. Users of public cloud
are also called as cloud tenants. Common public clouds are Microsoft Azure, Google Drive, etc.
Private Cloud: Private cloud is owned by an organization to develop, test, share, and deploy
their resources for their internal users. This is also known as an internal cloud or corporate
cloud.
Or
Ans:‐ Big data helps the public transportation sector to predict passenger volumes. Bit data helps to
process customer feedback, weather conditions, route plan, availability of different transport
on the route, etc.
Write a program to obtain a number n from a user and find its factorial.
Ans:‐
n=int(input("Enter a positive number to find its factorial :"))
f=1
for i in range(1, n+1):
f=f*i
print( "n! =", f)
Define the composite primary key.
Ans:‐ if a single field fails to act as a primary key, then a combination of two or more fields is used asa
primary key and is referred to as a composite key or composite primary key.
Write the output of the following Python Program
for i in range( 21, 30, 2):
print(i)
print("Numbers between 20 to 30")

Or
What will be the output of the following code?
for i in range (55,50,‐2)
print (i)
Ans:‐ It will print the odd number between 20 to 30 )
Output
21 23 25 27 29
Or
Ans:‐55 53 51
What is difference between primary key and candidate key?
Ans:- A primary key is used to uniquely identify a record in a table, while a candidate key helps in
selecting the primary key. Another key difference between a primary key and a candidate key is
that a table can have only one primary key, but there can be multiple candidate keys.
What is Data Model in Data Base Management System?
Ans:‐ Data Model gives us an idea that how the final system will look like after its complete
implementation. It defines the data elements and the relationships between the data elements.
Data Models are used to show how data is stored, connected, accessed and
updated in the database management system.
Write output for SQL queries (i) to (iii) which are based on the given table Student:‐
Table :‐Student
(i) Display all the record of the table Student.
(ii) Display Roll Number, Name and Class from the table Student.
Display all the details of the Aarti.
Ans:‐ (i) Select * from student:
(ii) Select RollNo, Name, Class from student;
Select * from Student where Name =’Aarti’;
Write a short note on cache memory.
Ans:‐ When compared to the access time of the main memory, the speed of the CPU is extremely fast.
As a result of the poor speed of the main memory , CPU’s performance suffers. A tiny memory chip
is placed between the CPU and the main memory to reduce the operation speed mismatch. Its
access time is extremely close to the CPU’s processing speed. It is known as cache memory. Cache
memory is accessible significantly more quickly than regular RAM. It is used to store programs or
data that are currently being used , as well as temporary data that the CPU constantly uses. As a
result, each memory causes the main memory to appear faster and larger than it is. It is also
quite expensive to have cache memory size, hence it is usually
kept small.
Write a Python code to accept the name of a student and create a dictionary by assigning marks secured
by him/her in IP, Science and Social Science subjects as shown below:
IP: 70
Science: 68
Social Science: 65
Display the name of the student along with the total marks and average.

Answer:‐
name=eval(input("Enter name of the student:"))
marks={"IP":70, "Science":68, "Social Sciecne":65}
sum1=0
for i in marks:
sum1 = sum1 + marks[i]
avg=sum1/3
print("Name of the student ", name)
print ("Total marks: ", sum1)
print("Average Marks", avg)
Write a Python program for adding, removing elements in the list.
Ans:‐ list = [10, 20, 30, "Chandigarh", "Patiala"]
print("List elements are: ", list)
list.append (40) # To add value 40 in list
list.append (50) #To add value 50 in list
list.append ("Chandigarh") #To add string value Chandigarh in list
print("List elements: ", list)
list.pop () ; # To Remove last element from listprint("List elements: ", list)
What is the use of SELECT clause in MySQL? Write an Example of Select Command.
Or
Define Data types. What are the different data types available in SQL?
RollNo. Name Class Fees Gender
1. Aditya 10th 7000 78
2. Priya 11th 7500 75
3. Aarti 10th 7000 76
4. Ajay 11th 7500 74
Ans:‐ The SELECT clause specifies the columns from which data values are to be retrieved by the
query. Data retrieval is limited to the columns specified. When selecting from two or more
tables having duplicate column names, it may be necessary to qualify column names with tableor
view names.
For Example:‐ Select * from Table Name;
Above command will display the all records inserted in table.
Or
Ans:‐ Data types are used to represent the nature of the data that can be stored in the database
table. For example, in a particular column of a table, if we want to store a string type of data
then we will have to declare a string data type of this column.
SQL Data Types
Numeric data types such as: INT , TINYINT , BIGINT , FLOAT , REAL
Date and Time data types such as: DATE , TIME , DATETIME
Character and String data types such as: CHAR , VARCHAR , TEXT
Unicode character string data types such as: NCHAR , NVARCHAR , NTEXT
Write the SQL commands for (i) to (v) on the basis of table Sports.
Table Sports

Student Class Name Game 1 Grade 1 Game 2 Grade 2


No
1. 10 Amrit Cricket A Swimming A
2. 12 Neeraj Tennis B Basketball C
3. 10 Rajiv Swimming A Football B
4. 10 Khushbu Tennis C Tennis B
5. 12 Aditi Basketabll A Cricket A
6. 11 Rishi Cricket A Athletics C

(i) Display the names of students who have grade ‘C’ in either Game1 or Game2 or both.
(ii) Display the details of students getting grade ‘A’ in Cricket
(iii) Display the names of the students who have same game for both Game1 and Game2
(iv) Display the games taken up by the students, who name is Rishi.
(v) Add a new column names ‘Marks’.
Ans:‐ (i) SELECT Name FROM SPORTS WHERE Grade1=’C’ Or Grade2=’C’.
(ii) SELECT * FROM SPORTS WHERE Grade1=”A”.
(iii)SELECT Name FROM SPORTS WHERE Game1=Game2;
(iv) SELECT Game1, Game2 FROM SPORTS WHERE Name=”Rishi”(v)ALTER TABLE SPORTS
ADD(Marks int(4));
Program that reads three numbers (integers) and prints them in ascending order.

Ans:‐
num1=int(input("Enter First number : "))
num2=int(input("Enter Second number : "))
num3=int(input("Enter Third number : "))
if num1<num2 and num1<num3:if
num2<num3:
x,y,z=num1,num2,num3
else:
x,y,z=num1,num3,num2
elif num2<num1 and num2<num3:if
num1<num3:
x,y,z=num2,num1,num3else:
x,y,z=num2,num3,num1else:
if num1<num2:
x,y,z=num3,num1,num2
else:
x,y,z=num3,num2,num1
print("Numbers in ascending order are : ",x,y,z)
Write a Python Program to check Triangle is Valid or Not.
Ans:‐
a = int(input('Please Enter the First Angle of a Triangle: '))
b = int(input('Please Enter the Second Angle of a Triangle: '))c
= int(input('Please Enter the Third Angle of a Triangle: ')) total
=a+b+c
if total == 180:
print("\nThis is a Valid Triangle")else:
print("\nThis is an Invalid Triangle")
Explain the Following Terms
(a) DDL (b) DML (c) DCL (d) TCL
Ans:‐ Based on functionalities performed by them, there are five types of SQL Commands‐ DDL(Data
Definition Language), DML(Data Manipulation Language), DQL(Data Query Language),
TCL(Transaction Control Language), DCL(Data Control Language).
a. DDL:‐ Data Definition Language is used to create and modify the structure of objects in a database
using predefined commands and a specific syntax. These database objects include tables,
sequences, locations, aliases, schemas and indexes.
b. DML:‐ Data Manipulation Language or DML is a subset of operations used to insert, delete, and
update data in a database. A DML is often a sublanguage of a more extensive language like SQL;
DML comprises some of the operators in the language.
c. DCL:‐ A data control language (DCL) is a syntax similar to a computer programming language used to
control access to data stored in a database (authorization). In particular, it is a component of
Structured Query Language (SQL).
TCL:‐ Transaction Control Language are basically used for managing and controlling the transactionsin a database to
maintain consistency. And it also helps a user manage all the changes made by the DML commands for maintaining
its transactions.
Answer the following questions on the basis the given table:

Roll_No Name Subject Sex Average


1 Arjun English M 80
2 Aditi Computer F 82
a. How many attributes are there in the above tables?
b. What is the degree of the above table?
c. What is the cardinality of the above table?
Name the primary key in the table.
Ans:‐
a. There are five attributes(Columns) in above table.
b. Degree (No. of Columns) =5
c. Cardinality ( No. of Rows)=2
Roll_No is the primary key.

You might also like