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

SQL Query Paper

This document contains a SQL practice test with multiple choice and true/false questions about SQL concepts and syntax. It also includes examples of SQL queries against a sample student data table to test SELECT statement skills. Some key points covered include: 1. Keys help enforce integrity and define relationships between tables. 2. The MAX() function returns the maximum value of a selected column. 3. A table is a set of rows and columns with attributes represented as rows and data as columns. The document evaluates knowledge of SQL data definition and manipulation commands, data types, basic query syntax, and ability to retrieve data based on conditions.

Uploaded by

kesar chouhan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

SQL Query Paper

This document contains a SQL practice test with multiple choice and true/false questions about SQL concepts and syntax. It also includes examples of SQL queries against a sample student data table to test SELECT statement skills. Some key points covered include: 1. Keys help enforce integrity and define relationships between tables. 2. The MAX() function returns the maximum value of a selected column. 3. A table is a set of rows and columns with attributes represented as rows and data as columns. The document evaluates knowledge of SQL data definition and manipulation commands, data types, basic query syntax, and ability to retrieve data based on conditions.

Uploaded by

kesar chouhan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL– Grade XI – Informatics Practices

Choose the correct answer

1) ___________________ helps to enforce the integrity and identify the relationship between tables.
a) Row b) Columns c) Key d) None of these
2) The MAX() function finds the ___________
a) Maximum number of records entered in a table
b) Maximum number of rows allowed to be entered
c) Maximum value of the selected column
d) None of these
3) Number of attributes in a relation is called__________
a) size b) degree c) cardinality d) weight
4) __________is used to refer to a row.
a) attribute b) tuple c) field d) instance
5) How do you select only one column ‘Name’ from a table named ‘Employee’?
a) Select {all} from Employee;
b) Select ‘Name’ from Employee;
c) Select Name from Employee;
d) Select from Employee Name

Q6 and 7 are ASSERTION AND REASONING based questions. Mark the correct choice as

a) Both A and R are true and R is the correct explanation for A


b) Both A and R are true and R is not the correct explanation for A
c) A is True but R is False iv.
d) A is false but R is True

6) Assertion (A): DDL stands for Data Definition Language

Reason (R): These commands define the structure of the database

7) Assertion (A): A table is a set of rows and columns

Reason (R): Attributes of the entity are represented as rows and data about the entities as columns

Answer the following


1. What is SQL?
2. What are the different types of statements in SQL?
3. What is the difference between char and varchar datatype in SQL?
4. Name the SQL command used to
(a) Physically delete a table from a database.
(b) Display the structure of a table.
(c) To use a particular database
(d) Display the table data either in ascending or descending order.
(e) To change the existing data from a table.
5. Consider the following table- NewStudent

Admno Name Stream Optional Average


1001 Shristi Science CS 90
1002 Ashi Humanities NULL 80
1003 Aditya Commerce IP NULL
1004 Ritu Science NULL 65
1005 Sonali Commerce Maths 60
1006 Saumya Science IP 65
1007 Ashutosh Science IP NULL
1008 Prashant Science PE 65
1009 Aman Commerce IP 95
1010 Rishabh Commerce Ent 70

(i) To display the details of all those students who have PE as their optional subject.
(ii) To display name, stream and optional of all those students whose name starts with ‘S’.
(iii) To display name of all those students who have average less than 80.
(iv) To display name of all those students who have average in the range of 80 to 90.
(v) To display the details of all those students whose stream is either Humanities or Commerce.
(vi) To display distinct stream available in the table.
(vii) To display the Name,Stream and Average of all those students who are from Commerce stream and Average
is not above 80.
(viii) To display details of all students other then ‘Aditya’ and ‘Prashant’.
(ix) To change average = 70 where average is null.
(x) On the basis of the Table NewStudent, write the output (s) produced by executing the following queries:
1. Select Stream from NewStudent where Name not Name like “%tosh”;
2. Select name from NewStudent where optional IN (‘Maths’,’Ent’);

You might also like