You are on page 1of 76

केन्द्रीय विद्यालय संगठन, एनााकुलम क्षेत्र

KENDRIYA VIDYALAYA SANGTAHAN


ERNAKULAM REGION

Database SQL Emerging Trends

STUDENT SUPPORT MATERIAL

TERM-2 CLASS XI

Informatics Practices (065)


1
Based on latest CBSE Exam Pattern for the Session 2021-22
CHIEF PATRON

Mr R Senthil Kumar
Deputy Commissioner
KVSRO Ernakulam

PATRONS

Mrs. Deepti Nair Mr. Santhosh Kumar N


Asst. Commissioner, KVSRO Ernakulam Assistant Commissioner, KVSRO Ernakulam

CO-ORDINATOR
Mr.Jyothi Mohan N V
Principal
Kendriya Vidyalaya S A P, Peroorkada
KENDRIYA VIDYALAYA SANGATHAN
ERNAKULAM REGION

CONTENT AND REVIEW TEAM


S Name of the
Name of KV Desig. FOCUS POINTS
No Teacher
Database Concepts: Introduction to database
concepts and its need, Database Management
K V KELTRON
1 Mrs Bindhiya N NAGAR
PGT CS System. Relational data model: concept of attribute,
domain, tuple, relation, candidate key, primary key,
alternate key, foreign key.
Structured Query Language: Data Definition
Language, Data Query Language and Data
Mr.Arun Prasanth
2 K V KANJIKODE PGT CS Manipulation Language, Introduction to MySQL:
PV Creating a database, using database, showing
tables using MySQL,
Data Types : char, varchar, int, float, date. ● Data
Definition Commands: CREATE, DROP, ALTER
Smt. SUJA P
3 K V ERNAKULAM PGT CS (Add and Remove primary key, attribute). Data
NAIR Query Commands: SELECT-FROM- WHERE,
LIKE, BETWEEN, IN, ORDER BY,
Data Definition Commands: using arithmetic,
logical, relational operators and NULL values in
4 Smt. Reshma S K V No.2 KOCHI PGT CS
queries, Distinct clause Data Manipulation
Commands: INSERT, UPDATE, DELETE.
Introduction to the Emerging Trends ● Artificial
Intelligence, Machine Learning, Natural Language
K V PORT TRUST
5 Smt. Vrinda S KOCHI
PGT CS Processing, ● Immersive experience (AR, VR),
Robotics ● Big data and its characteristics, Internet
of Things (IoT), Sensors, Smart cities,
Introduction to the Emerging Trends Cloud
Mrs.SUNI
7 K V RB KOTTAYAM PGT CS Computing and Cloud Services (SaaS, IaaS, PaaS);
ABRAHAM ● Grid Computing, Block chain technology.

K V CRPF SAMPLE QUESTION PAPER WITH ANSWER KEY


8 Mrs.AMBILY PALLIPURAM
PGT CS
AS PER CBSE GUIDELINES
KRISHNAN
K V PATTOM SAMPLE QUESTION PAPER WITH ANSWER KEY
9 Mrs. S Radha (SHIFT I )
PGT CS
AS PER CBSE GUIDELINES
SAMPLE QUESTION PAPER WITH ANSWER KEY
10 Mr.Sreejith.K.V K V PANGODE PGT(CS)
AS PER CBSE GUIDELINES

COMPILATION Mr.Sreejith.K.V, K V PANGODE


REVIEW ALL MEMBERS
Index

DATABASE CONCEPTS
Page No.1 to 3

Structured Query Language


Page No.4 to 8

SQL Datatypes and SQL Commands


Page No.9 to 17

Data Definition Commands


& Data Manipulation Commands

Pge No.18 to 21

Emerging Trends
Page No. 22 to 28

Emerging Trends and Artificial Intelligence


Page No.29 to 47
Informatics Practices
CLASS XI
Code No. 065
2021-22

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.

3. Distribution of Marks and Periods

Unit No Unit Name Marks Periods Periods Total


Theory Practical Period
1 Introduction to computer system 10 10 - 10
2 Introduction to Python 25 35 28 63
3 Database concepts and the 30 23 17 40
Structured Query Language
4 Introduction to Emerging 5 7 - 7
Trends
Practical 30 - - -
Total 100 75 45 120

TERM - 1

Distribution of Theory Marks

Unit No Unit Name Marks


1 Introduction to computer system 10
2 Introduction to Python 25
Total 35
Unit Wise syllabus

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,

● Control statements: if-else, for loop.

● 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()

Distribution of Practical Marks

Topic Marks

Python program (pen and paper or Collab or any online idle or 10


pyroid screen for mobile)

Practical File- 15 python Programs 3

Viva 2

Total 15

Suggested Practical List

Programming in Python

1. To find average and grade for given marks.


2. To find the sale price of an item with a given cost and discount (%).
3. To calculate perimeter/circumference and area of shapes such as triangle, rectangle, square and circle.
4. To calculate Simple and Compound interest.
5. To calculate profit-loss for a given Cost and Sell Price.
6. To calculate EMI for Amount, Period and Interest.
7. To calculate tax - GST / Income Tax.
8. To find the largest and smallest numbers in a list.
9. To find the third largest/smallest number in a list.
10. To find the sum of squares of the first 100 natural numbers.
11. To print the first ‘n’ multiples of a given number.
12. To count the number of vowels in a user entered string.
13. To print the words starting with a particular alphabet in a user entered string.
14. To print the number of occurrences of a given alphabet in a given string.
15. Create a dictionary to store names of states and their capitals.
16. Create a dictionary of students to store names and marks obtained in 5 subjects.
17. To print the highest and lowest values in the dictionary.

TERM - 2

Distribution of Theory Marks

Unit Unit Name Marks


No

3 Database concepts and the 30


Structured Query Language

4 Introduction to Emerging 5
Trends

Total 35

Unit 3:

Database concepts and the Structured Query Language


● Database Concepts: Introduction to database concepts and its need, Database Management
System. Relational data model: concept of attribute, domain, tuple, relation, candidate key, primary
key, alternate key, foreign key.

● 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 Types : char, varchar, int, float, date.

● 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

SQL Queries (pen and paper) 8

Practical File SQL Queries - 20 Queries 4

Viva 3

Total 15

Suggested Practical List :

Data Management: SQL Commands

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.

➢ Need and advantages of database over traditional files


• Database facilitates centralized storing
• Reduces Data inconsistency
• Reduces data redundancy
• Sharing of data is possible
• It gives protection to the data
• It enforce standards
➢ DBMS – Database management system
A software manages database
Eg: MySQL, PostgreSQL, Microsoft Access, SQL Server, FileMaker

➢ Relational Database
A database where data are organized in the form of tables (rows and columns)

➢ RDBMS – Relational Database management system


A software manages relational database
Eg: Microsoft SQL Server, Oracle Database, MySQL and IBM DB2

In relational data model data are organized in the form of tables


(ie rows and columns)

XI IP TERM-2 STUDENT SUPPORT MATERIAL ,KVS ERNAKULAM REGION 1


Terminologies in RDBMS
➢ Relation
Tables in Relational Database
Eg:Employee

➢ 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

• Only one primary key in a relation


• No null values in primary key column
• No values can be repeated in a primary key column

Eg: No in Employee table

➢ 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}

XI IP TERM-2 STUDENT SUPPORT MATERIAL ,KVS ERNAKULAM REGION 2


Candidate key=primary key + alternate key
Alternate key=candidate key-primary key

➢ 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

1. Write the difference between candidate key and alternate key


2. What is the need of a database? Write 3 points
3. Write the difference between primary key and foreign key
4. Differentiate degree and cardinality with example.
5. Write one example for open source RDBMS

XI IP TERM-2 STUDENT SUPPORT MATERIAL ,KVS ERNAKULAM REGION 3


STRUCTURED QUERY LANGUAGE (SQL)
Structured Query Language (SQL) as we all know is the database language by the use of
which we can perform certain operations on the existing database and also we can use this
language to create a database. SQL uses certain commands like Create, Drop, Insert, etc. to
carry out the required tasks.
These SQL commands are mainly categorized into four categories as:

1. DDL – Data Definition Language


2. DQL – Data Query Language
3. DML – Data Manipulation Language
4. DCL – Data Control Language

DDL (Data Definition Language):


DDL or Data Definition Language actually consists of the SQL commands that can be used
to define the database schema. It simply deals with descriptions of the database schema and
is used to create and modify the structure of database objects in the database. DDL is a set
of SQL commands used to create, modify, and delete database structures but not data.
These commands are normally not used by a general user, who should be accessing the
database via an application.
List of DDL commands:

✓ CREATE: This command is used to create the database or its objects (like table,

index, function, views, store procedure, and triggers).


✓ DROP: This command is used to delete objects from the database.

✓ ALTER: This is used to alter the structure of the database.

✓ TRUNCATE: This is used to remove all records from a table, including all spaces

allocated for the records are removed.


✓ COMMENT: This is used to add comments to the data dictionary.

✓ RENAME: This is used to rename an object existing in the database.

DQL (Data Query Language):


DQL statements are used for performing queries on the data within schema objects. The
purpose of the DQL Command is to get some schema relation based on the query passed to
it. We can define DQL as follows it is a component of SQL statement that allows getting

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 4


data from the database and imposing order upon it. It includes the SELECT statement. This
command allows getting the data out of the database to perform operations with it. When a
SELECT is fired against a table or tables the result is compiled into a further temporary
table, which is displayed or perhaps received by the program i.e. a front-end.
List of DQL:

✓ SELECT: It is used to retrieve data from the database.

DML(Data Manipulation Language):


The SQL commands that deals with the manipulation of data present in the database belong
to DML or Data Manipulation Language and this includes most of the SQL statements. It is
the component of the SQL statement that controls access to data and to the database.
Basically, DCL statements are grouped with DML statements.

List of DML commands:

✓ INSERT : It is used to insert data into a table.


✓ UPDATE: It is used to update existing data within a table.
✓ DELETE : It is used to delete records from a database table.
✓ LOCK: Table control concurrency.
✓ CALL: Call a PL/SQL or JAVA subprogram.
✓ EXPLAIN PLAN: It describes the access path to data.

DCL (Data Control Language):


#(Not Required for exam as per syllabus)

DCL includes commands such as GRANT and REVOKE which mainly deal with the
rights, permissions, and other controls of the database system.

List of DCL commands:

• GRANT: This command gives users access privileges to the database.


• REVOKE: This command withdraws the user’s access privileges given by using the
GRANT command.
• COMMIT: Commits a Transaction.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 5


• ROLLBACK: Rollbacks a transaction in case of any error occurs.
• SAVEPOINT:Sets a save point within a transaction.
• SET TRANSACTION: Specify characteristics for the transaction.

CREATING AND OPENING DATABASE:

CREATE DATABASE :

Example: mysql> create database School;

Now the database with the given name will be created.

TO OPEN DATABASE :

mysql> use School;

CREATE TABLE

This command builds a new table and has a predefined syntax.

The CREATE statement syntax is:

CREATE TABLE [table name] ([column definitions]) [table parameters];

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.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 6


Creating tables with Constraints:

A Constraint is a condition or check applicable to a column or table which ensures the


integrity or validity of data. Constraints are also called Integrity constraints. The following
constraints are commonly used in MySQL.

Constraints name Description

PRIMARY KEY Used to create a primary key

UNIQUE to create a unique key

NOT NULL to define that column will not accept null values.

CHECK to define the customrule or condition.

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:

CREATE TABLE Student

(StCode char(3) NOT NULL PRIMARY KEY,

Stname char(20) NOT NULL,

StAdd varchar(40),

AdmNo char(5) UNIQUE,

StGender char(1) DEFAULT ‘M’,

StAge integer CHECK (StAge>=10),

Stream char(1) CHECK Stream IN (‘S’, ‘C’, ‘A’) );

SHOWING TABLES USING MYSQL

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:

mysql> SHOW TABLES;

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 7


Suggested Questions

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

2.What is DDL & DML?

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.

4___________ is an organized collection of records

ANS: Database

5. Expand DBMS

ANS: Database Management System

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

7 What are the various components of database system

ANS: The various components of database system are data, hardware, software and users

8.What is mean by base table?

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 8


ANS: A table from which the values can be derived for other table. For example, in case of
views, the values are extracted from the base table on which the view depends.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 9


SQL Datatypes and SQL Commands
Data types: Data types are means to identify the type of data and associated operations for
handling it. MySQL uses many different data types divided into three categories −

● Numeric
● Date and Time
● String Types.

Numeric Data 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.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 9


● CHAR(M) − A fixed-length string between 1 and 255 characters in length (for example
CHAR(5)), right-padded with spaces to the specified length when stored. Defining a
length is not required, but the default is 1.
● VARCHAR(M) − A variable-length string between 1 and 255 characters in length. For
example, VARCHAR(25). You must define a length when creating a VARCHAR field.

Differences between Char & Varchar


Char Varchar

It is an abbreviation for characters. It is an abbreviation for variable characters.

Char datatype is used to store character strings Varchar datatype is used to store character strings
of fixed length. of variable length.

It uses static memory location. It uses dynamic memory location.

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.

Difference between DDL and DML


DDL DML

It stands for Data Manipulation


It stands for Data Definition Language. Language.

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.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 10


Basic command present in DDL are CREATE, BASIC command present in DML are
DROP, RENAME, ALTER etc. UPDATE, INSERT, MERGE etc.

DDL does not use WHERE clause in its While DML uses WHERE clause in its
statement. statement.

CREATING DATABASE:

CREATE DATABASE [IF NOT EXISTS] DATABASENAME

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

To remove already existing database


DROP DATABASE databasename
Example: Drop database mydata1;

CREATING TABLE

Create Table Tablename(colname datatype(size), colname2 datatype(size),…);

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 11


Example: Create table emp(empno int, name varchar(20), dept varchar(20), salary int)
VIEWING TABLE STRUCTURE
MySQL allows us to get the structure of table like list of columns, data type, size and key
information of table using DESC / DESCRIBE command
Example: DESC emp;
DDL Command- ALTER
ALTER TABLE command allows us to perform the following operations:
▪ Adding new column in existing table
▪ Dropping existing column from table
▪ Modifying column definition in table
▪ Changing the name of column
▪ Adding or dropping constraint after table creation.

ALTER TABLE - ADD Column

To add a column in a table, use the following syntax:

ALTER TABLE table_name ADD column_name datatype;


Example: ALTER TABLE Customers ADD Email varchar(255);
ALTER TABLE - DROP COLUMN
To delete a column in a table, use the following syntax
ALTER TABLE table_name DROP COLUMN column_name;
Example: ALTER TABLE Customers DROP COLUMN Email;
ALTER TABLE - ALTER/MODIFY COLUMN
To change the data type of a column in a table, use the following syntax:
ALTER TABLE table_name ALTER COLUMN column_name datatype;
Example: ALTER TABLE Emp modify Name Varchar(40);

ALTER TABLE Emp change Name EName varchar(40)


SQL PRIMARY KEY on CREATE TABLE

The following SQL creates a PRIMARY KEY on the "ID" column when the "Persons" table is
created:

SQL PRIMARY KEY on ALTER TABLE

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 12


To create a PRIMARY KEY constraint on the "empno" column when the table is already
created, use the following SQL:

Create table emp(empno int primary key, name varchar(20), dept varchar(20), salary int)

ALTER TABLE- ADDING CONSTRAINT

ALTER TABLE Persons ADD PRIMARY KEY (ID);


ALTER TABLE Persons ADD CONSTRAINT PK_Person PRIMARY KEY (ID,LastName);
DROP a PRIMARY KEY Constraint

To drop a PRIMARY KEY constraint, use the following SQL:

ALTER TABLE Persons DROP PRIMARY KEY;


ALTER TABLE Persons DROP CONSTRAINT PK_Person;

DROPPING TABLE

DROP TABLE[IF EXISTS] tablename


Example:
▪ Drop Table emp;
▪ Drop table if exists emp;

DATA QUERY COMMANDS


SELECT COMMAND
Select statement allows to send queries to table and fetch the desired record. Select can be
used to select both horizontal and vertical subset.
Syntax:- Select * / columnnames FROM tablename [ where condition ]
Selecting all record and all columns
Select * from emp;
Selecting desired columns
Select empno, name from emp;

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 13


Changing the order of columns
select dept, name from emp;

The SQL WHERE Clause

The WHERE clause is used to filter records.

It is used to extract only those records that fulfill a specified condition.

WHERE Syntax
SELECT column1, column2, FROM table_name WHERE condition;
Example:

SELECT * FROM Customers WHERE Country='Mexico';


SELECT * FROM Customers WHERE CustomerID=1;

The SQL LIKE Operator

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 (%) represents zero, one, or multiple characters


● The underscore sign (_) represents one, single character

The percent sign and the underscore can also be used in combinations!

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 14


LIKE Syntax
SELECT column1, column2, ...FROM table_name WHERE columnN LIKE pattern;

Here are some examples showing different LIKE operators with '%' and '_' wildcards:

LIKE Operator Description

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 SQL BETWEEN Operator

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:

SELECT * FROM ProductsWHERE Price BETWEEN 10 AND 20;

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 15


NOT BETWEEN Example

To display the products outside the range of the previous example, use NOT BETWEEN:

SELECT * FROM Products WHERE Price NOT BETWEEN 10 AND 20;


SELECT * FROM Orders WHERE OrderDate NOT BETWEEN '1996-07-01' AND '1996-07-
31';

The SQL IN Operator

The IN operator allows you to specify multiple values in a WHERE clause.

The IN operator is a shorthand for multiple OR conditions.

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":

SELECT * FROM Customers WHERE Country IN ('Germany', 'France', 'UK');

The following SQL statement selects all customers that are NOT located in "Germany",
"France" or "UK":

SELECT * FROM Customers WHERE Country NOT IN ('Germany', 'France', 'UK');


The SQL ORDER BY Keyword

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];

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 16


ORDER BY Example

The following SQL statement selects all customers from the "Customers" table, sorted by the
"Country" column:

SELECT * FROM Customers ORDER BY Country;

ORDER BY DESC Example

The following SQL statement selects all customers from the "Customers" table, sorted
DESCENDING by the "Country" column:

SELECT * FROM Customers ORDER BY Country DESC;


ORDER BY Several Columns Example-1

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:

SELECT * FROM Customers ORDER BY Country, CustomerName;

ORDER BY Several Columns Example-2

The following SQL statement selects all customers from the "Customers" table, sorted
ascending by the "Country" and descending by the "CustomerName" column:

SELECT * FROM Customers ORDER BY Country ASC, CustomerName DESC;

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 17


Data Definition Commands & Data Manipulation
Commands

❖ 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’);

We can insert record with specific column only


mysql>INSERT INTO student(lastname,firstname,city) values
(‘Harsh’,’Kumar’,’Mumbai’);
With the SELECT command we can retrieve previously inserted rows:
We can use the SQL statement to retrieve previously inserted records.
A general form of SELECT is:
SELECT * from table_name [where condition];
WHERE Clause:
The WHERE clause is used to retrieve data that satisfy the specified conditions.
With WHERE clause the following operators can be used:
• Comparison operators are: < ; <= ; = ; != or <> ; >= ; >
• Logical operators are: AND ; OR ; NOT
• Comparison operator for special value NULL ; IS NULL

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 18


Example: To display the details of those employees of D04 department who earn
more than 5000.

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.

mysql> SELECT * FROM EMPLOYEE WHERE NOT Ename = 'Aravind';

Handling NULL Values


SQL supports a special value called NULL to represent a missing or unknown
value. For example, the Ename column in the EMPLOYEE table can have missing
value
for certain records. Hence, NULL is used to represent such unknown values. It is
important to note that NULL is different from 0 (zero). Also, any arithmetic
operation
performed with NULL value gives NULL.
For example:
5 + NULL = NULL because NULL is unknown hence the result is also unknown. In
order to check for NULL value in a column, we use IS NULL operator.

Example: The following query selects details of all those employees who have not
been given a bonus.

mysql> SELECT * FROM EMPLOYEE WHERE Bonus IS NULL;

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.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 19


mysql> SELECT EName FROM EMPLOYEE WHERE Bonus IS NOT NULL AND
DeptID = ‘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.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 20


❖ DELETE Command:
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;

NOTE: Like UPDATE statement, we need to be careful to include the WHERE


clause while using a DELETE statement to delete records in a table. Otherwise, all
the records in the table will get deleted.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 21


EMERGING TRENDS

Artificial Intelligence:

● Artificial Intelligence is a way of making a computer, a computer-controlled


robot, or a software think intelligently, in the similar manner the intelligent
humans think.
● Goals of AI: Create expert systems, to implement human intelligence in
machines.
● Applications of AI:Gaming, Natural Language Processing,Expert
SystemsVision Systems, Speech Recognition, Intelligent Robots.
● Examples are: Intelligent digital personal assistants like Siri, Google Now,
Cortana, Alexa, smartphones with features to select the fastest or shortest
route etc.

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.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 22


Robotics:A robot is basically a machine capable of carrying out one or more tasks
automatically with accuracy and precision. Unlike other machines, a robot is
programmable, which means it can follow the instructions given through computer
programs.Robots that resemble humans are known as humanoids. Robots are
being used in industries, medical science, bionics, scientific research, military, etc.
Examples of Robots:Some examples are:
NASA’s Mars Exploration Rover (MER) mission is a robotic space mission
to study about the planet Mars.
Sophia is a humanoid that uses artificial intelligence, visual data processing,
facial recognition and also imitates human gestures and facial expressions.

A drone is an unmanned aircraft which can be remotely controlled or can


fly autonomously
Machine Learning:Machine Learning comprises of algorithms that use data to learn their
own and make prediction. It is a subsystem of Artificial Intelligence, wherein computers
have the ability to learn from data using statistical techniques, without being explicitly
programmed by a human being. It comprises algorithms that use data to learn on their own
and make predictions. These algorithms, called models.

Natural Language Processing (NLP):

Natural Language Processing (NLP) facilitates communicating with intelligent


systems using a natural language. The predictive typing feature of search engine
that helps us by suggesting the next word in the sentence while typing keywords
and the spell checking features are examples of Natural Language Processing

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 23


(NLP). An NLP system can perform text-to-speech and speech-to-text conversion.
It deals with the interaction between human and computers using human spoken
languages, such as Hindi, English, etc. Eg:Spell check, Autocomplete, Voice text
messaging, Spam filters, Related keywords on search engines, Siri, Alexa, or
Google Assistant.

Use of Natural Language Processing

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)

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 24


● Characteristics of Big Data:

○ 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.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 25


○ Veracity Big data can be sometimes inconsistent, biased, noisy or there can
be abnormality in the data or issues with the data collection methods.
○ Value Big data is not only just a big pile of data, but also possess to have
hidden patterns and useful knowledge which can be of high business value.
Data Analytics: Data analytics is the process of examining data sets in order to draw
conclusions about the information they contain, with the aid of specialized systems and
software.
Internet of Things (IoT):The ‘Internet of Things’ is a network of devices that have
embedded hardware and software to communicate (connect and exchange data) with
other devices on the same network.

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

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 26


Smart Cities :The idea of a smart city is to make use of computer and communication
technology along with IoT, WoT to manage and distribute resources efficiently. The
smart building using sensors to detect earthquake tremors and then warn nearby
buildings so that they can prepare themselves accordingly. The smart bridge uses
wireless sensors to detect any loose bolt, cable or crack and can alert concerned
authorities through SMS. The smart tunnel also uses wireless sensors to detect any
leakage or congestion in the tunnel. This information can be sent as wireless signals
across the network of sensor nodes to a centralised computer for further analysis are
components of smart city.

CLOUD COMPUTING

Cloud computing is an emerging trend in the field of information technology, where


computer-based services are delivered over the Internet or the cloud, for the case of
their accessibility form any where using any smart device. The services comprise
software, hardware (servers), databases, storage, etc. These resources are provided
by companies called cloud service providers and usually charge on pay per use
basis, like the way we pay for electricity usage. We already use cloud services while
storing our pictures and files as backup on Internet, or host a website on the Internet.
Through cloud computing, a user can run a bigger application or process a large
amount of data without having the required storage or processing power on their
personal computer as long as they are connected to the Internet. Besides other
numerous features, cloud computing offers cost-effective, on-demand resources. A
user can avail need-based resources from the cloud at a very reasonable cost.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 27


Cloud Computing Services

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

Infrastructure as a Service (IaaS),

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

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 28


Platform as a Service (PaaS)

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.

Software as a Service (SaaS).

SaaS provides on-demand access to application software, usually requiring a licensing


or subscription by the user. While using Google doc, Microsoft Office 365, Drop Box,
etc., to edit a document online, we use SaaS from cloud. A user is not concerned about
installation or configuration of the software application as long as the required software
is accessible. Like PaaS, a user is provided access to the required configuration settings
of the application software, that they are using at present.

GRID COMPUTING

A grid is a computer network of geographically dispersed and heterogeneous


computational resources. Unlike cloud, whose primary focus is to provide services,
a grid is more application specific and creates a sense of a virtual supercomputer
with an enormous processing power and storage. The constituent resources are
called nodes. These different nodes temporarily come together to solve a single
large task and to reach a common goal.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 29


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.

BLOCK CHAIN TECHNOLOGY

It uses shared databases of chained blocks where copies of database exists on


multiple computers. The block chain technology works on the concept of decentralized
and shared database where each computer has a copy of the database. Safety and
security of the transactions are ensured because all the members in the network keep
a copy of the blockchain and so it is not possible for a single member of the network to
make changes or alter data.

Block Chain Technology

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 30


QUESTIONS AND ANSWERS
1)------------------Technology make users as if they truly in a virtual environment.

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

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 31


3)---------------------- is an application of Artificial Intelligence (AI) and provides systems the
ability to automatically learn and improve from experience after initial training.

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

5)Extremely large set of data are _____________?

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

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 32


7)Distributed computing system formed by a network of independent computers is----------?

a)Cloud

b)AI

c)Grid

d)Smart

Ans: c

8)------------------------ is an a Artificial Intelligence (AI) technology that helps computers


understand interpret and manipulate human language.

a)NLP

b)VR

c)AR

d)ML

Ans: a

9)What is cloud computing?

a)A network of computers and printers available within an Organization.

b)A type of internet based computing that provides shared computer processing resources and data
to computers and other devices on demand.

c)A process of scheduling computer programs to work automously

d)Storage on data on servers that is accessible by all members of organization.

Ans: b

10)Which of these is an advantage of cloud storage?

a)The user has no control over their data

b)Many programs can be run at the same time regardless of the processing power of your device

c)Accessible anywhere within Internet connection.

d)Portability

Ans: c

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 33


11)Which of these is an example of cloud Storage?

a)Google Drive

b)Microsoft Azure

c)iCloud

d)All of these

Ans: d

12)Which of these is not a cloud service?

a)Iaas

b)Paas

c)Saas

d)Daas

Ans: d

13)The process of encrypting and decrypting information

a)Decentralized Application

b)Cryptocurrency

c)Block

d)Cryptography

Ans: d

14)What is a block chain?

a)It is a decentralized ledger of all transactions across a peer to peer network.

b)It is a partially distributed ledger of some transactions across a peer to peer network overviewed
by a central authority

c)It is a distributed ledger of all transactions across a top down network.

d)It is a technology that enabled the development of all kinds of apps which are overviewed by a
centralized Network.

Ans: a

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 34


15)When a transaction has been confirmed, it means it has been approved by the network and
permanently appended in the blockchain in the form of a ……………

a)Block

b)Confirmed

c)Circulating Supply

d)Address

Ans: a

16)Which are not the potential application of blockchain?

a)Voting

b)Online gaming

c)health record

d)Fund transfer

Ans: b

17)A block chain is secured by

a)PIN code

b)hash code

c)password

d)login

Ans: b

18)What does the block in the Block chain consist of?

a)Transaction data

b)A Hash Point

c)A Time stamp

d)All of these

Ans: d

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 35


19)Each Block contains the hash of …………………………….

a)The next block

b)The previous block

c)Of each block

d)Of each fork

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

1.Give some real-world applications of AI.

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.

● 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.

● Social Networking: Different social networking sites such as Facebook, Instagram,


Pinterest, etc., use the AI technology for different purposes such as face

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 36


recognition and friend suggestions, when you upload a photograph on Facebook,
understanding the contextual meaning of an emoji in Instagram, and so on.

● Product recommendations: When we search for a product on Amazon, we get the


recommendation for similar products, and this is because of different ML
algorithms. Similarly, on Netflix, we get personalized recommendations for movies
and web series.

2.Compare AI and machine learning.

Artificial Intelligence Machine Learning

It is a technology that is used to create It is a subset of AI that learns from past


intelligent machines that can mimic data and experiences.
human behavior.

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.

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 37


MCQ

1. Immersive learning-which is/are wrong (check all that applies):


A. is the process of learning with the usage of a simulated or artificial
environment
B. does not necessarily require technology
C. provides a highly interactive environment for users
D. implements gamification in learning
2. Which of the following statements is correct about the Augmented Reality
(AR)?
A. AR creates a replica of the real world.
B. AR makes use of 3D visualizations and simulations in order to provide
an immersive experience.
C. AR is completely an artificial environment created to evoke a sensory
experience.
D. AR mixes virtual reality with real life.
3.What are the tools for immersive learning? (check all that applies)
A. Mixed Reality (MR)
B. Augmented Reality (AR)
C. 3D immersive learning
D. Google Expeditions
4.What is the field of computer science responsible for managing large
amounts of data?
A. Machine Learning
B. Big data
C. Deep learning

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 38


5.What is a chat-bot?
A. A robot to teach babies how to talk.
B. An app that is used to share photos and videos.
C. A computer assisting software used in customer services.
6. The name of the female intelligent robot created by Hanson Robotics
company is
A. Wall-E
B. Sophia
C. Roomba
7.The AI application that transports you into a three-dimensional world is
A. Virtual learning
B. Virtual reality
C. Virtual Intelligence
8.The ability of a computer to understand human language is called
A. NLP
B. Computer Vision
C. Medical Science
9. Human face recognition is considered as
A. NLP
B. Computer Vision
10.The study of algorithms that enable the machine to learn from data and
to make decisions without the help of humans.
A. Machine Learning
B. Artificial Intelligence

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 39


11.What is NOT a characteristic of big data?
A. Volume
B. Variety
C. Vision
D. Velocity

12.What is the true definition of big data


A. huge amount of space
B. large, diverse sets of information
C. unlimited speed data internet connection
D. small, undiverse sets of information

13.Which of the following would NOT use big data analysis?


A. Healthcare companies
B. Public agencies
C. Retail companies
D. High school students doing homework

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

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 40


15.which of the following is true about Big Data
A. is a field that treats ways to analyze, systematically extract information
from, or otherwise deal with data sets that are too large or complex to
be dealt with by traditional data processing application software.
B. include capturing data, data storage, data analysis, search, sharing,
transfer, visualization, querying, updating, information privacy and data
source.
C. described as a large volume of data, both structured and unstructured.
D. All of these
ANSWERS
1.B 2.D 3.All 4.B 5.C 6.B 7.B 8.A 9.B 10.B 11.C 12.B 13.D 14.E 15.D

XI IP TERM-2 STUDENT SUPPORT MATERIAL, KVS ERNAKULAM REGION 41


KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION
SESSION ENDING EXAMINATION 2022
CLASS XI - INFORMATICS PRACTICES (065) – (DESCRIPTIVE) BLUE PRINT
S
KNOWLEDGE UNDERSTANDING REASONING SKILL
L UNITWISE
UNIT SUB TOPIC TOTAL MARKS
N VSA(2) SA(3) VSA(2) SA(3) VSA(2) LA(4) SA(3) LA(4)
O
Database
2(2) 2(4)
Concepts
Structured
Query 2(2) 1(3) 1(4)
Relational 4(11)
Language
1 Databases 30
and SQL
Data Types 1(2) 1(4) 2(6)
Data
Definition 1(3) 1(2) 1(4)
3(9)
Commands
Introduction to
2 Emerging 1(2) 1(3) 5
Trends 2(5)

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.

Field Type Key


empid integer primary key
name varchar(20)
deptid char(5)
salary integer
desig varchar(20)

7. Identify the DDL and DML commands from the following.


CREATE TABLE, INSERT …INTO, DELETE FROM, ALTER TABLE

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.

10. What are the pros and cons of Artificial Intelligence?

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:

(a) To display all department names.


(b) To display department name and floorno of dept id D002.
(c) To display all records of the department in floorno 10.
(d) To display the lowest floorno.
13. Write the output of the queries (a) to (d) based on the table, Furniture 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

KENDRIYA VIDYALAYA SANGATHAN, ERNAKULAM REGION


MARKING SCHEME
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. 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

3. Compare AI and machine learning.


ANSWER

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.

Field Type Key


empid integer primary key
name varchar(20)
deptid char(5)
salary integer
desig varchar(20)

ANSWER
CREATE TABLE employee( empid integer primary key,
name varchar(20),
deptid char(5),
salary integer,
desig varchar(20));

7. Identify the DDL and DML command from the following.


CREATE TABLE, INSERT …INTO, DELETE FROM, ALTER TABLE
Page 4 of 8

ANSWER

DDL: CREATE TABLE, ALTER TABLE


DML: INSERT ...INTO, DELETE FROM

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)

10. What are the pros and cons of Artificial Intelligence?


ANSWER

Pros of Artificial Intelligence (AI)


1. Diminishes Human Error
Humans can make mistakes, but computers, if programmed properly, will not make
those same mistakes.
2. Facilitates Faster Decision-Making
Finding ways to save time by making faster decisions you feel confident in is always
valuable.
3. Offers Continual 24/7 Availability
AI never rests or requires sleep, while the human body and mind need rest to
continue to function at optimal levels.
Cons of Artificial Intelligence (AI)
1. Requires Higher Overall Costs
It’s no secret AI is expensive. The initial set-up alone requires a high investment.
Page 6 of 8

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

(a) To display all department names.


SELECT DEPTNAME FROM DEPARTMENT;
(b) To display department name and floorno of dept id D002.
SELECT DEPTNAME, FLOORNO FROM DEPARTMENT WHERE DEPTID=” D002”;
(c) To display all records of the department in floorno 10.
SELECT * FROM DEPARTMENT WHERE FLORRNO=10;
(d) To display the lowest floorno.
SELECT MIN(FLOORNO) FROM DEPARTMENT;
13. Write the output of the queries (a) to (d) based on the table, Furniture given below:

(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 8 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

5 i) What is NULL value. explain 2


ii) He has written the query as follows.
update table student set mark=78 where name=”p%”;
He didn’t got the query OK message. Help him to correct the query

6 i) Write the difference between candidate key and alternate key 2
ii) Identify the candidate key and alternate key of the given table

ENo ENAME DEPT AGE GRADE

101 ABC 10 15 A

102 PQR 20 16 B

103 LMN 30 17 C

7 Now you can say, “Alexa, play this song,” and a device start playing that music.Which 2
emerging technology is used for implementing sound recognition. Briefly explain.

Section – B
8 Write the sql clause for the following 3
i) to view the structure of a table
ii) to display column details after removing duplication
iii) to add new record to a table
OR
i) Mr. Ram, a database administrator has created a table INVENTORY for storing the
details of a hospital inventory. He forgot to mark the primary key column while
creating the table. Help him to add primary key constraint for the column INV_ID.
ii) Which command is used to delete a relation in RDBMS.
9 i) List the characteristics of Cloud Computing 3
ii) Give an example for Block chain technology.
iii) What is the concept of Big data.

10 Observe the table named “Training” given above carefully and predict the output of the 3
following queries:
Training_Id Name Email_Id Topic City Fee
ND01 Mr. Rajan raj@gmail.com Cyber Security New Delhi 10000
GU01 Ms. Urvashi urv@yahoo.com ICT in Education Gurugram 15000
FD01 Ms. Neena neenarediff.com Cyber Security Faridabad 12000
ND02 Mr. Vinay NULL ICT in Education New Delhi 13000
GU02 Mr. Naveen nav@gmail.com Cyber Security Gurugram NULL
i. select city from training where topic = 'Cyber Security';
ii. select count(Training_Id) from training where email_id like '%gmail% ';
iii. select * from training where Topic = 'Cyber Security' and fees <11000;
iv. select name from training where Fees is NULL;

Section – C
11 Mr. Manav, a database administrator in “Global Educational and Training Institute” has 4
created following table named “Training” for the upcoming training schedule:
Training:
Training_Id Name Email_Id Topic City Fee

ND01 Mr. Rajan raj@gmail.com Cyber Security New Delhi 10000


GU01 Ms. Urvashi urv@yahoo.com ICT in Education Gurugram 15000
FD01 Ms. Neena neenarediff.com Cyber Security Faridabad 12000
ND02 Mr. Vinay NULL ICT in Education New Delhi 13000
GU02 Mr. Naveen nav@gmail.com Cyber Security Gurugram NULL
Help him in writing SQL query for the following purpose:
i. To count how many female candidates will be attending the training.
ii. To display list of free trainings.
iii. To display all the cities where Cyber Security training is scheduled along with its fee.
iv. To display the details in desending order of training_id.
12 Consider the following tables SCHOOL. Write SQL commands for the statements (i) to (iv) 4
Table : SCHOOL
CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE
1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10
1009 PRIYA RAI PHYSICS 03/09/1998 26 12
1203 LISA ANAND ENGLISH 09/04/2000 27 5
1045 YASHRAJ MATHS 24/08/2000 24 15
1123 GANAN PHYSICS 16/07/1999 28 3
1167 HARISH B CHEMISTRY 19/10/1999 27 5
1215 UMESH PHYSICS 11/05/1998 22 16
i) To display TEACHERNAME, PERIODS of all teachers whose periods less than 25.
ii) To display TEACHERNAME, CODE and subject are having experience 10 to 15 years.
iii) To display the details of teachers who are teaching english, physics, maths, chemistry
iv) To display CODE, TEACHERNAME and SUBJECT of all teachers who have joined the
school after 01/01/1999.
OR
Give outputs for SQL queries based upon the table SCHOOL.
i) SELECT SUBJECT FROM SCHOOL WHERE EXPERIENCE<15 AND PERIODS<25;
ii) SELECT TEACHERNAME FROM SCHOOL WHERE subject= ‘ENGLISH’ AND
CODE=1123;
iii) SELECT * FROM SCHOOL WHERE PERIOD<=24 ORDER BY TEACHERNAME
iv) SELECT COUNT (DISTINCT SUBJECT) FROM SCHOOL;
13 Consider the following tabel : Customer 4
id Name Banker name Amount Balance
C001 reva reva 21000 22000
C002 ramesh ajit 10000 25000
i) To add a column feedback with suitable data type.
ii) Add Rs. 1000 to all customers in the Balance field
iii) delete the details of customer with name ramesh
iv) display the details of all customets.
 
KENDRIYA VIDYALYA SANGATHAN, ERNAKULAM REGION
SET II
TERM2 SAMPLE QUESTION PAPER 2021-22 – MARKING SCHEME
CLASS XI : INFORMATICS PRACTICES (PYTHON) (065)
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
Fieldname Datatype 2
Admno int
Stuname Varchar(25)
Class int
Address Varchar(30)
Phoneno int

Admno : Primary key – unique, not null
2 Degree : 5
Cardinality :4 2

3 CREATE TABLE WORKSHOP ( WorkshopId INTEGER PRIMARY KEY, Title


VARCHAR(50), DateWorkshop DATE, Numspeakers INTEGER ); 2
OR
Tables in an RDBMS is known as relations. Referential integrity is implemented by
using the foreign Key
4 char(n):
 stores a fixed length string between 1 and 255 characters 2
 if the value is of smaller length, adds blank spaces
 some space is wasted
varchar(n) :
 stores a variable length string
 no blanks are added even if value is of smaller length
 no wastage of space
5 i) to represent no value, NULL is used in sql
ii) update student set mark=78 where name like ”p%”; 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

11 i. Select count(name) from training where name like ‘Ms.%’;


ii. Select * from training where fee is NULL; 4
iii. Select city, fee from training where topic = ‘Cyber Security’;
iv. Select * frm training order by training_id desc;
12 i) select TEACHERNAME, PERIODS from school where periods <25;
4
ii) select TEACHERNAME, CODE , subject from school where experience between 10
and 15;
iii) select * from school where subject in (‘english’, ‘physics’,’ maths’, ‘chemistry’);
iv) select CODE, TEACHERNAME, SUBJECT from school where DOJ> 01/01/1999.
OR
i) English
ii) Empty set
iii) .

1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10


1215 UMESH PHYSICS 11/05/1998 22 16
1045 YASHRAJ MATHS 24/08/2000 24 15
iv) 4

13 i) alter table customer add feedback varchar(30);
ii) update customer set balance=balance+1000; 4
iii) delete customer where name =’ramesh’;
iv) select * from customer;
 
SAMPLE PAPER SET 3
INFORMATICS PRACTICES (Code: 065)
CLASS: XI
Maximum Marks: 35 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 and 12.

Section –A
Each question carries 2 marks

1 How is NULL value handled in MySQL? Give example. (2)

2 What is the difference between char and varchar datatype. (2)

3 What are the different types of Artificial Intelligence (AI)? (2)


OR
List more than two applications of Artificial Intelligence (AI).

4 Define Table Constrains. List constrains available in MySQL. (2)

5 From the description below, identify the terms: (2)


(a) Number of Columns in a Table.
(b) An attribute that can uniquely identify each row of a data table.

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

8 Write SQL query to CREATE the following table (3)

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);

(iii) SELECT price+5 from softdrink;

10 (a) Describe Internet of Things (IoT) and its advantages. (3)


(b) Explain the use of Cloud Computing

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

Write SQL statements to do the following:

a) Display the names of all the products in the store.


b) Display the names and unit price of all the products in the store in descending order
of name.
c) Display the names of all the products with unit price less than Rs.20000.00 and
having ’Fit’ word in the Manufacturer.
d) Display details of all the products with unit price in the range 20000 to 30000.

12 Write query for the following table (Employee) as instructed. (4)

(attempt either the (a) to (d) set or (i) to (iv) set)

ID First_Name Last_Name User_ID Salary


1 Dim Joseph Jdim 5000
2 Jagannath Mishra jnmishtra 4000
3 Siddharth Mishra smishra 8000
4 Shankar Giri sgiri 7000
5 Gautam Buddha bgautam 2000

(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.

3 Weak AI and Strong AI (2)


OR
In banking, gaming, automobiles social media etc.
4 Constraints are used to specify rules for the data in a table. Constraints are used to limit (2)
the type of data that can go into a table.
NOT NULL, DEFAULT, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK
5 From the description below, identify the terms: (2)
(a) Number of Columns in a Table - DEGREE
(b) An attribute that can uniquely identify each row of a data table – PRIMARY KEY

6 DDL- DATA DEFINITION LANGUAGE – Command to modify the table structure (2)
DML- DATA MANIPULATION LANGUAGE – Command to manipulate data inside the
table

7 Select command (2)


Alter table……..ADD

SECTION – B
Each question carries 3 marks

8 CREATE TABLE student ( (3)


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)

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

(iii) SELECT price+5 from softdrink;

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)

a) Display the names of all the products in the store.


mysql> select PrName from GYM ;
b) Display the names and unit price of all the products in the store in descending order
of name.
mysql> select PrName, UnitPrice from GYM order by PrName desc;
c) Display the names of all the products with unit price less than Rs.20000.00 and
having ’Fit’ word in the Manufacturer.
mysql> select PrName, UnitPrice from GYM where UnitPrice < 20000 and Manufacturer
like ‘%Fit%;
d) Display details of all the products with unit price in the range 20000 to 30000.
mysql> select PrName, UnitPrice from GYM where UnitPrice between 20000 and
30000;

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

You might also like