0% found this document useful (0 votes)
9 views3 pages

Copy of XI Periodic Test 2

The document outlines a question paper structured into five sections (A to E) with a total of 13 questions, all of which are compulsory. Each section varies in the number of questions and marks assigned, covering topics such as database keys, data types, SQL commands, and data redundancy. The questions include multiple-choice, short answer, and SQL command tasks.

Uploaded by

Deepti J Sharma
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)
9 views3 pages

Copy of XI Periodic Test 2

The document outlines a question paper structured into five sections (A to E) with a total of 13 questions, all of which are compulsory. Each section varies in the number of questions and marks assigned, covering topics such as database keys, data types, SQL commands, and data redundancy. The questions include multiple-choice, short answer, and SQL command tasks.

Uploaded by

Deepti J Sharma
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/ 3

General Instructions:

1. This question paper contains five sections, Section A to E.


2. All questions are compulsory.
3. Section A has 5 questions carrying 01 mark each.
4. Section B has 3 questions carrying 02 marks each.
5. Section C has 2 questions carrying 03 marks each.
6. Section D has 2 questions carrying 04 marks each.
7. Section E has 1 question carrying 05 marks.
________________________________________________________________________________________________________

SECTION A

1. Consider the table with structure below,which attribute will form the 1
Primary key?
Student(ID,name,deptname,tot_cred)

(a) Name (b) Dept name (c)Total credits (d) ID

2. It will add, modify or drop any column or constraints. 1


(a) DML commands (b) DCL commands (c) TCL commands (d) none

3. CREATE TABLE student (name CHAR(30),student_id INT,gender 1


CHAR(1),PRIMARY KEY (student_id));

The degree of student table from the above code snippet is:
(a) 30 (b) 1 (c) 3 (d) 4

4. The datatypes CHAR(n) and VARCHAR(n) are used to create _______ and 1
_________ types of string/text fields in a database.
(a) Fixed,equal (b) Equal, variable
(c) Fixed, variable (d) Variable, equal

5. SELECT NAME FROM CLASS WHERE SUBJECT ________ NULL; 1


Which comparison operator(s) may be used to fill the blank space in the
above query?
(a) = (b) LIKE (c) IS (d) IS NOT

SECTION B

6. What is data redundancy? How can it be controlled? 2

7. Suppose that all the customers of a particular business live in states for 2
which the city name is unique. Given the following description for customer
data:
CUST-ID, CUST-NAME, STREET, CITY, STATE, PHONE)

1
(a) List the most likely attribute for the primary key.

(b) List all the candidate keys and alternate keys.

8. Differentiate between CHAR and VARCHAR Datatypes. Give an example. 2

SECTION C

9. What is the difference between NOW() and SYSDATE(). Explain with an 3


example.

10. Create a table Job with following specification: 3

Name of Column Type specification


Job_ID Number(4) Primary Key
Job_des Varchar(30) cannot be left blank
Alloc_on Date cannot be left blank
Due_on Date cannot be left blank
Emp_id Number(4) foreign key here that is related to the
ID
column of an earlier created table
Employee.

SECTION D

11. Q. Define the following: 4


(a) Primary key
(b) Candidate key
(c) Alternate key
(d) Foreign key

12. (a) Write SQL command to create table ABC with following details: 2

Field Data type Size


Rollno Integer 3
Name Varchar 25
DOB Date
Class Varchar 5 1

(b) Write the command to now add the primary key on the column Rollno. 1

(c)Write the command to add another column Aadhar_no of datatype


integer in the existing table.

SECTION E

13. Write SQL commands for the following on the basis of given table SPORTS: 5
StNo Class Name Game1 Grade1 Game2 Grade2
10 7 Sameer Cricket B Swimming A
11 8 Sujit Tennis A Skating C

2
12 7 Kamal Swimming B Football B
13 7 Veena Tennis C Tennis A
14 9 Archana Basketball A Cricket A
(a) Display the names of the students who have grade 'A' in either Game1
or Game2 or both.
(b) Display the names of students who have the same game for both
Game1 and Game2.
(c) Display the games taken by the students whose name starts with 'A'.
(d) Give the output of the following sql statements:
(i) select count(*) from SPORTS;
(ii) select distinct Class from SPORTS;

You might also like