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

PT TEST-1 A2

This document is a periodic test for Grade XII Computer Science students, covering various SQL concepts and commands. It includes multiple choice questions, short answer questions, and SQL query writing tasks based on provided tables. The test assesses students' understanding of database management and SQL syntax, with a total of 40 marks available.

Uploaded by

Shibhi Siddarth
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)
34 views

PT TEST-1 A2

This document is a periodic test for Grade XII Computer Science students, covering various SQL concepts and commands. It includes multiple choice questions, short answer questions, and SQL query writing tasks based on provided tables. The test assesses students' understanding of database management and SQL syntax, with a total of 40 marks available.

Uploaded by

Shibhi Siddarth
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

AKR ACADEMY SCHOOL (CBSE)

PERIODIC TEST-1 (JUNE)

GRADE:XII COMPUTER SCIENCE(083) MARKS:40

I.ANSWER THE FOLLOWING 6*1=6

1. Which of the following is not an aggregate function?


a)MIN() b)SUM() c)UPPER() d)COUNT()

2. Which keyword is used to eliminate duplicate values in an SQL select query?


A )unique b) distinct c) key d) all
3. Which of the following commands will delete the rows of table? (a) DROP command (b) DELETE
Command (c) REMOVE Command (d) ALTER Command
4. Which SQL operator performs pattern matching?
a. BETWEEN operator b. LIKE operator c. EXISTS operator d. =
5. Fill in the blank:

DROP TABLE Employee; is a _________ type of statement.

(a) DDL (b) DCL (c) DML (d) TCL


6. Which of the following commands will make changes in the column

values of a table in MYSQL database?

(a) CREATE (b) UPDATE (c) ALTER (d) INSERT

II. ANSWER THE FOLLOWING 3*2=6

7. Observe the table ‘Club’ given below:

8. What do you understand by Alternate Keys in a table? Give a suitable


example of Alternate Keys from a table containing some meaningful data.

9. Differentiate ORDER BY and GROUP BY with an example.


III. ANSWER THE FOLLOWING 2*3=6

10. Write the outputs of the SQL queries (i) to (iii) based on the relations car and customer give below

i. Select make, count(*) from Car group by make having count(*)<2;

ii. Select Cname, Make from Car order by charges desc;

iii. Select Custname, Cname from Car R, Customer C where

R.Ccode=C.Ccode:

11. Consider the following tables CABHUB and CUSTOMER


CABHUB
IV. ANSWER THE FOLLOWING

12. Write the SQL commands for the following questions (i) to (v) based on the

relations Car and Customer given below: (5)

(i) To display the Names and Charges of all the Silver coloured cars.

(ii) To display the non duplicate car codes in the customer table.

(iii) To display the Minimum and Maximum car charges.

(iv) To give a discount of 10% in the car charges for existing customers (who

are in the customer table).

(v) To display Name and Make of cars whose charges is in the range 2000

to 3000 (both inclusive).

13. A Book store Current Books is planning to store their book details in a database using SQL. As a
database administrator, Poorvekka has decided that: (4)
(a) Name of the database – CB
(b) Name of the table - Collections
(c) The attributes of Collections are as follows:
BookNo - Numeric
BookName – Character of size 25
Price – Numeric
Quantity – Numeric
I) Identify the attribute best suitable to be declared as a primary key,

i) Write the degree and cardinality of the table Collections.

iii) Write SQL command to increment the quantity by 20 wherever

quantity is below 50.

iv) Poorvekka wants to remove the entire data from tableCollections.

Which command will she use from the following:

a. DELETE FROM Collections; b. DELETE Collections;

c. DROP DATABASE CB; d. DELETE * FROM Collections;

14. Consider the following tables FACULTY and COURSES. Write SQL commands for the statements
(1) to (4) and give outputs for SQL queries (5) to (6). (6)

i) To display details of those Faculties whose salary is greater than 12000.


ii) To display the details of courses whose fees is in the range of 15000 to 50000 (both values
included).
iii) To increase the fees of all courses by 500 of “System Design” Course.
iv) To display details of those courses which are taught by ‘Sulekha’ in descending order of courses.
v) Select COUNT(DISTINCT F_ID) from COURSES;
vi ) Select MIN(Salary) from FACULTY,COURSES where COURSES.F_ID = FACULTY.F_ID;
15. Write SQL commands for the queries (1) to (4) and output for (5) to (7) based on the tables
‘Watches’ and ‘Sale’ given below. (7)

i) To display all the details of those watches whose name ends with ‘Time’
ii) To display watch’s name and price of those watches which have price range in between 5000-
15000.
iii) To display total quantity in store of Unisex type watches.
iv) To display watch name and their quantity sold in first quarter.
v) select max(price), min(qty_store) from watches;
vi) select quarter, sum(qty_sold) from sale group by quarter;
vii) select watch_name,price,type from watches w, sale s where w.watchid!=s.watchid;

You might also like