Professional Documents
Culture Documents
TERM-2 CLASS XI
Mr R Senthil Kumar
Deputy Commissioner
KVSRO Ernakulam
PATRONS
CO-ORDINATOR
Mr.Jyothi Mohan N V
Principal
Kendriya Vidyalaya S A P, Peroorkada
KENDRIYA VIDYALAYA SANGATHAN
ERNAKULAM REGION
DATABASE CONCEPTS
Page No.1 to 3
Pge No.18 to 21
Emerging Trends
Page No. 22 to 28
1. Prerequisite : None
2. Learning Outcomes :
At the end of this course, students will be able to:
● Identify the components of the Computer System.
● Create Python programs using different data types, lists and dictionaries.
● Explain database concepts and Relational Database Management Systems.
● Retrieve and manipulate data in RDBMS using Structured Query Language
● Identify the Emerging trends in the fields of Information Technology.
TERM - 1
Unit 1:
Introduction to Computer System
● Introduction to computers and computing: evolution of computing devices, components of a
computer system and their interconnections, Input/Output devices.
● Computer Memory: Units of memory, types of memory – primary and secondary, data deletion, its
recovery and related security concerns.
● Software: purpose and types – system and application software, generic and specific purpose
software.
Unit 2:
Introduction to Python
● Basics of Python programming, Python interpreter - interactive and script mode, the structure of a
program, indentation, identifiers, keywords, constants, variables, types of operators, precedence of
operators, data types, mutable and immutable data types, statements, expressions, evaluation of
expressions, comments, input and output statements, data type conversion, debugging,
● List operations - creating, initializing, traversing and manipulating lists, list methods and built-in
functions.: len(), list(), append(), extend(), insert(), count(), find(), remove(), pop(), reverse(), sort(),
sorted(), min(), max(), sum()
● Dictionary: concept of key-value pair, creating, initializing, traversing, updating and deleting
elements, dictionary methods and built-in functions: len(), dict(), keys(), values(), items(), get(),
update(), clear(), del()
Topic Marks
Viva 2
Total 15
Programming in Python
TERM - 2
4 Introduction to Emerging 5
Trends
Total 35
Unit 3:
● Structured Query Language: Data Definition Language, Data Query Language and Data
Manipulation Language, Introduction to MySQL: Creating a database, using database, showing
tables using MySQL,
● Data Definition Commands: CREATE, DROP, ALTER (Add and Remove primary key, attribute).
Data Query Commands: SELECT-FROM- WHERE, LIKE, BETWEEN, IN, ORDER BY, using
arithmetic, logical, relational operators and NULL values in queries, Distinct clause Data
Manipulation Commands: INSERT, UPDATE, DELETE.
Unit 4:
Introduction to the Emerging Trends
● Artificial Intelligence, Machine Learning, Natural Language Processing,
● Immersive experience (AR, VR), Robotics
● Big data and its characteristics, Internet of Things (IoT), Sensors, Smart cities,
● Cloud Computing and Cloud Services (SaaS, IaaS, PaaS);
● Grid Computing, Block chain technology.
Distribution of Practical Marks
Topic Marks
Viva 3
Total 15
1. To create a database
2. To create a student table with the student id, class, section, gender, name, dob, and marks as
attributes where the student id is the primary key.
3. To insert the details of at least 10 students in the above table.
4. To delete the details of a particular student in the above table.
5. To increase marks by 5% for those students who have Rno more than 20.
6. To display the entire content of the table.
7. To display Rno, Name and Marks of those students who are scoring marks more than 50.
8. To find the average of marks from the student table.
9. To find the number of students, who are from section ‘A’.
10. To add a new column email in the above table with appropriate data type.
11. To add the email ids of each student in the previously created email column.
12. To display the information of all the students, whose name starts with ‘AN’ (Examples: ANAND,
ANGAD,..)
13. To display Rno, Name, DOB of those students who are born between ‘2005- 01-01’ and
‘2005-12-31’.
14. To display Rno, Name, DOB, Marks, Email of those male students in ascending order of their
names.
15. To display Rno, Gender, Name, DOB, Marks, Email in descending order of their marks.
16. To display the unique section available in the table.
Reference:
NCERT Informatics Practices - Text book for class - XI (ISBN- 978-93-5292-148-5 )
DATABASE CONCEPTS
➢ Database
A database is a place where bulk amount of interrelated data is stored in an
organized way, so that it can be easily accessed and managed.
➢ Relational Database
A database where data are organized in the form of tables (rows and columns)
➢ Attributes
Columns in a Relation
Eg: No,Name,Salary,Zone,Age,Grade,Dept
➢ Tuples
Records/Rows in a relation
Eg:1,mukul,30000,west,28,A,10
➢ Degree
No:of attributes in a relation
Degree of Employee:7
➢ Cardinality
No:of Tuples/records in a relation
Eg: Cardinality of Employee:7
➢ Domain
Set of values taken for an attribute
Eg: Domain of (dept)={10,20,30}
➢ Primary key
Key attribute that uniquely identifies a tuple
➢ Candidate keys
Set of attributes have the ability to become primary key
Eg:candidate(employee)={no,name}
➢ Alternate keys
All the candidate keys except primary key
Eg:alternate key(employee)={name}
➢ Foreign key
A non-key attribute which is used to set relationship between 2 tables .The values of the
foreign key are derived from the primary key of another table
Foreign key is also known as Referential Integrity constraint
Check yourself
✓ CREATE: This command is used to create the database or its objects (like table,
✓ TRUNCATE: This is used to remove all records from a table, including all spaces
DCL includes commands such as GRANT and REVOKE which mainly deal with the
rights, permissions, and other controls of the database system.
CREATE DATABASE :
TO OPEN DATABASE :
CREATE TABLE
For example:
CREATE TABLE Employee (Employee Id INTEGER PRIMARY KEY, First name CHAR
(50) NULL, Last name CHAR (75) NOT NULL);
The mandatory semi-colon at the end of the statement is used to process every command
before it. In this example, the string CHAR is used to specify the data type. Other data types
can be DATE, NUMBER, or INTEGER.
NOT NULL to define that column will not accept null values.
Not Null and Default constraints can be applied only at column level rest all constraints can
be applied on both column level and table levels.
A table may have multiple UNIQUE constraints but only one PRIMARY KEY is allowed.
Example:
StAdd varchar(40),
To see the names of all the tables in the database, At any point of time, we can view names of
all the tables contained in the current database by using SHOW TABLES statement as shown
below:
1. Which subdivision of SQL is used to put values in tables and which one to create tables?
ANS: DML is used to put values & DDL is used to create Values
ANS: The DDL provides statements for the creation and deletion of tables, index, views etc,
The DML provides statements to enter , update, delete the data and perform complex queries
on these tables
3.What is SQL
ANS: Structured Query Language (SQL) is a language used for accessing and manipulating
databases.
ANS: Database
5. Expand DBMS
6. What is databse?
ANS database is a logically organized collection of data, such as facts, figures and numbers,
it’s a repository of stored data
ANS: The various components of database system are data, hardware, software and users
● Numeric
● Date and Time
● String Types.
MySQL uses all the standard ANSI SQL numeric data types
The following list shows the common numeric data types and their descriptions –
● INT − A normal-sized integer that can be signed or unsigned. If signed, the allowable
range is from -2147483648 to 2147483647. If unsigned, the allowable range is from 0
to 4294967295. You can specify a width of up to 11 digits.
● FLOAT(M,D) − A floating-point number that cannot be unsigned. You can define the
display length (M) and the number of decimals (D). This is not required and will default
to 10,2, where 2 is the number of decimals and 10 is the total number of digits
(including decimals). Decimal precision can go to 24 places for a FLOAT
● DECIMAL(M,D) − An unpacked floating-point number that cannot be unsigned. In the
unpacked decimals, each decimal corresponds to one byte. Defining the display
length (M) and the number of decimals (D) is required
● DOUBLE(M,D) − A double precision floating-point number that cannot be unsigned.
You can define the display length (M) and the number of decimals (D). This is not
required and will default to 16,4, where 4 is the number of decimals. Decimal precision
can go to 53 places for a DOUBLE.
Date and Time data type
● DATE − A date in YYYY-MM-DD format, between 1000-01-01 and 9999-12-31. For
example, December 30th, 1973 would be stored as 1973-12-30.
● DATETIME − A date and time combination in YYYY-MM-DD HH:MM:SS format,
between 1000-01-01 00:00:00 and 9999-12-31 23:59:59. For example, 3:30 in the
afternoon on December 30th, 1973 would be stored as 1973-12-30 15:30:00.
● TIME − Stores the time in a HH:MM:SS format.
● YEAR(M) − Stores a year in a 2-digit or a 4-digit format. If the length is specified as 2
(for example YEAR(2)), YEAR can be between 1970 to 2069 (70 to 69). If the length
is specified as 4, then YEAR can be 1901 to 2155. The default length is 4.
String Types
Most data you'll store will be in a string format. Common string datatypes in MySQL.
Char datatype is used to store character strings Varchar datatype is used to store character strings
of fixed length. of variable length.
We can use char datatype when we know the We can use it when we are not sure of the length
length of the string. of the string.
Char datatype can be used when we expect the Varchar datatype can be used when we expect the
data values in a column to be of same length. data values in a column to be of variable length.
It takes more memory It takes less space
DDL is Data Definition Language which is used to define data structures. For example:
create table, alter table are instructions in SQL.
DML is Data Manipulation Language which is used to manipulate data itself. For example:
insert, update, delete are instructions in SQL.
It is used to create database schema and can It is used to add, retrieve or update the
be used to define some constraints as well. data.
It basically defines the column (Attributes) of the It add or update the row of the table.
table. These rows are called as tuple.
DDL does not use WHERE clause in its While DML uses WHERE clause in its
statement. statement.
CREATING DATABASE:
Note: IF NO EXISTS will attempt to create database only if the given name database not
exists. If command is executed without it and database already exists, then error message
‘database already exists’ will come
Example:
Create Database mydata1;
Create Database if not exists mydata1;
OPENING DATABASE
To start working in any database it must be opened by USE command.
USE databasename;
Example: Use mydata1;
GETTING LIST OF ALL DATABSES
To get the list of all created database –
Show databases;
REMOVING DATABSES
CREATING TABLE
The following SQL creates a PRIMARY KEY on the "ID" column when the "Persons" table is
created:
Create table emp(empno int primary key, name varchar(20), dept varchar(20), salary int)
DROPPING TABLE
WHERE Syntax
SELECT column1, column2, FROM table_name WHERE condition;
Example:
The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.
There are two wildcards often used in conjunction with the LIKE operator:
The percent sign and the underscore can also be used in combinations!
Here are some examples showing different LIKE operators with '%' and '_' wildcards:
WHERE CustomerName LIKE 'a%' Finds any values that start with "a"
WHERE CustomerName LIKE '%a' Finds any values that end with "a"
WHERE CustomerName LIKE '%or%' Finds any values that have "or" in any position
WHERE CustomerName LIKE '_r%' Finds any values that have "r" in the second
position
WHERE CustomerName LIKE 'a_%' Finds any values that start with "a" and are at least
2 characters in length
WHERE CustomerName LIKE 'a__%' Finds any values that start with "a" and are at least
3 characters in length
WHERE ContactName LIKE 'a%o' Finds any values that start with "a" and ends with
"o"
SELECT * FROM Customers WHERE CustomerName LIKE 'a%';
The BETWEEN operator selects values within a given range. The values can be numbers,
text, or dates. The BETWEEN operator is inclusive: begin and end values are included.
BETWEEN Syntax
SELECT column_name(s)
FROM table_nameWHERE column_name BETWEEN value1 AND value2;
BETWEEN Example
The following SQL statement selects all products with a price between 10 and 20:
To display the products outside the range of the previous example, use NOT BETWEEN:
IN Syntax
SELECT column_name(s) FROM table_name WHERE column_name IN (value1, value2,
...);
IN Operator Examples
The following SQL statement selects all customers that are located in "Germany", "France" or
"UK":
The following SQL statement selects all customers that are NOT located in "Germany",
"France" or "UK":
The ORDER BY keyword is used to sort the result-set in ascending or descending order.
The ORDER BY keyword sorts the records in ascending order by default. To sort the records
in descending order, use the DESC keyword.
ORDER BY Syntax
SELECT column1, column2 FROM table_name ORDER BY column1[ ASC|DESC];
The following SQL statement selects all customers from the "Customers" table, sorted by the
"Country" column:
The following SQL statement selects all customers from the "Customers" table, sorted
DESCENDING by the "Country" column:
The following SQL statement selects all customers from the "Customers" table, sorted by the
"Country" and the "CustomerName" column. This means that it orders by Country, but if some
rows have the same Country, it orders them by CustomerName:
The following SQL statement selects all customers from the "Customers" table, sorted
ascending by the "Country" and descending by the "CustomerName" column:
❖ INSERT command:
This command is used to insert new rows into an existing table.
SYNTAX:
INSERT INTO tablename VALUES(value 1, value 2,....);
Here, value 1 corresponds to attribute 1, value 2
corresponds to attribute 2 and so on.
Examples:
mysql>INSERT INTO student values(‘Harsh’,’Kumar’,’Mumbai’);
mysql> SELECT * FROM EMPLOYEE WHERE Salary > 5000 AND DeptId =
'D04';
Example: Write a query to display all the records in employee table except that of
Aravind.
Example: The following query selects details of all those employees who have not
been given a bonus.
Example: The following query selects names of all employees who have been
given a bonus (i.e., Bonus is not null) and works in the department D01.
❖ DISTINCT Clause:
By default, SQL shows all the data retrieved through query as output. However,
there can be duplicate values. The SELECT statement when combined with
DISTINCT clause, returns records without repetition (Distinct records).
For example, while retrieving a department number from employee relation, there
can be duplicate values as many employees are assigned to the same department.
To select unique department number for all the employees, we use DISTINCT as
shown below:
mysql> SELECT DISTINCT DeptId FROM EMPLOYEE;
❖ UPDATE Command:
We may need to make changes in the value(s) of one or more columns of existing
records in a table. For example, we may require some changes in address, phone
number or spelling of name, etc. In such situations UPDATE statement is used to
make such modifications in existing data.
SYNTAX:
UPDATE table_name SET attribute1 = value1, attribute2 = value2, ...
[WHERE condition];
Example: Write a query to change the marks as 65 whose RollNo is 3 from the
table STUDENT.
mysql> UPDATE STUDENT SET Marks = 65 WHERE RollNo= 3;
NOTE: If we miss the where clause in the UPDATE statement then the Marks of all
the records will be changed to 65
We can also update values for more than one column using the UPDATE
statement.
Artificial Intelligence:
Immersive Experiences:
Immersive experiences allow us to visualise, feel and react by stimulating
our senses. It enhances our interaction and involvement, making them more
realistic and engaging. Immersive experiences have been used in the field of
training, such as driving simulators, flight simulator etc. Immersive experience can
be achieved using virtual reality and augmented reality.
● Virtual Reality:Virtual Reality (VR) is a three-dimensional, computer-
generated situation that simulates the real world. The user can interact with
and explore that environment by getting immersed in it while interacting with
the objects and other actions of the user.
● Augmented Reality :It adds components of the digital world to the physical
world, along with the associated tactile and other sensory requirements,
thereby making the environment interactive and digitally manipulable.
Big Data:Due to the continuous evolution of Internet the number of users are
growing so fast. As a result huge bytes of data are created everyday(img1: shows
what happens in every 60 sec in internet). This results in the generation of data
sets of enormous volume and complexity called Big Data. The data is not only
voluminous, but also unstructured like our posts, instant messages and chats,
photographs that we share through various sites, our tweets, blog articles, news
items, opinion polls and their comments, audio/video chats, etc.
Img1:(Values are approximate)
○ Volume The most prominent characteristic of big data is its enormous size.
○ Velocity It represents the rate at which the data under consideration is being
generated and stored.
○ Variety It asserts that a data set has varied data, such as structured, semi-
structured and unstructured data.
Web of Things (WoT): allows the use of web services to connect anything in the physical
world, besides human identities on the web.
IoT vs WoT: IoT is about creating a network of objects, things, people, system and
applications, WoT tries to integrate them to the Web and manage the devices easily.
Sensors :Sensors are very commonly used for monitoring and observing elements in real
world applications. A smart sensor is a device that takes input from the physical
environment and uses built-in computing resources to perform predefined functions upon
detection of specific input and then process data before passing it on. Examples:The
accelerometer sensor in the mobile phones detects the orientation of the phone. The
gyroscope sensors tracks rotation or twist of your hand and add to the information
supplied by the accelerometer
CLOUD COMPUTING
CLOUD SERVICES
A service corresponds to any facility provided by the cloud. There are three standard
models to categorise different computing services delivered through cloud
The IaaS providers can offer different kinds of computing infrastructure, such as
servers, virtual machines (VM), storage and backup facility, network components,
operating systems or any other hardware or software. Using IaaS from the cloud, a
user can use the hardware infrastructure located at a remote location to configure,
deploy and execute any software application on that cloud infrastructure. They can
outsource the hardware and software on demand basis and pay as per the usage,
thereby they can save the cost of software, hardware and other infrastructures as
well as the cost of setting up, maintenance and security
Through this service, a user can install and execute an application without worrying
about the underlying infrastructure and their setup. That is, PaaS provides a platform or
environment to develop, test, and deliver software applications. Suppose we have
developed a web application using MySQL and Python. To run this application online,
we can avail a pre-configured Apache server from cloud having MySQL and Python pre-
installed. Thus, we are not required to install MySQL and Python on the cloud, nor do
we need to configure the web server (Apache, ngirix). In PaaS, the user has complete
control over the deployed application and its configuration. It provides a deployment
environment for developers at a much reduced cost lessening the complexity of buying
and managing the underlying hardware and software.
GRID COMPUTING
Grid computing is different from IaaS cloud service. In case of IaaS cloud service,
there is a service provider who rents the required infrastructure to the users.
Whereas in grid computing, multiple computing nodes join together to solve a
common computational problem.To set up a grid, by connecting numerous nodes
in terms of data as well as CPU, a middleware is required to implement the
distributed processor architecture.
a)NLP
b)VR
c)AR
d)ML
Ans: b
2)-------------------- Technology is able to take an existing environment and add a layer of virtual
information on top of it?
a)NLP
b)VR
c)AR
d)ML
Ans: c
a)NLP
b)AR
c)AR
d)ML
Ans: d
4)------------------- are programable machines that are able to carry out actions autonomously?
a)Grid
b)Cloud
c)Robots
d)Robotics
Ans: c
a)Database
b)Bigdata
c)Cloud Computers
d)None of these
Ans: b
6)Intelligent Sensors that can convert and process quantities digital are----------------?
a)Cloud
b)AI
c)Grid
d)Smart
Ans: d
a)Cloud
b)AI
c)Grid
d)Smart
Ans: c
a)NLP
b)VR
c)AR
d)ML
Ans: a
b)A type of internet based computing that provides shared computer processing resources and data
to computers and other devices on demand.
Ans: b
b)Many programs can be run at the same time regardless of the processing power of your device
d)Portability
Ans: c
a)Google Drive
b)Microsoft Azure
c)iCloud
d)All of these
Ans: d
a)Iaas
b)Paas
c)Saas
d)Daas
Ans: d
a)Decentralized Application
b)Cryptocurrency
c)Block
d)Cryptography
Ans: d
b)It is a partially distributed ledger of some transactions across a peer to peer network overviewed
by a central authority
d)It is a technology that enabled the development of all kinds of apps which are overviewed by a
centralized Network.
Ans: a
a)Block
b)Confirmed
c)Circulating Supply
d)Address
Ans: a
a)Voting
b)Online gaming
c)health record
d)Fund transfer
Ans: b
a)PIN code
b)hash code
c)password
d)login
Ans: b
a)Transaction data
d)All of these
Ans: d
Ans: b
20)The process of confirming a transaction after validating and adding it to the public ledger is
called
a)Block
b)hashing
c)mining
d)validation
Ans: c
There are various real-world applications of AI, and some of them are given below:
● Google Search Engine: When we start writing something on the google search
engine, we immediately get the relevant recommendations from google, and this
is because of different AI technologies.
● Spam Filters in Email: The AI is also used for email spam filtering so that you can
get the important and relevant emails only in your inbox. As per the studies, Gmail
successfully filters 99.9% of spam mails.
It requires a huge amount of data to work. It can work with less amount of data
compared to deep learning and AI.
The goal of AI is to enable the machine to The goal of ML is to enable the machine
think without any human intervention. to learn from past experiences.
3.Mention any 5 languages used for AI programming.
● Python
● Java
● Lisp
● R
● Prolog
Among the above five languages, Python is the most used language for AI development
due to its simplicity and availability of lots of libraries, such as Numpy, Pandas, etc.
14. What is the advantages on using big data in education in real life?
A. Cost reduction
B. Higher risk
C. Effective learning
D. A and B only
E. A and C only
TOTAL
5(10) 1(3) 1(2) 2(6) 1(2) 1(4) 2(8) 13(35) 35
Note: Total Marks with in brackets and No. of questions outside
TYPES OF QUESTIONS TO BE INCLUDED
VERY SHORT ANSWERS(2 Marks) - SHORT ANSWERS(3 Marks) - LONG ANSWERS(4 Marks)
CASE STUDY BASED QUESTIONS - APPLICATION LEVEL(OUPUT BASED )
2 marks Questions : 7
3 marks Questions : 3
4 marks Questions : 3
KENDRIYA VIDYALAYA SANGATHAN, ERNAKULAM REGION
Sample Question Paper – SET 1
INFORMATICS PRACTICES (Code : 065)
Maximum Marks: 35 Class : XI Time: 2 hours
General Instructions
The question paper is divided into 3 sections – A, B and C
• Section A, consists of 7 questions (1-7). Each question carries 2 marks.
• Section B, consists of 3 questions (8-10). Each question carries 3 marks.
• Section C, consists of 3 questions( 11-13). Each question carries 4 marks.
• Internal choices have been given for question numbers – 1 , 3, 8 and 12.
Section – A
Each question carries 2 marks
1.Differentiate between primary key and foreign key.
OR
Differentiate between Candidate key and alternate key.
2. write any two advantages of a database system.
3. Compare AI and machine learning.
OR
Give some real-world applications of AI.
4. Differentiate between char(n) and varchar(n) data types with respect to databases
5. Observe the following table and answer the parts(i) and(ii) accordingly
(i) Write the names of most appropriate columns, which can be considered as candidate
keys.
(ii) What is the degree and cardinality of the above table?
Page | 1
6. Write a query to create a table employee with following.
Section – B
Each question carries 3 marks
8. Write the syntax of the following SQL commands with examples.
i) CREATE TABLE command
ii) UPDATE command
iii) DELETE command
9. Write SQL query to create a table “BOOKS” with the following structure:
Table: BOOKS
Help Happy Das in identifying any two columns for a table named student along with their suitable
data type.
Section – C
Each question carries 4 marks
11.Write the output of the following SQL queries.
Page | 2
i. select sysdate();
ii. select 5.0+5.2;
iii. select day("2022-02-15");
iv. select year("2022-01-18");
12. Write queries (a) to (d) based on the table DEPARTMENT given below:
Page | 3
(a) SELECT SUM(DISCOUNT) FROM FURNITURE WHERE COST>15000;
(b) SELECT MAX(DATEOFPURCHASE) FROM FURNITURE;
(c) SELECT * FROM FURNITURE WHERE DISCOUNT>5 AND FID LIKE "T%";
(d) SELECT DATEOFPURCHASE FROM FURNITURE WHERE NAME IN ("Dining Table", "Console
Table");
Page | 4
Page 1 of 8
General Instructions
The question paper is divided into 3 sections – A, B and C
• Section A, consists of 7 questions (1-7). Each question carries 2 marks.
• Section B, consists of 3 questions (8-10). Each question carries 3 marks.
• Section C, consists of 3 questions (11-13). Each question carries 4 marks.
• Internal choices have been given for question numbers – 1 , 3, 8 and 12.
Section – A
Each question carries 2 marks
1. ANSWER
Primary key
Key attribute that uniquely identifies a tuple
• Only one primary key in a relation
• No null values in primary key column
• No values can be repeated in a primary key column
Foreign key
A non-key attribute which is used to set relationship between 2 tables .The values of the
foreign key are derived from the primary key of another table.
Foreign key is also known as Referential Integrity constraint
OR
Candidate keys
Set of attributes have the ability to become primary key
Alternate keys
All the candidate keys except primary key2. write any two advantages of a database system.
Page 2 of 8
OR
There are various real-world applications of AI, and some of them are given below:
● Google Search Engine: When we start writing something on the google search engine, we
immediately get the relevant recommendations from google, and this is because of different
AI technologies.
● Ridesharing Applications: Different ride-sharing applications such as Uber uses AI and
machine learning to determine the type of ride, minimize the time once the car is hailed by
the user, price of the ride, etc.4. Differentiate between char(n) and varchar(n) data types
with respect to databases
(Any two points with explanation)
4. Differentiate between char and varchar data types.
Page 3 of 8
5. Observe the following table and answer the parts(i) and(ii) accordingly
(i) Write the names of most appropriate columns, which can be considered as candidate
keys.
Ans. Candidate Key: Pno, Name
(1 Mark for writing correct Candidate Keys)
(ii) What is the degree and cardinality of the above table?
Ans. Degree:4
Cardinality:5
(½ Mark for writing correct value of degree)
(½ Mark for writing correct value of cardinality)
6. Write a query to create a table employee with following.
ANSWER
CREATE TABLE employee( empid integer primary key,
name varchar(20),
deptid char(5),
salary integer,
desig varchar(20));
ANSWER
Section – B
Each question carries 3 marks
8. Write the syntax of the following SQL commands with examples.
i) CREATE TABLE command
ii) UPDATE command
iii) DELETE command
i) ANSWER
Create Table Tablename(colname datatype(size), colname2 datatype(size),...);
Example: Create table emp(empno int, name varchar(20), dept varchar(20), salary
int)
ii) ANSWER
SYNTAX:
UPDATE table_name SET attribute1 = value1, attribute2 = value2, ...
[WHERE condition];
Example: Write a query to change the marks as 65 whose RollNo is 3 from the
table STUDENT.
mysql> UPDATE STUDENT SET Marks = 65 WHERE RollNo= 3;
iii) ANSWER
DELETE statement is used to delete/remove one or more records from a table.
SYNTAX:
DELETE FROM table_name WHERE condition;
Example:Suppose the student with roll number 2 has left the school. We can use
the following MySQL statement to delete that record from the STUDENT table.
mysql> DELETE FROM STUDENT WHERE RollNo = 2;
Page 5 of 8
9. Write SQL query to create a table “BOOKS” with the following structure:
Table: BOOKS
Help Happy Das in identifying any two columns for a table named student along with their suitable
data type.
ANSWER
Create table Books ( BOOK_ID Integer (2) Primary Key, BOOK_NAME Varchar (20), CATEGORY
Varchar (20), ISSUE_DATE Date );
(2 mark for correct query)
2. Reduces Employment
While replacing repetitive jobs and other types of work with AI is beneficial to a
company, it will undoubtedly also affect employment.
3. Lacks Creative Ability
One of the drawbacks of using AI, particularly when playing a role in your content
marketing strategy, is its inability to be creative and innovative.
(Any three points with brief description, both cons and pros)
Section – C
Each question carries 4 marks
11.Write the output of the following SQL queries.
i. select sysdate();
+---------------------+
| sysdate() |
+---------------------+
| 2022-01-18 09:11:48 |
+---------------------+
ii. select 5.0+5.2;
+---------+
| 5.0+5.2 |
+---------+
| 10.2 |
+---------+
iii. select day("2022-02-15");
+-------------------+
| day("2022-02-15") |
+-------------------+
| 15 |
+-------------------+
iv. select year("2022-01-18");
+--------------------+
| year("2022-01-18") |
+--------------------+
| 2022 |
+--------------------+
12. Write queries (a) to (d) based on the table DEPARTMENT given below:
Page 7 of 8
ANSWERS
KENDRIYA VIDYALYA SANGATHAN, ERNAKULAM REGION SET II
TERM2 SAMPLE QUESTION PAPER 2021‐22
CLASS XI : INFORMATICS PRACTICES (PYTHON)
Time: 2 hrs Max. Marks : 35
General Instructions
The Question paper is divided into 3 Sections‐A, B and C.
Section A: consists of 7 Question 1‐7. Each carries 2 marks.
Section B: consists of 3 Question 8‐10. Each carries 3 marks.
Section C: consists of 3 Question 11‐13. Each carries 4 marks.
Internal choices have been given for questin number – 1, 3, 8 and 12.
Section – A
1 Anju wants to create a table to store the personal details of students. Suggest the possible 2
structure of the table.
She also wants to identify a particular record. Suggest suitable column in the table for it and
properly explain usage of that constraint
OR
i. Which clause is used to display the structure of a table.
ii. Write the domain for field named GENDER
2 Consider the Table ‘‘Infant’’ shown below : 2
Table : Infant
ItemCode Item DatePurchase UnitPrice Discount
101 Frock 2016‐01‐23 700 10
102 Cot 2015‐09‐23 5000 25
103 Soft Toy 2016‐06‐17 800 10
104 Baby Socks 2014‐10‐16 100 7
Identify the Degree and cardinality of the table given.
3 ‘‘XYZ’’ Company conducts workshops for employees of organizations. The company 2
requires data of workshops that are organized. Write SQL query to create a table
‘Workshop’ with the following structure :
Field Type Constraint
WorkshopId Integer Primary key
Title Varchar(50)
DateWorkshop Date
NumSpeakers Integer
OR
What is a realation in RDBMS. How is Referential Integrity implemented in RDBMS.
4 Differentiate between char(n) and varchar(n) data types with respect to databases. 2
6 i) The columns that can become a primary key is called candidate key. columns
what are candidate key but not primary key are called alternate keys. 2
ii) Eno, Ename – Candidate key
Ename – Alternate key
7 Natural Language Processing It is the technology used to aid computers to understand
the human’s natural language. 2
Section – B
8 i. show tables;
ii. distinct 3
iii. insert
OR
i. alter table inventory add primary key(INV_ID);
ii. DROP
9 i.Cloud computing is the delivery of different services through the Internet.
These resources include tools and applications like data storage, servers, 3
databases, networking, and software.
ii. Google Doc
iii. The term Big Data refers to a huge volume of data that cannot be stored
processed by any traditional data storage or processing units
10 i. New Delhi
Faridabad 3
Gurugram
ii. 2
iii.
Training_Id Name Email_Id Topic City Fee
ND01 Mr. Rajan raj@gmail.com Cyber Security New Delhi 10000
iv. Mr. Naveen
Section – C
Section –A
Each question carries 2 marks
6 What is the difference between DDL and DML. And Write full form of DDL and DML (2)
7 Write a command to display the whole content of the School table. Which command is (2)
used to add a new column in the existing table?
SECTION – B
Each question carries 3 marks
Table: STUDENT
Column name Data type size Constraint
ROLLNO Integer 4 Primary Key
SNAME Varchar 25 Not Null
GENDER Char 1 Not Null
DOB Date Not Null
FEES Integer 4 Not Null
HOBBEY Varchar 15 Null
9 Consider the following table named “SOFTDRINK”. Write output of SQL for (i) to (iii). (3)
Table : SOFTDRINK
DRINKCODE DNAME PRICE CALORIES
101 Apple Drink 20.00 120
102 Nature Nectar 18.00 150
103 Green Mango 15.00 115
104 Aam Panna 20.00 140
105 MangoJuice 12.00 135
(i) SELECT dname FROM softdrink WHERE price = 20 AND calories > 120;
(ii) SELECT dname as ‘Name of Drink’ , price FROM softdrink WHERE calories NOT IN
(115, 135, 120);
SECTION – C
Each question carries 4 marks
11 Consider the following table named "GYM" with details about Fitness products being (4)
sold in the store.
Table Name : GYM
PrCode stores Codes of Products
PrName stores names of Products
(UnitPrice is in Rs.)
PrCode PrName UnitPrice Manufacturer
P101 Cross Trainer 25000 Avon Fitness
P102 TreadMill 32000 AG Fitline
P103 Massage Chair 20000 Fit Express
P104 Vibration Trainer 22000 Avon Fitness
P105 Bike 13000 Fit Express
(a) Populate table with first record mentioning the column list in the insert clause.
(b) Populate table with 5th recorded and enter ID, User_ID, and Last_Name only.
(c) Add a new column mobile_no with integer datatype and size 10.
(d) Remove the newly added column mobile_no from the Employee table.
OR
(i) Sanjay was deleting the record of User_ID=’sgiri’, but at the time of execution of
command he forgot to add condition User_ID=’sgiri’, what will be the effect of
delete command in this case?
(ii) Sameer is executing the query to fetch the records of employee who are getting
salary between 4000 to 8000, he executed the query as –
Select * from employee where salary between 4000 to 8000;
But he is not getting the correct output, Rewrite the correct query.
(iii) Increase the salary of all the employees by 3% in the table employee
(iv) Remove the entire table from the database.
13 Write SQL Commands for (a) and (b), write value for (c) and write the outputs (4)
for (d) on the basis of table given.
Table : FURNITURE
NO ITEM NAME TYPE DATEOFSTOCK PRICE DISCOUNT
1 White Lotus Double Bed 2002-02-23 3000 25
2 Pink feathers Baby Cot 2002-01-29 7000 20
3 Dolphin Baby Cot 2002-02-19 9500 20
4 Decent Office Table 2002-02-01 25000 30
5 Comfort zone Double Bed 2002-02-12 25000 30
6 Donald Baby cot 2002-02-24 6500 15
7 Royal Finish Office Table 2002-02-20 18000 30
8 Royal tiger Sofa 2002-02-22 31000 30
9 Econo sitting Sofa 2001-12-13 9500 25
10 Eating Paradise Dining Table 2002-12-19 11500 25
(a) To show all the information about the Baby cots from the furniture table.
(b) To list itemname and type of those items, in which dateofstock is before
2002-02-01 from the furniture table in alphabetical order of itemname.
(c) Write Degree and Cardinality of the table.
(d) Select price from furniture where dateofstock < ’2002-02-12’;
SAMPLE PAPER SET 3 (MARKING SCHEME)
INFORMATICS PRACTICES (Code: 065)
CLASS: XI
Maximum Marks: 35 Time: 2 hours
Section –A
Each question carries 2 marks
1 IS NULL and NOT NULL clauses are used to handle NULL values in MySQL. (2)
Eg: select * from teacher where Salary IS NULL;
2 Char and Varchar stores character values but the size is static/fixed for char datatype (2)
and size is dynamic for varchar datatype.
6 DDL- DATA DEFINITION LANGUAGE – Command to modify the table structure (2)
DML- DATA MANIPULATION LANGUAGE – Command to manipulate data inside the
table
SECTION – B
Each question carries 3 marks
9 (i) SELECT dname FROM softdrink WHERE price = 20 AND calories > 120; (3)
DNAME
Aam Panna
(ii) SELECT dname as ‘Name of Drink’, price FROM softdrink WHERE calories NOT IN
(115, 135, 120);
Name of Drink Price
Nature Nectar 18.00
Aam Panna 20.00
Price+5
25.00
23.00
20.00
25.00
17.00
10 (a) The meaning of the Internet of Things is taking all the physical components and (3)
things in the world and connecting them to the internet.
Adv: Monitor Data, Ease of Access, Speedy Operation etc.
(b) Cloud can offer you the possibility of storing your files and accessing, storing, and
retrieving them from any web-enabled interface.
SECTION – C
Each question carries 4 marks
11 Write SQL statements to do the following: (4)
12 (a) Populate table with first record mentioning the column list in the insert clause. (4)
mysql> INSERT INTO employee (ID, First_Name,Last_Name, User_ID, Salary)
values(1,’Dim’, ‘Joseph’, ’Jdim’, 5000)
(b) Populate table with 5th recorded and enter ID, User_ID, and Last_Name only.
mysql> INSERT INTO employee (ID, Last_Name, User_ID) values(5,’Buddha’,
‘bgautam’)
(c) Add a new column mobile_no with integer datatype and size 10.
mysql> ALTER TABLE employee ADD mobile_no integer(10);
(d) Remove the newly added column mobile_no from the Employee table.
mysql> ALTER TABLE employee DROP mobile_no;
OR
(i) Sanjay was deleting the record of User_ID=’sgiri’, but at the time of execution of
command he forgot to add condition User_ID=’sgiri’, what will be the effect of
delete command in this case?
All records will be deleted from the table employee.
(ii) Sameer is executing the query to fetch the records of employee who are getting
salary between 4000 to 8000, he executed the query as –
Select * from employee where salary between 4000 to 8000;
But he is not getting the correct output, Rewrite the correct query.
mysql>Select * from employee where salary between 4000 and 8000;
(iii) Increase the salary of all the employees by 3% in the table employee
mysql>UPDATE employee SET salary=salary+salary*0.03 ;
(iv) Remove the entire table from the database.
mysql> DROP employee;
13 Write SQL Commands for (a) and (b), write value for (c) and write the outputs (4)
for (d) on the basis of table given.
Table : FURNITURE
NO ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT
1 White Lotus Double Bed 2002-02-23 3000 25
2 Pink feathers Baby Cot 2002-01-29 7000 20
3 Dolphin Baby Cot 2002-02-19 9500 20
4 Decent Office Table 2002-02-01 25000 30
5 Comfort zone Double Bed 2002-02-12 25000 30
6 Donald Baby cot 2002-02-24 6500 15
7 Royal Finish Office Table 2002-02-20 18000 30
8 Royal tiger Sofa 2002-02-22 31000 30
9 Econo sitting Sofa 2001-12-13 9500 25
10 Eating Paradise Dining Table 2002-12-19 11500 25
(a) To show all the information about the Baby cots from the furniture table.
mysql >SELECT * from FURNITURE where type= ‘Baby Cot’;
(b) To list itemname and type of those items, in which dateofstock is before
2002-02-01 from the furniture table in alphabetical order of itemname
mysql> SELECT itemname, type from Furniture order by itemname;
(c) Write Degree and Cardinality of the table.
Degree=6 and Cardinality=10
(d) Select price from furniture where dateofstock < ’2002-02-12’;
PRICE
7000
25000
9500