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

12th CS PT Set1

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)
30 views

12th CS PT Set1

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/ 4

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 add a new row? 1m
(a) insert (b) create (c) update (d) add
2. Command to remove the row(s) from table student is 1m
(a) drop table student: (b) drop from student:
(c) remove from student: (d) delete from student:
3. Which SQL command is used to add a new attribute in a table? 1m
4. Which clause is used with a SELECT command in SQL to display the records 1m
in ascending order of an attribute?
5. What is the full form of SQL? 1m
(a) Structured Query List (b) Structure Query Language
(c) Sample Query Language (d) None of these
6. Which of the following is not a DDL command? 1m
(a) TRUNCATE (b) ALTER (c) CREATE (d) UPDATE
7. Which of the following are TCL commands? 1m
(a) COMMIT and ROLLBACK (b) UPDATE and TRUNCATE
(c) SELECT and INSERT (d) GRANT and REVOKE
8. Which statement is used to delete all rows in a table without having the action 1m
logged?
(a) DELETE (b) REMOVE (c) DROP (d) TURNCATE
9. SQL Views are also known as 1m
(a) Simple tables (b) Virtual tables (c) Complex tables (d) Actual Tables
10. How many Primary keys can have in a table? 1m
(a) Only 1 (b) Only 2
(c) Depends on no of Columns (d) Depends on no DBA
SECTION B
11. Observe the following table EMPLOYEES and DEPARTMENT carefully and 2m
answer the questions that follows:
Table Employees Table Employees
ENO ENAME DOJ DNO EN DNAME
E1 ANSUR 2001-11-21 D3 O
E2 KABIR 2005-10-25 D1 D1 ACCOUNTS
D2 HR
D3 ADMIN
(i) What is the Degree of the table EMPLOYEES? What is the cardinality
of the table DEPARTMENT?
(ii) What is a Primary Key?
12. Define Primary Key 2m
13. Write the Difference between DDL and DML? 2m

SECTION C
14. Write outputs for SQL queries (i) to (ii), which are based on the following tables 3m
CUSTOMERS and PURCHASES

Table: CUSTOMERS Table: CUSTOMERS


CNO CNAME CITIES SNO QTY PUR_DATE CNO
C1 SANYAM DELHI S1 15 2018-12-25 C2
C2 SHRUTI DELHI S2 10 2018-11-10 C1
C3 MEHER MUMBAI S3 12 2018-11-10 C4
C4 SAKSHI CHENNAI S4 7 2019-01-12 C7
C5 RITESH INDORE S5 11 2019-02-12 C2
C6 RAHUL DELHI S6 10 2018-10-12 C6
C7 AMEER CHENNAI S7 5 2019-05-09 C8
C8 MINAKSH BANGALORE S8 20 2019-05-09 C3
I S9 8 2018-05-09 C9
C9 ANSHUL MUMBAI S10 15 2018-11-12 C5
S11 6 2018-08-04 C7
(i) SELECT COUNT (DISTINCT CITIES) FROM CUSTOMERS;
(ii) SELECT MAX (PUR_DATE) FROM PURCHASE;
(iii) SELECT CNAME, QTY, PUR_DATE FROM CUSTOMERS, PURCHASES
WHRE CUSTOMERS.CNO = PURCHASES.CNO AND QTY IN (10,20);
15. Write SQL queries for (i) to (iv), which are based on the tables: CUSTOMERS 3m
and PURCHASES given in the question
(i) To display details of all CUSTOMERS whose CITIES are neither Delhi nor
Mumbai
(ii) To display the CNAME and CITIES of all CUSTOMERS in ascending order
of their CNAME.
(iii) To display the number of CUSTOMERS along with their respective CITIES
in each of the CITIES
(iv) To display details of all PURCHASES whose quantity is more than 15.
16. Name the SQL command used for the following 3m
(a) To add new record (d) To change the database
(b) To remove a record (e) To display records
(c) To change the name of a column (f) To edit record
17. A table customer contains 5 rows and 7 columns. What will be its cardinality 3m
and degree?
SECTION D
18. Write SQL command for the following: 4m
Table: TEACHER
TID NAME AGE DEPT DATEOFJOI SAL SEX
N
T118 Navin 40 Computer 2010-01-10 12000 M
T10 Chetna 37 History 2008-03-24 20000 F
7
T10 Sandeep 46 Maths 2006-12-12 30000 M
5
T110 Sangeeta 35 History 2010-07-01 25000 F
T10 Rudransh 42 Maths 2004-09-05 40000 M
1
T12 Neeraj 38 Physics 2011-04-01 28000 M
1
(i) To show information about the teachers of the history department.
(ii) To list the names of teachers earning a salary between 20000 and
30000
(iii) To count the number of male teachers.
(iv) Display gender wise total number of teachers.
(v) To list the name and age of teachers of female teachers in
descending order of date of join.
(vi) Increase the salary by 10% for Maths department.
(vii) To delete the record of teacher Neeraj.
19. Write SQL commands for the statements (a) to (h) on the below table: student 4m
and stream
(a) Identify Primary Keys and Foreign Key in the table student and primary
key in stream table given above.
(b) Display stream id and stream-wise total fee collected.
(c) Count no of students from each area.
(d) Display all the student details those who belongs to Madipur Area.
(e) Increase the fees of all students by 10%
(f) Display unique area form the student table.
(g) Display details of those students whose area contains ‘Puri’
(h) Display the information of those students who are in class XII and
section is either B or C
Table: Student
Admno Sname Clas See Fee Mobile Area S_ID
s
1001 RAMESH XII A 2500 987654321 Madipur 10
0
1078 KRISHNA XII B 2400 996591352 Jawala Heri 30
2
1006 FARDEEN XII C 2600 862615482 Paschim Puri 40
5
1004 SUBHAM XII A 2500 868194452 Madipur 20
8
1029 KRITIKA XII C 2700 965254856 Madipur 30
9
1008 SAMEEKSHA XII A 2450 781254962 Mangol Puri 20
2
1025 SALMA XII B 2580 982696123 Madipur 30
5
1036 AMANDEEP XII B 2600 896458231 Khyala 40
8
1037 TEJAS XII C 2650 789654832 Paschim Puri 40
2
1029 HIMANSHU XII A 2750 688594231 Jawala Heri 10
2
Table: Stream
S_ID Stream_name
10 MEDICAL
20 NON MEDICAL
30 COMMERCE WITH MATH
40 COMMERCE WITH IP
50 HUMANITIES
20. Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (vii), 4m
which are based on the tables.
Table: Trainer
TID Tname City HireDate Salary
101 Sunaina Mumbai 1998-10-15 90000
102 Anamika Delhi 1994-12-24 80000
103 Deepti Chandigarh 2001-12-21 82000
104 Meenakshi Delhi 2002-12-25 78000
105 Richa Mumbai 1996-01-12 95000
106 Maniprabha Chennai 2001-12-12 69000

Table: 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 O LEVEL 18000 2018-07-25 105
(a) Display the trainer Name, City and Salary in descending order of their
hire date.
(b) To display the TNAME and CITY of Trainer of joined the institute in the
month of December 2001.
(c) To display TNAME, HIREDATE, CNAME, STARTDATE from tables
TRAINER and COURSE whose FEES is less than or equal to 10000
(d) To display number of trainer from each city\
(e) Select tid, tname, from trainer where city not in (‘delhi’,’mumbai’)
(f) Select distinct tid from course;
(g) Select tid, count(*), min(fees) from course group by tid having
count(*)>1;
(h) Select count(*), sum (fees) form course where startdate<’2018-09-15’;

You might also like