CLASS_12_IP
CLASS_12_IP
NOIDA
QUESTION BANK
CLASS – XII
SUBJECT – IP
TERM -2
TOPIC: SQL
MCQ
1. Which of the following will give the same answer irrespective of the NULL values in the
specified column:
a. MIN () b. MAX () c. SUM () d. None of the above
2. An aggregate function:
a. Takes a column name as its arguments b. May take an expression as its argument
c. Both (a) and (b) d. None of (a) and (b)
3.HAVING is used in conjunction with
a. WHERE b. GROUP BY clause
c. Aggregate functions d. None of the above
4.In the FROM clause of a SELECT statement
a. Multiple Column Names are specified. b. Multiple table names are specified.
c. Multiple Column Names may be specified. d. Multiple table names may be specified.
5. JOIN in RDBMS refers to
a. Combination of multiple columns b. Combination of multiple rows
c. Combination of multiple tables d. Combination of multiple databases
6. Equi-join is formed by equating
a. Foreign key with Primary key b. Each row with all other rows
c. Primary key with Primary key d. Two tables
7.Referential integrity
a. Must be maintained b. Cannot be maintained
c. Is automatically maintained by databases d. Should not be maintained
8. A Primary key column
a. Can have NULL values b. Can have duplicate values
c. Both (a) and (b) d. Neither (a) nor (b)
9. Primary Key of a table can be
a. Defined at the time of table creation only. b. Defined after table creation only.
c. Can be changed after table creation d. Cannot be changed after table creation
10.Two SELECT commands in a UNION
a. Should select same number of columns. b. Should have different number of columns
c. Both (a) and (b) d. Neither (a) nor (b)
18. Which of the following clause can be used with Group by?
a. Having b. Where c. Order by d. None
19. Choose the correct query to count the number of codes in each code type from travel table?
i. select count(code) from travel;
ii. select code, count(code) from travel group by code;
iii. select code, count (distinct code) from travel;
iv. select code, count (distinct code) from travel group by code;
Choose the correct option:
a. Both (ii) and (iii)
b. Both (ii) and (iv)
c. Both (i) and (iii)
d. Only (ii)
20. Ansh has given the following command to arrange the data in ascending order of date.
Select * from travel where order by tdate;
But he is not getting the desired result. Help him by choosing the correct command.
a. Select * from travel order by tdate;
b. Select * from travel in ascending order;
c. Select tdate from travel order by tdate;
Q1.
Based on the above given table named ‘Student’, Satyam has executed following queries:
Select count (*) from student;
Select count(MARKS) from student;
Predict the output of the above given queries.
Also give proper justifications of the output generated through each query.
a. select FLCODE, START, DESTINATION, NO_FLIGHTS from FLIGHT order by NO_FLIGHTS desc;
b. select FLCODE, START, DESTINATION, NO_FLIGHTS from FLIGHT order by NO_FLIGHTS;
c. select FLCODE, START, DESTINATION, NO_FLIGHTS from FLIGHT group by NO_FLIGHTS desc;
d. select FLCODE, START, DESTINATION, NO_FLIGHTS from FLIGHT;
b.
a.
d.
c.
iii) Ram has given the following command to obtain the unique (list of destinations) destination from
Flight table.
Select count(DESTINATION) from FLIGHT;
but he is not getting the desired result.
Help him by writing the correct command.
a. Select DESTINATION from FLIGHT;
b. Select MAX(DESTINATION) from FLIGHT;
c. Select distinct DESTINATION from FLIGHT;
d. Select SUM(DESTINATION) from FLIGHT ;
iv)State the command to Count and display number of flights reaching at each destination.
a. select FLCODE, DESTINATION, NO_FLIGHTS from FLIGHT order by DESTINATION;
b. select count(FLCODE), DESTINATION, NO_FLIGHTS from FLIGHT
c. select count(FLCODE), DESTINATION, NO_FLIGHTS from FLIGHT group by NO_FLIGHTS;
d. select count(FLCODE),DESTINATION,NO_FLIGHTS from FLIGHT group by DESTINATION;
v) Help Ram to write the command to display the maximum no of stops from FLIGHT table.
a. select max(NO_STOPS) from FLIGHT;
b. select count(NO_STOPS) from FLIGHT;
c. select NO_STOPS from FLIGHT;
1.Write SQL queries using SQL functions to perform the following operations:
a) Convert all the names into lower case.
b) Display the position of occurrence of the string “sh” in Name.
c) Display the four characters from Department starting from second character.
d) Display the month name for the date of admission.
e) Display the name of the weekday for the date of admission.
2.Write the SQL functions which will perform the following operations:
i) To display the day of month of current date.
ii) To remove spaces from the beginning and end of a string, “ Informatics Practices “.
iii) To display the name of the day eg. Friday or Sunday from your date of birth, dob.
iv) To convert your name into Upper case.
v) To compute the mode of two numbers num1 and num2.
NO NAME TDATE KM
Akhil has given the following command to arrange the data in ascending order of date.
but he is not getting the desired result. Help him by choosing the correct command.
a. Select * from travel order by tdate;
b. Select * from travel in ascending order;
c. Select tdate from travel order by tdate;
iii) Choose the correct query to count the number of codes in each code type from travel table?
Questions 2 Marks
1. Why are aggregate functions called so? Name some aggregate functions.
2. What is ALTER TABLE command? Write all the commands that can be applied using alter table.
3. What is the Cartesian product of two table? Is it same as an Equi-join?
4. Does aggregate Functions consider Null values. Does NULLs play any role in actual calculations?
5. What is ‘GROUP BY’ clause?
6. Write command to create given table:
Questions 3 Marks
1. What is Role of HAVING in SQL. Give Examples. How it is related with Group by.
2. What are Constraints for a table? List all the constraints with their purpose. How these are applied?
3. What is PRIMARY KEY? Give Examples.
4. Explain all the working of functions truncate () and round () with example.
5. There is a column Salary in a Table EMPLOYEE. The following two statements are giving different
outputs.
What may be the possible reason?
SELECT COUNT (*) FROM EMPLOYEE;
SELECT C0UNT(Salary) FROM EMPLOYEE;
6. Differentiate between the following statements:
i) ALTER and UPDATE
ii) DELETE and DROP
7. What is the purpose of the following clauses in a select statement with example?
i) ORDER BY
ii) GROUP BY
8. Write the output produced by the following SQL statements:
a) SELECT POW (2,3);
b) SELECT ROUND (342.9234, -1);
c) SELECT LENGTH ("Informatics Practices");
Questions 4 Marks
Q1. Write the output of the following SQL queries:
a. SELECT RIGHT (“software‟, 2);
b. SELECT INSTR (“TWELVE‟, LV);
c. SELECT DAYOFMONTH (“2014-03-01‟);
d. SELECT ROUND (76.987,2);
e. SELECT CONCAT (CONCAT(‘INFORM’,’ATICS’), ‘PRACTICES’);
Q2. Write the output of the following SQL queries:
a. SELECT MOD (23,2);
b. SELECT MID (‘HONESTY WINS’,3,4);
c. SELECT RIGHT(CONCAT(‘PRACTICES’,’INFORMATICS’),5);
d. SELECT MONTHNAME (‘2015-01-16’);
e. SELECT INSTR (“INTERNATIONAL”, “NA”);
f. SELECT LENGTH (CONCAT (“NETWORK”,” ING”));
g. SELECT ROUND (563.345, -2);
h. SELECT DAYOFYEAR (“2014-01-30”);
i. SELECT SUBSTR ('123456789', INSTR ('abcabcabc', 'b'), 4) FROM DUAL;
j. SELECT SUBSTR ('abcdefghij', 6, 2) FROM DUAL;
k. SELECT ROUND (45.926, -1) FROM DUAL;
l. SELECT LENGTH (CONCAT (“NETWORK”,” NULL”))
m. SELECT POW (ROUND (2.34),2);
n. SELECT MID (CONCAT (RIGHT (“GOOD MORNING”,4), LEFT (“GOOD MORNING”,4)),2)
o. SELECT DAY ('2019-10-14')
Q3. Write the output of following queries:
Q6
i) List business done by the movies showing only MovieID, MovieName and Total_Earning.
Total_Earning to be calculated as the sum of ProductionCost and Business Cost.
ii) List the different categories of movies.
iii) Find the net profit of each movie showing its MovieID, MovieName and NetProfit. Net Profit is to
be calculated as the difference between Business Cost and Production Cost.
iv) List MovieID, MovieName and Cost for all movies with ProductionCost greater than 10,000 and
less than 1,00,000.
v) List details of all movies which fall in the category of comedy or action.
Q7. Suppose your school management has decided to conduct cricket matches between students of Class
XI and Class XII. Students of each class are asked to join any one of the four teams – Team Titan,
Team Rockers, Team Magnet and Team Hurricane. During summer vacations, various matches will
be conducted between these teams. Help your sports teacher to do the following:
a) Create a database “Sports”.
b) Create a table “TEAM” with following considerations:
i) It should have a column TeamID for storing an integer value between 1 to 9, which refers to
unique identification of a team.
ii) Each TeamID should have its associated name (TeamName), which should be a string of
length not less than 10 characters.
c) Using table level constraint, make TeamID as the primary key.
d) Show the structure of the table TEAM using a SQL statement.
e) As per the preferences of the students four teams were formed as given below. Insert these
four rows in
TEAM table:
Row 1: (1, Team Titan)
Row 2: (2, Team Rockers)
Row 3: (3, Team Magnet)
Row 4: (4, Team Hurricane)
Q8.
PNA NAME DOB DOJ GNDR LANG PRJCATG PRJSTATUS PROF1 PROF2 SAL
Q12. Consider the Registration Table given below and write SQL Commands for Questions that
follow:
RegsID RName City TestSeries Level Dt_exam ISP Board SCORE RFee
R0001 Poonam Faridabad Physics II 12-03-2020 I-AXN CBSE 56 500
R0002 Deeksha Palwal Maths I 10-03-2020 JIO ICSE 34 450
R0003 Sudeep Faridabad Chemistry II 13-04-2020 AIRTEL CBSE 450
R0004 Vishal Faridabad English II 10-04-2020 BSNL CAMBRIDGE 23 250
R0005 Parul Palwal Maths II 10-01-2020 BSNL CBSE 6 450
R0006 Ranju Ballabgar Physics I 13-02-2020 AIRTEL CBSE 34 500
h
R0007 Seema Faridabad Maths I 12-04-2020 JIO ICSE 450
R0008 Ankush Palwal English II 10-03-2020 BSNL STATE 13 250
R0009 Gaurav Faridabad Maths I 15-04-2020 JIO STATE 450
R0010 Pradeep Faridabad Maths II 10-02-2020 AIRTEL ICSE 65 450
R0011 Saumya Ballabgar Maths I 15-02-2020 AIRTEL ICSE 32 450
h
R0012 Vaibhav Faridabad Physics II 10-01-2020 JIO CAMBRIDGE 29 500
a. Display how many students from different Boards have registered for Test.
b. Display highest marks scored for every TestSeries.
c. Display Average score up to one decimal place for every city.
d. Display the city having more than 3 registrations.
e. Display the number of registration for different TestSeries in all the Boards.
f. Display how many exams were / are to be conducted on different dates.
g. Display number of users from each ISP.
h. Display from each city what is the total RegistrationFee collected.
i. Display the city from where less than 2 people have registered for Math’s test.
j. Display how many students from each city have registered for different Topics
k. Display ISP for which there are more than 5 users.
Q. Give output:
a. select sum(rfee), testSeries from registration group by testseries;
b. select count (*), city from registration for different cities in which exam is in March;
c. select count (*) from registration where board = ‘CAMBRIDGE’;
6. Samhita says that the following numbers indicate an address: 208.77.188.166 What is the above
address called?
a. MAC address b. IP Address c. both
7. ……………… is a wireless technology for creating personal networks operating within a range of 10
meters.
a. Bluetooth b. radio waves c. microwaves
8. Identify the type of Topology from the following: If each node is connected with the help of
independent cable with the help of a central switching (communication controller).
a. Ring b. star c. bus
9. A computer network:
i. Is a collection of hardware components and computers?
ii. Is interconnected by communication channels
iii. Allows sharing of resources and information
iv. All of the above
10. What is a firewall in computer network?
i. The physical boundary of network
ii. An operating system of computer network
iii. A system designed to prevent unauthorized access
iv. A web browsing software
11. What is the use of Bridge in the network?
i. To connect LANs (iii) To separate LANs
ii. To control network speed (iv) All of the above
12. Each IP packet must contain:
i. Only Source address (ii) Only Destination address
ii. Source and Destination address (iv) Source or Destination address
13. Which of these is not a communication channel?
i. Satellite (ii) Microwave iii) Radio wave (iv) Wi-Fi
14. MAN Stands for .....................
i. Metropolitan Area Network (ii) Main Area Network
ii. Metropolitan Access Network (iv) Metro Access NetworBluetooth
15. Which protocol is used for the transfer of hypertext content over the web
i. HTML (ii) HTTP (iii) TCP/IP (iv) FTP
16. Which amongst the following is the first page we normally view on a Website?
a. Home Page b. Master Page c. First Page d. Banner Page
17. Which type of transmission media is the least expensive to manufacture?
a. Coaxial b. Twisted pair c.CAT6 d. fibre optics
18. Write the expanded name of the following:
a. HTTP b. OSS c.URL d. FLOSS
19. The first page that you normally view at a web site is its:
a. Home page b. First page c. Start page d. Master page
20. A computer __________is a malicious code which self-replicates by copying itself to other
program.
a. program b. virus c. application d. worm
21. Central computer which is powerful that other computers in the network is called as_____
a. client b. server c. hub d. switch
22. Internet is an example of ______topology.
a. star b. bus c. mesh d. ring
23. It is self-replicating program that eats up all the memory/space.
a. virus b. worms c. Trojan horse d. phishing
24. Which of the following is not a Geographically type of network?
a. LAN b. MAN c. PAN d. TAN
25. The network topology in which each node is connected independently using a switch is
a. Bus b. Ring c. Star d. Mesh
(iv) The organization also has enquiry office in another city about 50-60 km away in hilly region.
Suggest the suitable transmission media to inter-connect school and enquiry office out of the following:
Fibre optic cable.
Micro wave.
Radio wave.
A. Infrared B. Microwave C. Satellite.
Switch
Modem
Gateway
In Villages, there are community centres, in which one room has been given as training centre to
this organization to install computers
The organization has get financial support from the government and top IT companies.
(i) Suggest the most appropriate locations of the SEVER in the B_HUB out of 4 locations, to get the
best and effective connectivity. Justify your answer.
(ii) Suggest the best wired medium and draw the cable various locations with the B_HUB
(iii) Which hardware device will you suggest to connect all the computers within exact location of
B_HUB
(iv) Which service/protocol will be most helpful to conduct live interactions of experts from
Head Office and people at all location of B_HUB?
Q6. Hi Standard Tech Training Ltd. is a Mumbai based organisation which is expanding its office set-up to
Chennai. At Chennai office compound, they are planning to have 3 different blocks for Admin, Training
and Accounts related activities. Each block has a number of computers, which are required to be connected
in a network for communication, data and resource sharing.
As a network consultant, you have to suggest the best network related solutions for them for
issues/problems raised by them in (i) to (iv), as per the distances between various blocks/locations and
other given parameters
a. Suggest the most appropriate block/location to house the SERVER in the CHENNAI office (out of
the 3 blocks) to get the best and effective connectivity. Justify your answer.
b. Suggest the best wired medium and draw the cable layout (Block to Block) to efficiently connect
various blocks within the CHENNAI office compound.
c. Suggest a device/software and its placement that would provide data security for the entire network
of the CHENNAI office.
d. Suggest a device and the protocol that shall be needed to provide wireless Internet access to all
smartphone/laptop users in the CHENNAI office.
Q7. Uplifting Skills Hub India is a knowledge and skill community which has an aim to uplift the standard
of knowledge and skills in the society. It is planning to set-up its training canters in multiple towns and
villages pan India with its head offices in the nearest cities. They have created a model of their network
with a city, a town and 3 villages as follows. As a network consultant, you have to suggest the best network
related solutions for their issues/problems raised in (i) to (iv) keeping in mind the distances between
various locations and other given parameters.
NOTE : In Villages, there are community centres, in which one room has been given as training centre to
this organisation to install computers.
The organisation has got financial support from the government and top IT companies.
a. Suggest the most appropriate location of the SERVER in the B_HUB (out of the 4 locations), to get
the best and effective connectivity. Justify your answer.
b. Suggest the best wired medium and draw the cable layout (location to location) to efficiently
connect various location within the B_HUB.
c. Which hardware device will you suggest to connect all the computers within each location of
B_HUB?
d. Which service/protocol will be most helpful to conduct live interactions of Experts from Head
Office and people at all locations of B_HUB?
Q8. Perfect Edu Services Ltd. is an educational organisation. It is planning to set-up its India campus at
Chennai-with its head office at Delhi. The Chennai campus has 4 main buildings - ADMIN,
ENGINEERING, BUSINESS and MEDIA.
You as a network expert have to suggest the best network related solutions for their problems raised in
(i) to (iv), keeping in mind the distance between the buildings and other given parameters.
a. Suggest the most appropriate location of the server inside the CHENNAI campus (out of the 4
buildings), to get the best connectivity for maximum number of computers. Justify your answer.
b. Suggest and draw the cable layout to efficiently connect various buildings within the CHENNAI
campus for connecting the computers.
c. Name the building where Modem should be installed.
d. Which hardware device will you suggest to be procured by the company to be installed to protect
and control the Internet uses within the campus?
e. Identify where the repeaters and routers must be installed.
f. Which of the following will you suggest to establish the online face-to-face communication
between the people in the Admin Office of CHENNAI campus and DELHI Head Office?
(a) Cable TV
(b) E-mail
(c) Video Conferencing
(d) Text Chat
Q9. Multipurpose Public School, Bengaluru is Setting up the network between its Different Wings of
school campus. There are 4 wings named as SENIOR(S), JUNIOR (J), ADMIN(A)and HOSTEL(H).
Multipurpose Public School, Bengaluru
a) Suggest the best wired b) Suggest a device/software and its placement that
medium and draw the would provide data security for the entire network
cable layout to of the School.
efficiently connect c) Name the most suitable wing where the Servers
various wings of should be installed. Justify your answer.
Multipurpose Public d) Suggest a device and the protocol that shall be
School, Bangaluru. needed to provide wireless Internet access to all
smartphone/laptop users in the campus of
Multipurpose Public School, Bengaluru
3. Assertion (A): IP address of a computer is a Logical address of a computer that consists of 4-digit
hexadecimal numbers which uniquely identifies a computer connected to a network.
Reason (R): It is assigned by the manufacturer.
A. Both A and R are true and R is the correct explanation of A
B. Both A and R are true but R is not the correct explanation of A
C. A is true but R is false
D. A is false but R is true
E. Both A and R are false
4. Assertion (A): A Web browser is a software which is used for displaying the content on web pages.
Reason (R): It is used by the client to view websites.
A. Both A and R are true and R is the correct explanation of A
B. Both A and R are true but R is not the correct explanation of A
C. A is true but R is false
D. A is false but R is true
E. Both A and R are false
5.Assertion (A): Cookies are the easiest way to carry information from one session on a website to
another or between sessions on related websites.
Reason (R): Cookies are harmful.
A. Both A and R are true and R is the correct explanation of A
B. Both A and R are true but R is not the correct explanation of A
C. A is true but R is false
D. A is false but R is true
E. Both A and R are false
Q9. Seema thinks firewall is used to protect from fire, but Sudhir told her firewall is used to secure a
private network from a public network. Whether Sudhir is giving correct definition of firewall or not?
(i) Computer Virus (ii) Spam Mail (iii) Computer Bacteria (iv) Trojan Horse
Q7. A Say, “In this network topology, on malfunctioning node does not affect that rest of the network
and it is easy to add and remove nodes”. B Say “In this network topology, cable length required is
less but if the main cable encounters some problem, whole network breaks down. Name the
topologies A and B are talking about
Q8. PACK N PICK is a food supply company with kitchen and market unit 110 meters away from each
other. The company recently connected their networks using UTP cable to share the stock related
information. But after joining their networks, they are not able to share the information due to loss of signal
in between. Which device is to be installed for a smooth communication?
Q9. Identify the type of Topology from the following:
a) If each node is connected with the help of independent cable with the help of a central switching
(communication controller).
b) If each node is connected with the help of a single co-axial cable.
Q10. A University would like to go in for networking of all the computers. Which topology would you
recommend and why?
Q11. Lalit is transferring songs from his mobile to his friend’s mobile via Bluetooth connection. Name
the network used by Lalit.
Q12. Which protocol is used for transfer of hypertext documents on the internet?
Q13. Ram wants to transfer hypertext documents on the Internet. Which protocol must be used for the
same?
Q14. Arrange the following communication channels in the ascending order of their data transfer rate.
i) Optical Fiber (ii) Coaxial cable (iii) UTP cable
Q15.Write two advantage and two disadvantages of Coaxial Cables, Twisted Pair Cables, Fiber Optics.
Q16 What is meant by transmission media? Give two examples of guided media and two examples of
unguided media.
Q17. Why switch is called intelligent hub?