Professional Documents
Culture Documents
11th IP Answer Key
11th IP Answer Key
11th IP Answer Key
24. Ans:- A primary key is used to uniquely identify a record in a table, while a candidate key helps in 2
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.
25. Ans:‐ Data Model gives us an idea that how the final system will look like after its complete 2
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.
Part‐C
26. Ans:‐ (i) Select * from student: 3
(ii) Select RollNo, Name, Class from student;
(iii) Select * from Student where Name =’Aarti’;
27. Ans:‐ When compared to the access time of the main memory, the speed of the CPU is extremely 3
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.
ORANGE EDUCATION 2
28. 3
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)
29. Ans:‐ list = [10, 20, 30, "Chandigarh", "Patiala"] 3
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 list
print("List elements: ", list)
30. Ans:‐ The SELECT clause specifies the columns from which data values are to be retrieved by the 3
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 table
or 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
Part‐D
31. Ans:‐ (i) SELECT Name FROM SPORTS WHERE Grade1=’C’ Or Grade2=’C’. 5
(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));
32. Ans:‐ 5
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
ORANGE EDUCATION 3
else:
x,y,z=num1,num3,num2
elif num2<num1 and num2<num3:
if num1<num3:
x,y,z=num2,num1,num3
else:
x,y,z=num2,num3,num1
else:
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)
33. Ans:‐ 5
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")
Part‐E
34. Ans:‐ Based on functionalities performed by them, there are five types of SQL Commands‐ DDL(Data 4
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).
d. TCL:‐ Transaction Control Language are basically used for managing and controlling the transactions
in a database to maintain consistency. And it also helps a user manage all the changes made by the
DML commands for maintaining its transactions.
35. Ans:‐ 4
a. There are five attributes(Columns) in above table.
b. Degree (No. of Columns) =5
c. Cardinality ( No. of Rows)=2
d. Roll_No is the primary key.
ORANGE EDUCATION 4