0% found this document useful (0 votes)
63 views18 pages

Untitled

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

Untitled

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 18
1 CLASS-xil (2022-23) # SAMPLE QUESTION PAPER - 5 Computer Science (083) 1 . Maximum Marks: 70. Time Allowed: 3 hours General Instructions: This question paper contains five sections, Section A to E. All questions are compulsory. Section A have 18 questions carrying 01 mark each. Section B has 07 Very Short Answer type questions carrying 02 marks each. 1 Section C has 05 Short Answer type questions carrying 03 marks each. Section D has 03 Long Answer type questions carrying 05 marks each. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only. 8. All programming questions are to be answered using Python Language only. Section A Novae s 1. State true or false: rT] Like while, the for loop also works with conditions and truth values. 2. By default, ORDER BY clause lists the results in order t) c) Same d) Ascending 3. Which line of code will cause an error? na) 1. num = [5, 4, 3. [2}. 1) 2. print(num{O]) 31[0]) 5) a) Line 4 b) Line 3 3. print(num| 4. print(num ' 1 1 1 1 1 ! a) Any b) Descending 1 1 1 1 1 1 1 ' ©) Line 1 d) Line 2 ' 4, To obtain all the records retrieved, you may use . method. uy ' a) fetchall() b) fetch() ©) fetchmany() d) fetchmultipled) 1 5. Which of the following is a client-side scripting language? WW ' a) Perl b) PHP ©) VB Script d) Ruby 6. To opena file c:\core.txt for writing, we can use: ty) ' a, fil \core.txt", "w") Page 1 of 18 te b. file = open("c:\ \core.txt", "Ww") ¢. file = open(r"e: \ core.txt", "Ww") d. file = open(file = "e:\core.txt", "Ww") e. file = open(file = "c: \\ core.txt", "w") f. file = open(//es\ res.txt") aye,f b)ae oat db Which of the following is a SQL aggregate function? a) JOIN b) LEN ) AVG d) LEFT Which of the following is not a legal method for fetching records from database from within Python? a) fetchtwo( ) b) fetchall( ) ) fetchone( ) d) fetchmany( ) To read twelve characters from a file object infi, we use a) infi.read(12) b) infi.readline(12) ¢) infi.read(13) d) infi.readlines(12) A pointer variable which contains the location of the first/topmost element of the stack is called a) Final b) Top ©) Last d) First Pick one the following statements to correctly complete the function body in the given code snippet. def f(number) # Missing function body print(1(5)) a) return "number" b) return number ©) print("number") d) print(number) Which method should I use to convert String "Python programming is fun" to “Python Programming Is Fun"? a) upper() b) capitalize() c) istitle() d) title() Page 2 of 18 fl (1 ul fl a tl 16. 17. 18. ve ‘What is the output of the following expression? 1) print(4,00/(2.0 + 2.0)) a)l b) 1.0 c) 1.00 d) Error The checksum of 0000 and 0000 is ty a) 1110 bon ce) NL d) 0000 What are two advantages of using fiber-optic cabling ty i, lower cost ii. easier to install iii, allows longer distances iv, less effected by external signals v. easier to terminate the cable ends a) (ii) and (v) ) (i) and (iii) ©) Gi) and (¥) ) (iii) and Gv) Which command helps identify if a given system is connected to a network? ty a) ping b) netstat ©) ifconfig d) Getmac Assertion (A): flush() function flushes the write buffer of the file stream. ty Reason (R): The isatty() method, returns True if the file stream is distinct. a) Both A and Rare true and Ris —_b) Both A and R are true but R is the correct explanation of A. not the correct explanation of A. c) Ais true but R is false. d) Ais false but R is true. Assertion (A): String handling in Python is a straightforward task. ly Reason (R): Python does not provide built-in functions and operators to perform ‘operations in the string. a) Both A and R are true and R is b) Both A and R are true but R is the correct explanation of A. not the correct explanation of A. c) Ais true but R is false. d) A is false but R is true. Section B Find the errors in following code and write the correct code. RI 1=['a’, ‘b’,'c’, ‘d’] t=(0,1,2,3) vl=6 Page 3 of 18 v2-'6! ' f foriint 1 " 1[i]+=v2 1 1 vi=vl-1 h print(t * t) ' print(t [vI]) 1 " print(t [¥2:] 1 1 i, Underline the corrections. 1 1 ii, Write the reason!error next to it in the comment form, ' f OR 1 ' Determine which of the arithmetic expressions are valid. If invalid, explain the reason, 1 1 [(a, b,c) are integers, (p, q, r) are float and (x, y, z) are float}. le ipiqta-c ' le ii, q(a +b - 2/4) ' h iii, pqta-c ' h iv. ly + p*alb 1 vat +b 1 f- vicat b*e*2 1 r h 20. Give the full form for the following: 2 ' h i, FM ! ii, AM 1 " a iii, NFS 1 f iv. FTP 1 . 21. Write Python code to create a table faculty with the following fields. 21 ' ft Id, LastName, FirstName, Locationid, phone, rank, startdate 1 " Rank should be one of the following 1 1 ASSO, FULL, ASST, INST 1 ' 22. What will be the output of the following? Explain. RI i 1 def f1Q: ' # n=44 i 1 def 120) i le n=77 print(""Value of n", n) ' # print("Value of n", n) 1 1 h 23. Answer: 2 ' l (i) How to create a connection object? 1 ' 1 (ii) Which method creates and returns a cursor object that may be used to execute h SQL commands? ' ' Page 4 of 18 26. @ (ii) 27. 28. ‘Write a Python program that creates a tuple storing first 9 terms of Fibonacci RI series. OR Python is dynamic typed. Explain it. What is the difference between readline() and readlines() funetion? RI OR Explain seek() method. Section C Answer: BI Write a method in python to display the elements of list thrice if itis a number and display the element terminated with if it is not a number. For example, if the content of list follows : List =['41', ‘DROND’, 'GIRIRAJ', °13', 'ZARA'] The output should be 414141 DROND# GIRIRAD# 131313 ZARAH Correct the following code ix=5 print(x) y=10 print(y) a-xty print(a) ii. sub = “Math’ marks = 80 print(“Value of subject and marks are”, sub + marks) What is the difference between the formal parameters and actual parameters? BI What are their alternative names? Also, give a suitable Python code to illustrate both You want to group the result set based on some column's value. Also, you want [3] that the grouped result should appear in a sorted order. In which order will you Page 5 of 18 29. 30. 31. write the two clauses (for sorting and for grouping), Give example to support your answer. OR i, A table, ITEM has been created in a database with the following fields ITEMCODE, ITEMNAME, QTY, PRICE Give the SQL command to add a new field, DISCOUNT (of type Integer) to the ITEM table. ii, Categorize following commands into DDL and DML commands? INSERT INTO, DROP TABLE, ALTER TABLE, UPDATE...SET Write a Python program that read the data from file ‘original.dat' and delete the [3] line(s) having word (passed as an argument). Then write these data after removing, lines into file 'duplicate.dat’ What is the significance of having functions in a program? BI OR How are following two statements different? import math from math import * Section D A linear stack called status contains the following information: is] Phone number of Employee Name of Employee Write the following methods to perform given operations on the stack status: i, Push_element () To Push an object containing Phone number of Employee and Name of Employee into the stack. ii, Pop_element () To Pop an object from the stack and to release the memory. Consider the following tables CABHUB and CUSTOMER and answer the (SI following parts of this question ‘Table: CABHUB Veode | VehicleName | Make Color | Capacity | Charges 100 Innova Toyota WHITE 7 15 102 SX4 Suzuki BLUE 4 14 104 CClass | Mercedes [RED 4 35 105 A-Star Suzuki WHITE 3 14 108 Indigo Tata SILVER 3 12 ‘Table: CUSTOMER CCode CName Veode 1 Hemant Sahu 101 2 Raj Lai 108 Page 6 of 18 Feroza Shah 4 Ketan Dhal 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 VehicleName FROM CABHUB WHERE Capacity = 4; OR Write SQL queries for (i) to (iy) and find outputs for SQL queries (v) to (viii), which are based on the tables. TRAINER TID |TNAME CITY HIREDATE SALARY 101 |SUNAINA IMUMBAL 1998-10-15 90000 102. |ANAMIKA DELHI 1994-12-24 |80000 103 |DEEPTI CHANDIGARH 2001-12-21 182000 104 |MEENAKSHI DELHI 2002-12-25 78000, 105 |RICHA MUMBAI 1996-01-12 95000 106 |MANIPRABHA CHENNAT 2001-12-12 69000 COURSE ‘CID |\CNAME. FEES STARTDATE, TID C201 |AGDCA 12000 2018-07-02 101 C202 ADCA 15000 2018-07-15 103 C203 DCA 10000 2018-10-01 102 C204 DDTP 9000 2018-09-15 104 C205 |DHN: 20000 2018-08-01 101 C206 0 LEVEL 18000 2018-07-25 105 i, Display the Trainer Name, City & Salary in descending order of their Hiredate. ii, To display the TNAME and CITY of Trainer who joined the Institute in the month of December 2001 iii. To displayTNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER and COURSE of all those courses whose FEES is less than or equall to 10000. (iv) ‘To display number of Trainers from each Ans. city. iv, SELECT TID. TNAME, FROM TRAINER WHERE CITY NOT IN (‘DELHT, "MUMBAI’); vy. SELECT DISTINCT TID EROM COURSE; vi. SELECT TID, COUNT(*), MIN (FEES) FROM COURSE. CROUP BY TID HAVING COUNT(*)>1; Page 7 of 18 vii. SELECT COUNTS), SUM(FEES) FROM COURSE WHERE STARTDATE< '2018-09- 15'; 1 33, Answer (i) & (ii) OR (iii) & (iv) 15] ' L (i) Write a program to search the name and address of person having age more than 30 in the data list of person. 1 (i) What would be written in the file errorlog.txt after the following code is run? def f(datum): 1 try: retum 127/(42 - datum) except zeroDivisionError: logfile = open (“errorlog.txt", 'w') ' logfile.write ("datum was 42\n") 1 logfile.close() £(42) # calling function £() (iii) Write a method in python to read lines from a text file INDIA.TXT, to find and display the occurrence of the word "India". INDIA.TXT "India is the fastest-growing economy. India is looking for more investments around the globe. The whole world is looking at India as a great market. Most of the Indians can foresee the heights that India is capable of reaching.” The output should be 4 (iv) What is the output of the following code program. Explain? >>> out = file (“output.txt",'w') >>> out.write (Hello, world!\n") >>> outwrite ("How are you 2") >>> out.close () >>> file("output.txt").read(), Section E 34. Read the text carefully and answer the questions: 4 Trine Tech Corporation (TTC) is a professional consultancy company. The company is planning to set up its new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their requirement and suggest to ' them the best available solutions, Their queries are mentioned as (i) to (iv) below 1 Physical Locations of the blocks of TTC Block to Block distances (in Mirs.) Block (From) Block (To) Distance Human Resource Conference 110 Human Resource Finance 40 Page 8 of 18 le [Conference [Finance 5 Expected Number of Computers to be installed in each block : 1 Block (Computers ‘ 1 Human Resource 25 ' 1 Finance 120 ' 1 Conference’ 90 ' r (i) What will be the most appropriate block, where TTC should plan to install their 1 . server? 1 t (ii) Draw a block diagram showing a cable layout to connect all the buildings in the ' . most appropriate manner for efficient communication. 7 t (iii) What will be the best possible connectivity out of the following, you will suggest 1 ' connecting the new setup of offices in Bengaluru with its London based office. 1 f © Satellite Link 1 1 * Infrared 1 1 + Ethemet Cable ' f OR 1 " Which of the following device will be suggested by you to connect each computer 1 1 in each of the buildings? le © Switeh ' h + Modem ' h + Gateway ! 1 35. Read the text carefully and answer the questions: wt 5 Consider the following tables GAMES and PLAYER: ' h Table: GAMES ' 1 [GCode [Game Name [Type [Number [Prize Money [Schedule Date ' 1 101 [Carom Board [indoor [2 5000 jan-2004 ' 1 102 [Badminton [Outdoor [2 12000 12-Dec-2003 ' 1 103 [Table Tennis indoor [4 8000 14-Feb-2004 ' " 105 [Chess Indoor [2 9000 (01-Jan-2004 ' 1 108 [Lawn Tennis [Outdoor [4 25000 19-Mar-2004 i 1 Table: PLAYER a " PCode Name GCode 1 # 1 Nabi Ahmad 101 1 # 2 Ravi Sahai 108 1 ft 3 Jatin 101 1 Page 9 of 18 Nazneen 103 ' ' « (i) What do you understand by primary key and candidate keys? 1 1 (ii) Write SQL commands for the following statements: ny f i. To display the name of all GAMES with their GCodes. 1 # ii. To display details of those GAMES which are having PrizeMoney more than 1 1 7000. 1 ft (ii) Write SQL commands for the following statements: 1 e i. To display the content of the GAMES table in ascending order of Schedule 7 ' Date. an . . 1 1 ii. To display sum of PrizeMoney for each type of GAMES. 1 1 ' r 1 ! " 1 1 h 1 h ' h ! 1 " 1 r h 1 1 1 " 1 r 1 ' 1 ' ' ' ' 1 ° ' r ' 1 ' " 1 r ' ' ' 1 ' Page 10 of 18 1 SOLUTION Section A 1. (b) False Explanation: False . (d) Ascending Explanation: The Order by clause by default sorts the retrieved data in ascending order. To sort the data in descending order DESC keyword is used. (a) Line 4 nv y Explanation: The num list has 5 elements only. Since, the list indexing starts from 0, the print(num{[5]) statement looks for sixth element of the list which does not exist. (a) fetchall() Explanation: fetchall() . (¢) VB Script Explanation: VB Script and Java Script are examples of client-side scripting languages, Rest all are server-side scripting languages. (@b.c Explanation: Only file = open("'c:\ \core.txt", "w") and file = open(r"e: \ core.txt", "Ww" are correct statements to open file since the file path should be a proper string and we do not need to provide file keyword before file path. - (€) AVG Explanation: AVG is used to find average (a) fetchtwor ) Explanation: There is no fetchtwo( ) method . . (a) infi.read(12) Explanation: infi.read(12) function returns 12 bytes read from the infi file. 0. (b) Top Explanation: The top is the pointer variable that contains the first or topmost element of the stack. 1. (b) return number Explanation: return number 2. (d) title() Explanation: title() 3. (b) 1.0 Explanation: 1.0, precedence gives to ( ) .(e) LIL Explanation: 1111, 1’s complement arithmetic to get the sum. . (d) (iii) and (iv) Explanation: (iii) and (iv) . (a) ping Explanation; Ping is used to test connectivity to other hosts 7. (©) Ais true but R is false. Explanation: The flush() function flushes the write buffer of the file stream and isatty() function returns True if the file stream is interactive otherwise it return False. Y a 2 x ~ Ry 5 a Page 11 of 18 18. (©) Ais true but R is false. Explanation: String handling in Python is a straightforward task since Python provides built-in functions and operators to perform operations in the string. Example : count(), find(), replace(), ete. Section B b,c, "a] (0, 1, 2,3) fori int :#: missing Iti] +=v2 print(L+_1) # tuple cannot be multiplied with a tuple, print(t{vL)) # v1 is 6, index out of range, however with slice it will work print(t [int(v2):]) # a tuple slice can contain only integers OR i. piqta-c valid i. q (a+b - 7/4) invalid because operator missing between q and a iii. p/q + ac valid iv. x/y + p* w/b valid vy. a* +b invalid because use of two operators together vi. a + b*c*2 valid FM: Frequency Modulation M: Amplitude Modulation iii, NFS: Network File Server iv. FTP: File Transfer Protocol 21. import MySQLdb db=MySQLdb.connect("localhost", "Fact", "Faculty24", "Instd") cursor—db,cursor() cursor.execute("DROP TABLE IF EXISTS FACULTY") sql=""Create Table Faculty(Id Number(3) PRIMARY KEY, LastName CHAR(20) NOT NULL, FirstName CHAR(30) NOT NULL, locationid Number(6) , phone char(10) , rank char(4) check (rank IN(ASSO’, 'FULL', ‘ASST’, 'INST’)), startdate DATE)""" cursor.execute(sql) db.close() Firstly call the function £10 £20) Then output will be look like as: Value of n. 77 Value of n 77 23. Answer: (i) connection_object = mysql.connector.connect (host = HostName, user = UserName, passwd = password) (ii) The cursor method of connection object, i.e., connection.cursor( ) method. Page 12 of 18 R 8 24. def make_fibonacei(n): fib=[] a,b=0, 1 for i in range(n): a,b=b,atb fib.append(a) return tuple(ib) print(make_fibonacci(8)) OR A language is dynamically typed if the type is associated with run-time values and not named variables/fields etc. This means that you as a programmer can write a little quicker because you do not have to specify types every time. Python is a dynamically type language. It does not know about the type of the variable until the code is run, so declaration is no use. It stores that value at some memory location and then binds that variable name to that memory container. We have assigned three values to three variables: >>>a=10 >>> name = “Neha” >>> x = 34.6 But what types are these variables? Let’s use the type() module to find out: Syntax type(variable_name) 25. 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 The seek() method moves the current file pointer position to the specified position. Syntax : (offset [, from_what]). The offset argument indicates the number of bytes to be moved. The from_what argument specifies the reference position from where the bytes are to be moved. The values for from_what argument can be 0(beginning of the file); default value, I(current position of the pointer) or 2(end of the file). Section C 26. Answer: (i) List =[41', 'DROND', 'GIRIRAN, "13", 'ZARA'] for w in List: if w.isdigit(): # for numeric digits print(w*3) else: print (w+"#") #for string Page 13 of 18 (i) ix print(x) y=10 print(y) a=xty print(a) . sub = "Math" marks = 80 print("Value of subject and marks are” , sub, marks) iii. x=5 b x="Try" d=x/20 27, Actual Parameter is a parameter, which is used in a function call statement to send the value from the calling function to the called function, It is also known as Argument. A formal Parameter is a parameter, which is used in a function header of the called function to receive the value from the actual parameter. It is also known as Parameter. The key difference between Actual Parameters and Formal Parameters is that Actual Parameters are the values that are passed to the function when it is invoked while Formal Parameters are the variables defined by the function that receives values when the function is called. For example, def addEm(x, y, 2): print(x + y +2) addEm(6, 16, 26) In the above code, actual parameters are 6, 16 and 26; and formal parameters are x, y and z. 28, When we use GROUP BY clause (for grouping of data) and ORDER BY clause (for sorting data) together, the ORDER BY clause always follows other clauses. That is, the GROUP BY clause will come before the ORDER BY clause. For example In this query, SELECT user_id, SUM(score) AS total_score FROM user_score GROUP BY user_id ORDER BY user_id ASC; OR i, ALTER TABLE ITEM ADD Discount INT; ii, DDL means “Data Definition Language’. It is used to create and modify the structure of database objects in SQL. So, DDL commands are DROP TABLE, ALTER TABLE. DML is ‘Data Manipulation Language’ which is used to manipulate data itself. ET. So, DML commands are INSERT INTO, UPDATE... 29, import os def Delete (word Page 14 of 18 file!=open(‘original.dat’,'rb’) nfile=open(‘duplicate.dat’, ‘wb’ while True: line=file!.readline() if not line: break else: if word in line: pass else: print(line) nfile.write(line) file close() nfile.close() 30. Creating functions in programs is very useful. It offers the following advantages: i. The program is easier to understand. The main block of the program becomes compact as the code of functions is not part of it, this is easier to read and understand. ii, Redundant code is in one place, so making changes is easier. Instead of writing code again when we need to use it more than once, we can write the code in the form of a function and call it more than once. If we later need to change the code, we change it in one place only. Thus it saves our time also. iii, Reusable functions can be put in a library in modules, We can store the reusable functions in the form of modules. These modules can be imported and used when needed in other programs. iv. You use functions in programming to bundle a set of instructions that you want to use repeatedly because of their complexity, are better self-contained in a sub- program and called when needed. That means that a function is a piece of code written to carry out a specified task. OR When import math statement is used, a new namespace sets up in our working environment with the same name as that of the math module and code of the module is interpreted and executed. Alll the defined functions, constants and variables of the math module are available to our program. There is no need to import the objects of modules everytime they are used. Whereas when we use from math import * statement no new namespace is created. Only the functions and variables of the imported module are added to the namespace of the program. If there are two variables with same name, one in the program and other in the imported module then the variable of the imported module is hidden by the program variable. We need to import every object we are using in the code. Section D 31. def Push_element(Status, Top): phone_no = int(input("Enter phone number:”)) emp_name = input("Enter employee nam St=(phone_no, emp_name) Page 15 of 18 Status.append(St) Top =Top + 1 return Top def Pop_clement(Status, Top): Slen = len(Status) if (Slen <= 0): print("Status is empty") else: phone_no, emp_name = Status.Pop() Top = Top-I print("Phone number %s and name %s deleted"*%4(phone_no, emp_name)) return Top 32.1.4 ii. 35 12 Invalid query iv. SX4 C Class OR . SELECT TNAME, CITY, SALARY FROM TRAINER ORDER BY HIREDATE . SELECT TNAME, CITY FROM TRAINER WHERE HIREDATE BETWEEN ‘2001-12-01' AND '2001-12-31'" SELECT TNAME, CITY FROM TRAINER WHERE HIREDATE > = '2001-12- 01' AND HIREDATE < = '2001-12-31'; |. SELECT TNAME, HIREDATE, CNAME, STARTDATE FROM TRAINER.COURSE WHERE TRAINER.TID= COURSE.TID AND FEES < = 10000: , SELECT CITY, COUNT(*)) FROM TRAINER GROUP BY CITY; ii y, |TIDT[NAME 103 | DEEPTI 106 MANIPRABHA vi. DISTINCT TID 101 103 102 104 105 4 _ [TIDCOUNT(*) | _|MINEES) 101 12000 viii, [COUNT(*) SUM(FEES) 4 65000 33, Answer (i) & (ii) OR (iii) & (iv) (i) file1 = open (‘“datalist.dat”) rec = print “Name Address” Page 16 of 18 while ree: rec = file | readline().split() 1 age = int (rec [2]) 1 ifage > 30 le print rec{0], rec{1] filel.close() 1 (ii) "datum was 42" will be written in the errorlog.txt file. ’ As when f(42) function is called, zeroDivisionError is invoked by 127/(42-42) and the exception block is executed and "datum was 42\n" is written in the file by the write() function. LU (iiiMef display 10: 1 count = 0 file = open(‘INDIA.TXT’, 'r') for LINE in file: Words = LINE.split() count = count+1 print(count) file.closeQ) (iv)Hello, world! How are you? the first line will open the file in write mode. The next two lines will write the text to the file. The fourth line will close the file. In the fifth line, the file) function gives the reference of the file output.txt to read () function which reads the text from the fi Section E 34, Read the text carefully and answer the questions: Trine Tech Corporation (TTC) is a professional consultancy company. The company is planning to set up its new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their requirement and suggest to them the best available solutions. Their queries are mentioned as (i) to (iv) below. Physical Locations of the blocks of TTC Block to Block distances (in Mtrs.) Block (From) Block (To) Distance Human Resource Conference 110 Human Resource Finance 40, Conference: Finance 80, 1 Expected Number of Computers to be installed in each block Page 17 of 18 Block Computers Human Resource 25 Finance 120 Conference 90 (i) Finance block because it has the maximum number of computers. (ii) “Human Resource (iiiSatellite link will be the best possible connectivity. OR The Switch will be suggested to connect each computer in each of the buildings. 35. Read the text carefully and answer the questions: Consider the following tables GAMES and PLAYER: Table: GAMES 'GCode |Game Name | Type Number |Prize Money |Schedule Date 101 \Carom Board [Indoor — |2 5000 23-Jan-2004 102 Badminton ‘Outdoor |2 12000 12-Dec-2003 103 ‘Table Tennis [Indoor = |4 8000 14-Feb-2004 105 Chess Indoor |2 9000 01-Jan-2004 108 Lawn Tennis |Outdoor |4 25000, 19-Mar-2004 Table: PLAYER /PCode Name GCode I Nabi Ahmad 101 2 Ravi Sahai 108, = Jatin 101 4 Nazneen 103 (i) Primary Key is a unique and non-null key, which is used to identify a tuple uniquely. Ifa table has more than one such attributes which identify a tuple uniquely than all such attributes are known as candidate keys. (ii) i, SELECT GameName, GCode FROM GAMES; ii, SELECT * FROM Games WHERE PrizeMoney > 7000; ELECT * FROM Games ORDER BY ScheduleDate; ii, SELECT SUM(Prizemoney) FROM Games GROUP BY Type; (ii Page 18 of 18

You might also like