0% found this document useful (0 votes)
84 views17 pages

12 Computer Science SP 06 With Solution

claas 12 cs file

Uploaded by

advit.amit123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views17 pages

12 Computer Science SP 06 With Solution

claas 12 cs file

Uploaded by

advit.amit123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Class 12 - Computer Science

Sample Paper - 06 (2023-24)

Maximum Marks: 70
Time Allowed: : 3 hours

General Instructions:

Please check this question paper contains 35 questions.


The paper is divided into 4 Sections- A, B, C, D and E.
Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
All programming questions are to be answered using Python Language only.

Section A
1. State true or false:
The max() and min() when used with tuples, can work if elements of the tuple are all of the same types.
a) True
b) False
2. Which of the following is an advantage of SQL?
a) Client/server language
b) High speed
c) All of these
d) Easy to learn
3. l1 = [1,2,3,4,5]
l1.append([5,6,[7,8,[9,10])
What will be the final length of l1?
a) 10
b) 5
c) 8
d) Error
4. Which of the following four code fragments will yield following output?
Eina
Nina
Dika
Select all of the function calls that result in this output
a) print(''' Eina
\nNina
\nDika''')
b) print('''EinaNinaDika''')
c) print('Eina
Nina
Dika')
d) print('Eina\nNina\nDika')
5. The checksum of 0000 and 0000 is .
a) 1110
b) 0111
c) 1111
d) 0000
6. Which of the following functions do you use to write data in the binary format?
a) write( )
b) output( )
c) dump( )
d) send( )
7. >>> m = [[x, x*2, x*3] for x in range (3,6)]
a) Error
b) [3,6,9,[4,8,12,[5,10,15]]]
c) [[3,6,9],[4,8,12],[5,10,15]]
d) [3,6,9,4,8,12,5,10,15]
8. Which clause is used with "aggregate functions"?
a) GROUP BY
b) WHERE
c) SELECT
d) Both GROUP BY and WHERE
9. For readline(), a line is terminated by
a) None of these
b) '\n'
c) EOF
d) Either '\n' or EOF
10. Non-void functions are also known as
a) Invalid functions
b) Valid functions
c) Fruitful functions
d) Non functions
11. Which of the following can delete an element from a list if the index of the element is given?
a) del
b) remove()
c) pop()
d) all of these
12. Which of the following items are present in the function header?
a) return value
b) parameter list only
c) both function name and parameter list
d) function name only
13. State true or false:
A client is the computer that asks for the action in a network.
a) True
b) False
14. What is the output of the following program :
print Hello World [:: -1]
a) Hello World
b) drW olH
c) dlroW olleH
d) HloWrd
15. Fill in the blanks:
To refer to a set of values needed for a condition, we can use the SQL operator .
16. Which of the following is a client-side scripting language?
a) Perl
b) PHP
c) VB Script
d) Ruby
17. Assertion (A): The code of the other programming language can't use in the Python source code.
Reason (R): In Python, we don't need to specify the data-type of the variable.
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.
18. Assertion (A): pandas is defined as an open-source library that is built on top of the NumPy library.
Reason (R): pandas provides fast analysis, data cleaning, and preparation of the data for the user.
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.
Section B
19. Answer:
1. i. What is frequency modulation?
ii. What is burst error?
2. OR
i. Explain any two switching techniques used in networking.
20. Write Python code to delete all the records from the Employee table whose age >60 the table has following fields.
Empid, EmpName, Deptid, age, Payscale
21. Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code.
Value = 30
for VAL in range(0,Value)
If val % 4 == 0:
print (VAL * 4)
Elseif val % 5 == 0:
print (VAL + 3)
else
print(VAL + 10)

OR
Construct logical expressions to represent the following conditions.
i. Weight is greater than or equal to 115 but less than 125.
ii. Donation is in the range of 4000-5000 or Guest is 1.
22. Answer:
1. Write a checklist before connecting to a database?
2. How is a database connection established?
23. What would be the output of following code?
ntpl = ("Hello", "Nita" , "How's", "life ?")
(a, b, c, d) = ntpl
print("a is:", a)
print("b is:", b)
print("c is:", c)
print("d is:", d)
ntpl= (a, b, c, d)
print(ntpl[0][0]+ntpl[1][1], ntpl[1])

OR

What is the output of below questions?


l1 = [23, 45, 19, 77, 10, 22]
i. l1. sort ( )
ii. max(l1)
24. What is the difference between readline() and readlines() function?

OR

Write a program to read the content of "percentage.txt" file. The "percentage.txt" file contains Id, Name and Percentage
fields. Assume that first field of the student status (between Id and Name) is separated with a comma(,).
25. What output will be generate when the following Python code is executed:

def ChangeList():
l = []
l1 = []
l2 = []
for i in range(1,10):
l.append(i)
for i in range(10,1,-2):
l1.append(i)
for i in range(len(l1)):
l2.append(l1[i]+l[i])
l2.append(len(l)-len(l1)
print(l2)
ChangeList()

Section C
26. Answer:
1. What is the output of the following?
i=4
while True:
if i% 0o8 == 0:
break
print(i, end = ' ')
i += 1
2. Which string built-in methods are used in following conditions?
i. Returns the length of the string.
ii. Removes all leading whitespace in string.
iii. Returns the minimum alphabetical character from the string.
27. Write a function that takes a number n and then returns a randomly generated number having exactly n digits (not
starting with zero) e.g., if n is 2 then the function can randomly return a number 10-99 but 07, 02, etc., are not valid two-
digit numbers.
28. Differentiate between char(n) and varchar(n) data types with respect to databases.

OR

Write the output of the queries (i) to (iv) based on the table FURNITURE given below.
Table : FURNITURE
FID NAME DATEOFPURCH ASE COST DISCOUNT

B001 Double Bed 03-JAN-2018 45000 10


T010 Dinning Table 10-MAR-2020 51000 5

B004 Single Bed 19-JUL-2021 22000 0


C003 Long back Chair 30-DEC-2016 12000 3

T006 Console Table 17-NOV-2019 15000 12


B006 Bunk bed 01-JAN-2021 28000 14
i. SELECT SUM(DISCOUNT) FROM FURNITURE
WHERE COST>15000;
ii. SELECT MAX(DATEOFPURCHASE) FROM
FURNITURE;
iii. SELECT * FROM FURNITURE WHERE
DISCOUNTS AND FID LIKE "T%";
iv. SELECT DATE OF PURCHASE FROM FURNITURE
WHERE NAME IN ("Dinning Table", "Console Table");
29. A file sports.dat contains information in following formal Event Participant.
Write a function that would read contents from file sports.dat and creates a file named Atheletic. dat copying only those
records from sports.dat where the event name is "Athletics".
30. Trace the flow of execution for following programs:
i. 1 def power(b., p):
2 r = b ** p
3 return r
4
5 def cpower(a):
6 a=a+2
7 a = power(a, 0.5)
8 return a
9
10 n = 5
11 result = cpower(n)
12 print (result)
ii. 1. def increment(x)
2. x=x+1
3.
4. # main program
5. x = 3
6. print(x)
7. increment(x)
8. print(x)
iii. 1. def increment(x):
2. z = 45
3. x=x+1
4. return x
5.
6. # main
7. y = 3
8. print(y)
9. y = increment(y)
10. print(y)
11. q = 77
12. print(q)
13. increment(q)
14. print(q)
15. print(x)
16. print(z)
Section D
31. 31.
Based on the below-given code, Write answers to the following questions i to v. course_dict= {'BSC':8000,
'MSC':12000, 'BCA':15000, 'PGDCA':9000, 'MCA':30000, 'MBA:50000,}
STACK = [ ]
def NEWDATA ( ):
course = input ('Enter course name :')
free = int (input (Enter fee'))
# statement 1
print ('Data saved successfully')
print (course_dict)
def PUSH ( ):
for key in course_dict:
if = = 0: Statement 4
print (' STACK EMPTY, No course with fee > 100000')
else:
print ('course fee more then 10000')
for top in range (len (STACK), 0, -1):
print ( ) # statement 5
NEWDATA( )
PUSH( )
POP( )
Consider a dictionary with keys as course name and fee as value. Write a program to push course name in stack where
fee is more than 10000. Pop and display contents of stack on the screen
i) Write a code to add the fee and course name to course_dict.
ii) Complete the code to compare the fee of the given key(course).
iii) Write a code to insert the element in the Stack.
iv) Write a code to find the length of the Stack.
32. Consider the following tables STUDENT and STREAM. Write SQL commands for the statements (i) to (v).

TABLE: STUDENT

SCODE NAME AGE STRODE POINTS GRADE


101 Amit 16 1 6 NULL
102 Arjun 13 3 4 NULL
103 Zaheer 14 2 1 NULL

105 Gagan 15 5 2 NULL


108 Kumar 13 6 8 NULL

109 Rajesh 17 5 8 NULL


110 Naveen 13 3 9 NULL

113 Ajay 16 2 3 NULL


115 Kapil 14 3 2 NULL

120 Gurdeep 15 2 6 NULL

TABLE: STREAM

STRCDE STRNAME
1 SCIENCE+COMP

2 SCIENCE+BIO
3 SCIENCE+ECO

4 COMMERCE+MATHS
5 COMMERCE+SOCIO

6 ARTS+MATHS
7 ARTS+SOCIO
i. To display the name of streams in alphabetical order from table STREAM.
ii. To display the number of students whose POINTS are more than 5.
iii. To update GRADE to ‘A’ for all those students, who are getting more than 8 as POINTS.
iv. ARTS+MATHS stream is no more available. Make necessary change in table STREAM.
v. To display student’s name whose stream name is science and computer.
Section E
33. China Middleton Fashion is planning to expand their network in India, starting with two cities in India of provide
infrastructure for distribution of their product. The company has planned to set up their main office units in Chennai at
the different locations and has named their offices as Production Unit, Finance Unit and Media Unit. The company has
its Corporate Unit in Delhi. A rough layout of the same is as follows:

Approximate distance between these units are as follows:

From To Distance
Production Unit Finance Unit 70 m
Production Unit Media Unit 15 km
Production Unit Corporate Unit 2112 km

Finance Unit Media Unit 15 km

In continuation of the above, the company experts have planned to install the following number of computers in
each of their office units

Production Unit 150

Finance Unit 35
Media Unit 10

Corporate Unit 30
i. Suggest the kind of network required (out of LAN, MAN, WAN) for connecting each of the following office units:
Production Unit and Media Unit
Production Unit and Finance Unit.
ii. Which one of the following device will you suggest for connecting all the computers within each of their office
units?
Switch/Hub
Modem
Telephone
iii. Which of the following communication media, will you suggest to be procured by the company for connecting their
local office units in Chennai for very effective (high speed) communication?
Telephone cable
Optical fiber
Ethernet cable
iv. Suggest a cable/wiring layout for connecting the company's local office units located in Chennai. Also, suggest an
effective method/technology for connecting the company's office unit located in Delhi.
v. Suggest the most suitable place to install the server with reason.
34. Consider the following tables CABHUB and CUSTOMER and answer (b) and (c) parts of this question:

Table: CABHUB

Vcode VehicleName Make Colour Capacity Charges

100 Innova Toyota WHITE 7 15


102 SX4 Suzuki BLUE 4 14

104 C Class Mercedes RED 4 35


105 A-Star Suzuki WHITE 3 14

108 Indigo Tata SILVER 3 12

Table: CUSTOMER

Ccode Cname Vcode


1 Hemant Sahu 101
2 Raj Lai 108
3 Feroza Shah 105

4 Ketan Dhal 104


a. Give a suitable example of a table with sample data and illustrate Primary and alternate Keys in it.
b. Write SQL commands for the following statements:
i. To display the names of all the white-colored vehicles.
ii. To display the name of vehicle name and the capacity of vehicles in ascending order of their sitting capacity.
iii. To display the highest charges at which a vehicle can be hired from CABHUB.
iv. To display the customer name and the corresponding name of the vehicle hired by them.
c. Give the output of the following SQL queries:
i. SELECT COUNT (DISTINCT Make) FROM CABHUB;
ii. SELECT MAX(Charges), MIN(Charges) FROM CABHUB;
iii. SELECT COUNT (*) Make FROM CABHUB;
iv. SELECT Vehicle FROM CABHUB WHERE Capacity=4;

OR

Consider the following table DRESS. Write SQL commands for the following statements.

Table: DRESS

D_CODE DESCRIPTION PRICE MCODE LAUNCH DATE


10001 FORMAL SHIRT 1250 M001 12-JAN-08

10020 FROCK 750 M004 09-SEP-07


10012 INFORMAL SHIRT 1450 M002 06-JUN-08

10019 EVENING GOWN 850 M003 06-JUN-08


10090 TULIP SKIRT 850 M002 31-MAR-07

10023 PENCIL SKIRT 1250 M003 19-DEC-08


10089 SLACKS 850 M003 20-OCT-08

10007 FORMAL PANT 1450 M001 09-MAR-08

10009 INFORMAL PANT 1400 M002 20-OCT-08


10024 BABY TOP 650 M003 07-APR-07
i. To display DCODE and DESCRIPTION of each dress in ascending order of DCODE.
ii. To display the details of all the dresses which have LAUNCHDATE in between 05-DEC-07 and 20-JUN-08
(inclusive of both the dates).
iii. To display the average PRICE of all the dresses which are made up of material with MCODE as M003.
iv. To display materialwise highest and lowest price of dresses from DRESS table. (Display MCODE of each dress
along with highest and lowest price)
35. Answer:
1. i. What is a relation? What is the difference between a tuple and an attribute?
ii. Consider the following table GARMENT. Write SQL commands for the following statements.

Table: GARMENT

GCODE Description Price FCODE READY DATE

10023 PENCIL SKIRT 1150 F03 19-DEC-08 j


10001 FORMAL SHIRT 1250 F01 12-JAN-08

10012 INFORMAL SHIRT 1550 F02 06-JUN-08


10024 BABY TOP 750 F03 07-APR-07

10090 TULIP SKIRT 850 F02 31-MAR-07


10019 EVENING GOWN 850 F03. 06JUN-08
10009 INFORMAL PANT 1500 F02 20OCT-08

10017 FORMAL PANT 1350 F01 09-MAR-08


10020 FROCK 850 F04 09-SEP-07

10089 SLACKS 750 F03 31OCT-08


i. To display GCODE and DESCRIPTION of each GARMENT in descending order of GCODE.
ii. To display the details of all the GARMENTS, which have READY DATE in between 08-DEC-07 and
16-JUN-08 (inclusive of both the dates).
iii. To display the average PRICE of all the GARMENTS, which are made up of FABRIC with FCODE as
F03.
iv. To display FABRIC wise highest and lowest price of GARMENTS from GARMENT table. (Display
FCODE of each GARMENT along with highest and lowest price)
2. OR
i. What is an Alternate Key?
ii. Consider the following tables SCHOOL and ADMIN and answer this question:

TABLE: SCHOOL

CODE TEACHER SUBJECT DOJ PERIODS EXPERIENCE

1001 RAVI SHANKAR ENGLISH 12/3/2000 24 10


1009 PRIYA RAI PHYSICS 03/09/1998 26 12

1203 LIS ANAND ENGLISH 09/04/2000 27 5

1045 YASHRAJ MATHS 24/8/2000 24 15


1123 GANAN PHYSICS 16/7/1999 28 3

1167 HARISHB CHEMISTRY 19/10/1999 27 5


1215 UMESH PHYSICS 11/05/1998 22 16

TABLE: ADMIN

CODE GENDER DESIGNATION


1001 MALE VICE PRINCIPAL

1009 FEMALE COORDINATOR


1203 FEMALE COORDINATOR

1045 MALE HOD


1123 MALE SENIOR TEACHER

1167 MALE SENIOR TEACHER


1215 MALE HOD

Give the output of the following SQL queries:


i. Select Designation Count (*) From Admin Group By Designation Having Count (*) <2;
ii. SELECT max (EXPERIENCE) FROM SCHOOL;
iii. SELECT TEACHER FROM SCHOOL WHERE EXPERIENCE >12 ORDER BY TEACHER;
iv. SELECT COUNT (*), GENDER FROM ADMIN GROUP BY GENDER;
Class 12 - Computer Science
Sample Paper - 06 (2023-24)

Solution

Section A
1. (a) True
Explanation: True
2. (c) All of these
Explanation: All of these
3. (b) 5
Explanation: A list is getting added in list l1 which will be counted as one item for the list.
4. (a) print(''' Eina
\nNina
\nDika''')
Explanation: Python’s triple quotes can be used to span strings over multiple lines.
5. (c) 1111
Explanation: 1111, 1’s complement arithmetic to get the sum.
6. (c) dump( )
Explanation: dump( )
7. (c) [[3,6,9],[4,8,12],[5,10,15]]
Explanation: The above code generates a list of lists each for an integer values between the values specified in the range
function inclusive the lower limit.
8. (a) GROUP BY
Explanation: The aggregate function is often used with the GROUP BY clause and HAVING clause of the SELECT
statement.
9. (d) Either '\n' or EOF
Explanation: Either '\n' or EOF
10. (c) Fruitful functions
Explanation: Fruitful functions
11. (a) del
Explanation: del
12. (c) both function name and parameter list
Explanation: both function name and parameter list
13. (a) True
Explanation: True
14. (c) dlroW olleH
Explanation: The string is traversed in reverse order due to -1 step size.
15. 1. IN
16. (c) VB Script
Explanation: VB Script and Java Script are examples of client-side scripting languages. Rest all are server-side scripting
languages.
17. (d) A is false but R is true.
Explanation: We can use Python source code in another programming language as well. It can embed other
programming languages into our code. In Python, we don't need to specify the data type of the variable. When we assign
some value to the variable, it automatically allocates the memory to the variable at run time.
18. (b) Both A and R are true but R is not the correct explanation of A.
Explanation: pandas is defined as an open-source library that is built on top of the NumPy library and it provides fast
analysis, data cleaning, and preparation of the data for the user.
Section B
19. Answer:
1. i. When a high-frequency carrier wave's frequency is varied in accordance with the frequency of information
(wave) to be transmitted, keeping the amplitude and phase of the carrier wave unchanged, this process is
called frequency modulation.
ii. Burst error means that 2 or more bits in the data unit have changed from 1 to 0 from 0 to 1 during
transmission.
2. OR
i. In large networks, there may be more than one paths for transmitting data from sender to receiver. Selecting
a path that data must take out of the available options is called switching.
Message Switching: It is similar to the Post-office mailing system. A temporary link is established for one
message transfer. In this technique, no physical path is established between source and destination in
advance.
Packet Switching: It is a form of store and forward switch system which stores the message as small
packets at the switch nodes and then transmits it to the destination.
20. Python code to delete all the records from the Employee table whose age >60:
import MySQLdb
db = MySQLdb.connect('localhost', 'HRMan', 'HRManexe@pwd', 'Emplyee')
cursor = db.cursor()
sql ="Delete from Employee where AGE>'%d" /(60)
try:
db.execute(sql)
db.commit()
except:
db.rollback()
db.close()
21. Corrected Code:
Value = 30
for VAL in range(0,Value): # Error 1 - colon missing
if val % 4 == 0: # Error 2 - if should be in lower case
print (VAL * 4)
elif val % 5 == 0: # Error 3 - it should be elif
print (VAL + 3)
else: # Error 4 - colon missing
print(VAL + 10)

OR

i. (weight > =115 and weight < 125)


ii. ((Donation > = 4000 and Donation < = 5000) or Guest = =1)
22. Answer:
1. Before connecting to a MySQL database make sure
i. You have created a database
ii. You have created a table
iii. This table has fields
iv. Python module MySQLdb is installed properly on your machine.
2. Each database module needs to provide a connect function that returns a connection object. The parameter that are
passed to connect vary by the module and what is required to communicate with the database.
Connection-Object= mysql.connector.connect(host = <host-name> , user = <username> , password = <password> )
23. Output of the above code is:
a is: Hello
b is: Nita
c is: How’s
d is: life?
Hi Nita

OR

i. [10, 19, 22, 23, 45, 77]


ii. 77
24. The readline() function reads from a file in read mode and returns the next line in the file or a blank string if there are no
more lines. The data returned by read() is of string type.
The readlines() function, also reads from a file in read mode and returns a list of all lines in the file. The data returned by
readlines() is of list type.

OR

import os
f="percentage.txt"
if os.path.isfile(f):
fob=open(f)
print("Student Status")
print(" -------- ")
for per in fob:
print(per)
fob.close()
else:
print("File does not exist”)

25. Output
[11, 10, 9, 8, 7, 4]
Section C
26. Answer:
1. The above code will give syntax Error(Invalid token) because 0o8 is not a valid integer. Any number beginning with
0 is treated as octal number and octal numbers cannot have digits 8 and 9. Hence 0o8 is an invalid integer.
2. i. len()
ii. lstrip()
iii. min()
27. import random
def randomNDigitNumber(n):
num = " "
firstlteration = True
for i in range(n):
randomDigit = " "
if firstlteration:
randomDigit = str(random.randint(1, 9))
firstlteration = False
else:
randomDigit = str(random.randint(0, 9))
num = randomDigit + num
return num
print(randomNDigitNumber(7))
28. Differentiate between char(n) and varchar(n) are as follows
char(n) varchar(n)
It stores a fixed length string between 1 and 255
It stores a variable length string.
characters.

If the value is of smaller length, then it adds blank No blanks are added by varchar(n) even if value is of smaller
spaces. length.

Some space is wasted in it. No wastage of space in varchar(n).

OR

i. SUM(DISCOUNT)
29

ii. AX(DATE OF PURCHASE)


19-Jul-2021

iii. FID NAME DATE OF PURCHASE COST DISCOUNT

T006 Console Table 17-NOV-2019 15000 12

iv.iv. DATE OF PURCHASE


10-MAR-2020
17-NOV-2019
29. Function that would read contents from file sports.dat and creates a file named Atheletic. dat:
def athletics:
file1 = open ("sports.dat",r)
file2 = open ("Athletics.dat",w)
records = " "
while records! = " ":
records = file1.readline ()
sport = records.split('n')
if sport[o] == "Athletics":
file2. write (records)
file2.write ('\n’)
else:
pass
file1.close()
file2.close()
return
30. i. 1 → 5 → 10 → 11 → 5 → 6 → 7 → 1 → 2 → 3 → 7 → 8 → 11 → 12
ii. 1 → 5 → 6 → 7 → 1 → 2 → 8
[Control did not return to function call statement (7) as no value is being returned by increment()]
iii. 1 → 7 → 8 → 9 → 1 → 2 → 3 → 4 → 9 → 10 → 11 → 12 → 13 → 1 → 2 → 3 → 4 → 14 → 15 → 16
[Control did not return to function call statement (13) as its result is not being stored anywhere.]
Section D
31. i) course_dict[course] = fee
ii) course_dict[key]
iii) append(key)
iv) len(STACK)
32. i. SELECT STRNAME FROM STREAM ORDER BY STRNAME;
ii. SELECT COUNT(*) FROM STUDENT WHERE POINTS > 5;
iii. UPDATE STUDENT SET GRADE = 'A' WHERE POINTS > 8;
iv. DELETE FROM STREAM WHERE STRNAME='ARTS + MATHS';
v. SELECT NAME FROM STUDENT WHERE STUDENT.STRCDE = STREAM. STRCDE AND
STRNAME="SCIENCE + COMP";
Section E
33.33. i. MAN and LAN
ii. Switch/Hub
iii. Optical fiber

iv.iv.

An effective method/technology for connecting the company’s office in Delhi and Chennai is broadband connection.
v. Production unit is suitable to install the server because it has maximum number of computers.
34. a. Primary key of CABHUB table given in question = Vcode alternate key of CABHUB table = Vehicle Name. The
Primary key of Customer table = Ccode Alternate Key of CUSTOMER = Cname.
b. i. SELECT VehicleName FROM CABHUB WHERE Colour = "WHITE";
ii. SELECT VehicleName, capacity From CABHUB ORDER BY Capacity ASC;
iii. SELECT MAX(Charges) FROM CABHUB;
iv. SELECT Cname, VehicleName FROM CABHUB, CUSTOMER WHERE CUSTOMER. Vcode= CABHUB.
Vcode;
c. i. 4

ii. Max(Charges) Min(Charges)

35 12
iii. 5
iv. SX4
C Class

OR
i. SELECT D_CODE , DESCRIPTION FROM DRESS ORDER BY D_CODE;
ii. SELECT * FROM DRESS WHERE LAUNCHDATE BETWEEN '05-DEC-07' AND '20-JUN-08' ;
iii. SELECT AVG(PRICE) FROM DRESS WHERE MCODE = 'M003' ;
iv. SELECT MCODE, MAX(PRICE), MIN(PRICE) FROM DRESS GROUP BY MCODE ;
35. Answer:
1. i. A relation is a two-dimensional table. It contains a number of rows (tuples) and columns (attributes).
A row in a relation is known as a tuple whereas a column of a table is known as an attribute.
ii. i. SELECT GCODE, Description FROM GARMENT ORDER BY GCODE DESC ;
ii. SELECT * FROM GARMENT WHERE READY DATE BETWEEN '08-DEC-07' AND '16-JUN-08' ;
iii. SELECT AVG(Price) FROM GARMENT WHERE FCODE = 'F03' ;
iv. SELECT FCODE, MAX(Price), MIN(Price) FROM GARMENT GROUP BY FCODE ;
2. OR
i. Out of the candidate keys, after selecting a key as primary key, the remaining keys are called an alternate
key. In Suppliers table if there are 2 candidate keys - Suppld and Supp_Name then Suppld is the primary
Key then Supp_Name is the alternate key.

ii. i. VICE PRINCIPAL 01


ii. 16
iii. UMESH
YASH RAJ
iv. 5 MALE
2 FEMALE

You might also like