Cs 083 Hp 2 Mat Cs Final (1)
Cs 083 Hp 2 Mat Cs Final (1)
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 7 Very Short Answer type questions carrying 02 marks each.
5. Section C has 5 Short Answer type questions carrying 3 marks each.
6. Section D has 2 questions carrying 04 marks each.
7. Section E has 3 question carrying 05 marks each.
19) Suresh, a Class X student, has just started understanding the basics of Internet and web
technologies. He is bit confused in between the terms “World Wide Web ‘and ‘Internet’. Help
him in understanding both the terms with the help of suitable examples of each.
20) Neeta is a bit confused between the term URL and Domain Name. Help him in understanding
both the terms with the help of suitable explanation using an example.
23) What is the difference between where clause and having clause?
24) Write two differences between Coaxial and Fiber transmission media.
26) a) Explain the use of ‘Primary Key’ in a Relational Database Management System. Give
example to support your answer.
b) Write the full forms of the following: (i) VoIP (ii) TCP/IP.
c) If we want to access remote computer than which command should be used in networking?
(a)Identify the most appropriate column, which can be considered as Primary key.
(b) If 3 columns are added and 2 rows are deleted from the table result, what will be
the new degree and cardinality of the above table?
(c) Write the statements to:
(i) Delete a record which has C_ID as C24
(ii) Increase the Fee of all by 500.
28) Write the outputs of the SQL queries (i) to (iii) based on the table Emp:
(a) Select ename, salary from emp where name like ‘_r%’
(b) Select count(salary) from emp where joindate>’2019-11-28’
(c) Select max(joindate), min(joindate) from emp
-Roll no
-Name
-Marks
User =‘python’
Password=’test’
database=student
The code given below calculates the sum of marks of all students. Fill in the blanks:
import mysql.connector
con=_____________________.connect(host=’localhost’, user=’python’,
password=’test’, database=’student’) # statement 1
cur1=con.cursor()
cur1.____________(“select * from class”) # statement 2
total=0
for x in __________: # statement 3
total=total+int(x[2])
print(“total marks of all students :- “, total)
cur1.close()
31) Write the output of the queries (i) to (iv) based on the table, COURSE given below:
32)
(a) Consider the following tables – Employee and Office:
What will be the output of the following statement?
(b) Write the output of the queries (i) to (iv) based on the table Flights given below:
a. Identify candidate key of the Game table, if any. Justify your answer.
b. How many rows will be in output if a query is executed using DISTINCT clause in field
captain?
c. i. Which command will display the structure of GAME table?
ii. Write a sql query that will delete the record of captain Dhoni in outside location.
d. i. Write sql query to remove the column draw.
ii. Write sql query that change number of player for the game kabaddi to 6.
34) Write SQL commands for (i) to (vi) on the basis of table STUDENT:
(i) List the name of all the students, who have taken stream as science.
(ii) To count the number of female students.
(iii) To display the number of students, stream wise.
(iv) To display all the records in sorted order of name.
(v) To display the stream of student whose name start from ‘s’.
(vi) To display the name and fees of students whose fees range from 3000 to 4000(both
values of fees included).
35) Star Info Solution is a professional consultancy company. The company is planning to set up
their new offices in India with its hub at Jaipur. As a network adviser, you have to understand
their requirement and suggest them the best available solutions. Their queries are mentioned as (i)
to (iv) below. Physical Locations of the blocked of Company
(a) What will be the most appropriate block, where company should plan to install their server?
(b) Draw a block to cable layout to connect all the buildings in the most appropriate manner for
efficient communication.
(c) What will be the best possible connectivity out of the following, you will suggest connecting
the new setup of offices in Bangalore with its London based office: o Satellite Link
i. Infrared ii. Ethernet Cable
(d) Which of the following device will be suggested by you to connect each computer in each of
the buildings?
i. Switch ii. Modem iii. Gateway
(e) Which protocol will be used to transfer files over this network?
ANSWER KEY
SECTION A
1) Which switching technique follows the store and forward mechanism?
(a) Message (b) Circuit (c) Packet (d) All of these
2) Who invented the World Wide Web (WWW) in 1989?
(a) Robert E Kahn (b) Linus Torvalds (c) Tim Berners-Lee (d) Ted Nelson
3) A device that connects networks with different protocols –
(a) Switch (b) Hub (c) Gateway (d) Proxy Server
4) Which of the following networking devices forwards data packets between computer networks?
(a) Router (b) Gateway (c) Switch (d) Hub
5) A relation can have only one ________ key and may have more than one _______ keys.
(a) Primary, Candidate (b) Candidate, Alternate
(c) Candidate, Primary (d) Alternate, Candidate
6) The vertical subset of a table is known as:
(a) Tuple (b) Row (c) Attribute (d) Relation
7) A field or a combination of fields in a table that has a unique value for each row is called:
(a) Candidate key. (b) Foreign key. (c) Main key. (d) Alternate key.
8) How do you select all the columns from a table named "Employee"?
(a). SELECT [all] FROM Employee; (b). SELECT Employee;
(c). SELECT * BY Employee; (d). SELECT * FROM Employee ;
9) Which clause will display NULL values in output?
(a). NULL (b). IS NULL (c). IS NOT NULL (d). NULL IS
10) Which multiple row method will give output except 0 for string data type?
(a). AVG() (b). COUNT() (c). MIN() (d). SUM()
11) 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
12) Which method of cursor class is used to fetch limited rows from the table?
(a) cursor.fetchsize(SIZE) (b) cursor.fetchmany(SIZE)
(c) cursor.fetchall(SIZE) (d) cursor.fetchonly(SIZE)
13) Which method of cursor class is used to insert or update multiple rows using a single Query?
(a) cursor.executeall(query,rows) (b) cursor.execute(query,rows)
(c) cursor.executemultiple(query,rows) (d) cursor.executemany(query,rows)
14) Which method of cursor class is used to get the number of rows affected after any of the
Insert/update/delete database operation executed from Python?
(a) cursor.rowcount (b) cursor.getaffectedcount
(c) cursor.rowscount (d) cursor.rcount
15) Which of the following is invalid method for fetching the records from database within
Python?
(a) fetchone() (b) fetchmany() (c) fetchall() (d) fetchmulti()
16) Which of the following method reflects the changes made in database permanently?
(a) <connection>.done() (b) <connection>.final()
(c) <connection>.reflect() (d) <connection>.commit()
17) To get all the records from the result set, we may use____________.
(a) cursor.fetch(SIZE) (b) cursor.fetchmany()
(c) cursor.fetchall() (d) cursor.fetchone()
18) How would you display all those rows from a table named "Trends" where value of the column "Hobbies" is
"marketing" ?
(a). SELECT ALL FROM Friends WHERE Hobbies IS 'marketing';
(b). SELECT * FROM Friends WHERE Hobbies='marketing';
(c). SELECT * FROM Friends WHERE Hobbies = 'marketing" ;
(d). SELECT ALL FROM Friends WHERE Hobbies 'marketing' ;
SECTION B
19)Ans: World Wide Web is a set of programs, standards and protocols that allows the multimedia and hypertext files to be
created, displayed and linked on the Internet.
Eg: www.microsoft.com, www.amazon.com etc.
Internet is a computer-based worldwide communications network, which is composed of large number of smaller
interconnected networks.
Eg: Web, E-mails, Social media etc.
While internet is a collection of computers or networking devices connected together; WWW is a collection of
documents, linked via special links called hyperlinks. WWW forms a large part of Internet but is not the Internet.
20)
21)
DDL: - Data Definition Language (DDL) provides commands for defining relation schemas, deleting relations,
creating indexes, and modifying relation schemas. For example: CREATE,
ALTER, DROP etc…
DML: - Data Manipulation Language (DML) includes commands for manipulating tuples in databases. For
example: Insert, Delete, Update commands etc…
22)
What is the use of LIKE operator in SQL?
Like operator is used for matching patterns of character values on specific attributes and filter out the tuples on the
basis of the given patterns. It uses two wildcard characters % and _ (Underscore) for specifying patterns.
23)
24)
25)
Sender, Receiver, transmission media, protocol, message
SECTION C
26)
(a)Primary Key gives unique row values from given relation MARKS-1 Each
and as constraint it removed delicacy of data as input.
. (b)Full Form: VoIP:- Voice over internet protocol MARKS-1/2 Each
TCP/IP :- Transmission control Protocol/Internet protocol.
(c) TELNET Command MARKS-1
27)
(a) C_ID
(b) degree =7 and cardinality=4
(c) (i) DELETE FROM COMPANY WHERE C_ID= C24;
(ii) UPDATE COMPANY SET Fees=Fees+500;
28)
29)
Mysql.connector #statement 1
cur1.execute # statement 2
rec # statement 3
30)
SECTION D
31)
32)
SECTION E
33)
35)