0% found this document useful (0 votes)
55 views

12th CS PT Set2

Uploaded by

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

12th CS PT Set2

Uploaded by

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

TRS GLOBAL PUBLIC SCHOOL SENIOR SECONDARY, CBSE – ARAKKONAM

PERIODIC TEST 1
Class: XII Subject: Computer Science (083) Marks -40
General Instructions:
(1) There are 20 questions in all. All questions are compulsory
(2) This question paper has five sections: Section A, Section B, Section C, and Section D. All the sections
are compulsory.
(3) Section A contains ten MCQ of 1 mark each, Section B contains three questions of two marks each,
Section C contains four questions of three marks each, Section D contains three long questions of four marks
each.
(4) There is no overall choice. However, an internal choice has been provided in section D. You have to
attempt only one of the choice.
SECTION A
1. Which command is used to change the database? 1m
(a) Open (b) Change (c) Use (d) Select
2. Which is not a MySQL function? 1m
(a) Mult() (b) Min() (c) Count() (d) Sum()
3. Which SQL aggregate function is used to count all records of a table? 1m
4. Write the full form of the following abbreviations: 1m
(i) DDL (ii) DML
5. Which of the following is not a valid aggregate function? 1m
(a) COUNT (b) COMPUTE (c) SUM (d) MAX
6. Which data manipulation command is used to combines the records from one 1m
or more tables?
(a) SELECT (b) PROJECT (c) JOIN (d) PRODUCT
7. which operator is used to compare a value to a specified list of values? 1m
(a) ANY (b) BETWEEN (c) ALL (d) IN
8. what operator tests column for absence of data 1m
(a) (b) Exists (c) IS NULL (d) None of the
NOT
Operator perator above
Operator
9. In which of the following cases a DML statement is not executed? 1m
(a) When existing (b) (c) when some (d)
When a table All of the
rows are rows are
modified. is deleted. deleted. above
10. If we have not specified ASC or DESC after a SQL ORDER BY clause, the 1m
following is used by default
(a) DESC (b) (c) no default (d) None of these
ASC
value

SECTION B
11. Differentiate between DDL & DML commands. Identity DDL & DML commands 2m
from the following;
(UPDATE, SELECT, ALTER, DROP)
12. Observe the following table and answer the parts (i) and (ii) accordingly 2m
Table: Product
PNo Name QTY PurchaseDate
101 Pen 102 12-12-2011
102 Pencil 201 21-02-2013
103 Eraser 90 09-08-2010
109 Sharpener 90 31-08-2012
113 Clips 900 12-12-2011
(a) Write the names of most appropriate columns, which can be considered
as candidate keys.
(b) What is the degree and cardinality of the above table?
13. Differentiate between cardinality and degree of a table with the help of an 2m
example
SECTION C
14. Write SQL commands for the statements (a) to (g) on the table Hospital 3m
Table: Hospital
PNo Name Age Department DateofAdm Charges Sex
1 Mayank 65 Surgery 23/02/2018 600 M
2 Babita 24 ENT 01/01/2019 400 F
3 Kashish 45 Orthopaedic 19/12/2018 400 M
4 Tarun 12 Surgery 01/10/2018 600 M
5 Manisha 36 ENT 12/01/2018 400 F
6 Imran 16 ENT 24/02/2018 400 M
7 Ankita Null Cardiology 20/08/2018 800 F
8 Zoya 45 Gynaecology 22/02/2018 500 F
9 Kush 19 Cardiology 13/01/2019 800 M
10 Shalini 31 Medicine 19/02/2018 300 F
(a) To show all the information about the patients of the cardiology
department
(b) To list the names of female patients who are either in the orthopaedic or
surgery department.
(c) To list the name of all the patients with their date of admission in
ascending order.
(d) To display the patient’s name, charges, the age for female patients only.
(e) To count the number of patients with age>30.
(f) To display various departments.
(g) To display the number of patients in each department.
15. Write SQL commands for the statements (a) to (g) on the table Hospital 3m
(a) To display the details of all the patients whose name starts with the
alphabet ‘Z’
(b) To change the age of the patient Kush to 20.
(c) To increase the charges of all the patients by 5%
(d) To remove the record of the patient whose Name is Tarun.
(e) To add another column Doc Name (Doctor Name) of the type varchar in
the above table.
(f) To display patient detail whose age is missing(null).
(g) To decrease the charges by 5% of all the patients admitted to the ENT
department.
16. Write SQL commands for the following queries 3m
Table: STUDENT
No Name Age Departmen Dateofad Fee Sex
t m
1 Pankaj 24 Computer 10/01/97 120 M
2 Shalini 21 History 24/03/98 200 F
3 Sanjay 22 Hindi 12/12/96 300 M
4 Sudha 25 History 01/07/99 400 F
5 Rakesh 22 Hindi 05/09/97 250 M
6 Shakeel 30 History 27/06/98 300 M
7 Surya 34 Computer 25/02/97 210 M
8 Shikha 23 Hindi 31/07/97 200 F
(a) To show all information about the students of History department.
(b) To list the names of female students who are in Hindi department.
(c) To list the names of all students with their date of admission in
ascending order.
(d) To display student’s name, fee, age for male students only.
(e) To count the number of students with Age>23.
17. Write SQL commands for the following queries based on the relation Teacher 3m
given below:
Table: Teacher
No Name Age Department Date_of_Joi Salary Sex
n
1 Jugul 34 Computer 10/01/97 12000 M
2 Sharmila 31 History 24/03/98 20000 F
3 Sandeep 32 Maths 12/12/96 30000 M
4 Sangeeta 35 History 01/07/99 40000 F
5 Rakesh 42 Maths 05/09/97 25000 M
6 Shyam 50 History 27/06/98 30000 M
7 Shiv Om 44 Computer 25/02/97 21000 M
8 Shalakah 33 Maths 31/07/97 20000 F
(a) To show all information about the teacher of Computer department
(b) To list the names of female teachers who are in Maths department
(c) To list the names of all teachers with their date of joining in ascending
order.
(d) To display teacher’s name, salary, age for male teachers only
(e) To count the number of teachers with age>23.
SECTION D
18. Write SQL commands for the statements (a) to (h) on the below table: student 4m
and stream
Table: Student
Admno Sname Class See Fee Mobile Area S_ID
1001 RAMESH XII A 2500 9876543210 Madipur 10
1078 KRISHNA XII B 2400 9965913522 Jawala Heri 30
1006 FARDEEN XII C 2600 8626154825 Paschim Puri 40
1004 SUBHAM XII A 2500 8681944528 Madipur 20
1029 KRITIKA XII C 2700 9652548569 Madipur 30
1008 SAMEEKSHA XII A 2450 7812549622 Mangol Puri 20
1025 SALMA XII B 2580 9826961235 Madipur 30
1036 AMANDEEP XII B 2600 8964582318 Khyala 40
1037 TEJAS XII C 2650 7896548322 Paschim Puri 40
1029 HIMANSHU XII A 2750 6885942312 Jawala Heri 10
Table: Stream
S_ID Stream_name
10 MEDICAL
20 NON MEDICAL
30 COMMERCE WITH MATH
40 COMMERCE WITH IP
50 HUMANITIES
(a) Display class and total fee collected from each class
(b) Display admission no, students name and stream name.
(c) Display all the student details who have taken commerce stream.
(d) Count number of students who have opted for HUMANITIES stream.
(e) Display information of commerce with ip students whose name start with
‘S’. arrange the record by admission number.
(f) Display details of all students who are in the MEDICAL stream.
(g) Display total fee of ‘Non-Medical’ Student.
(h) Change the name of the Column Sname to Student_Name.
19. Write SOL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii) 4m
which are based on the tables.
(a) To display details of all transactions of TYPE Credit from Table
TRANSACTION.
(b) To display the CNO and AMOUNT of all transaction done in the month
September 2017 from the table TRANSACTION.
(c) To display the last date of transaction (DOT) from the table
TRANSACTION for the customer having CNO as 103.
(d) To display all CNO, CNAME and DOT (date of transaction) of those
CUSTOMERS from tables CUSTOMERS and TRANSACTION who have
done transactions more than or equal to 2000.
(e) Select count(*), avg (amount) from transaction where dot>= ‘2017-06-
01’;
(f) Select cno, count(*), max (amount) form transaction group by cno having
count (*)>1;
(g) Select cno, cname from customer where address not in (‘Delhi,
‘Bangalore’);
(h) Select distinct cno from transaction;
20. Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (vii),j 4m
which are based on the tables.
TABLE: SALESPERSON
CODE NAME SALARY ITCODE
1001 TANDEEP JHA 60000 12
1002 YOGRAJ SINHA 70000 15
1003 TENZIN JACK 45000 15
1004 ANOKHI RAJ 50000 17
1005 TARANA SEN 55000 17
TABLE: ITEM
IT CODE ITEM TYPE TURNOVER
15 STATIONARY 3400000
17 HOISTERY 6500000
12 BAKERY 10090000
(a) To display the CODE and NAME of all salesperson having “17” item type
code from the table SALESPERSON.
(b) To display all details from table sales person in descending order of
salary.
(c) To display the number of SALESPERSON dealing in each TYPE of
ITEM. (Use ITCODE for the same)
(d) To display NAME of all the salesperson table along with their
corresponding ITEMTYPE from the ITEM table.
(e) Select max(salary) from salesperson;
(f) Select distinct itcode from salesperson;
(g) Select code, name, i.itcode from sales person, item i where
s.itcode=i.itcode and turn over >=7000000;
(h) Select sum (salary) from salesperson where it-code=”i2”

You might also like