Please refer to Querying and SQL Functions MCQ Questions Class 12 Informatics Practices below. These MCQ questions for Class 12 Informatics Practices with answers have been designed as per the latest NCERT, CBSE books, and syllabus issued for the current academic year. These objective questions for Querying and SQL Functions will help you to prepare for the exams and get more marks.
Querying and SQL Functions MCQ Questions Class 12 Informatics Practices
Please see solved MCQ Questions for Querying and SQL Functions in Class 12 Informatics Practices. All questions and answers have been prepared by expert faculty of standard 12 based on the latest examination guidelines.
MCQ Questions Class 12 Informatics Practices Querying and SQL Functions
Question. Select operation in SQL is equivalent to
a) the selection operation in relational algebra
b) the selection operation in relational algebra, except that select in SQL retains duplicates
c) the projection operation in relational algebra
d) the projection operation in relational algebra, except that select in SQL retains duplicates
Answer
D
Question. Identify single-row functions of MySQL amongst the following.
a) TRIM()
b) MAX()
c) ROUND()
d) Both (a) and (c)
Answer
D
Question. Which of the following SQL commands retrives data from tables ?
a) UPDATE
b) SELECT
c) Union
d) All of these
Answer
B
Question. Which operator tests a column for the absence of data(i.e. NULL value) ?
a) Exist Operator
b) NOT Operator
c) IS Operator
d) None of these
Answer
C
Question. Logical operator used in SQL are:
a) AND, OR, NOT
b) &&, ||, !
c) $,|,!
d) None of these
Answer
A
Question. In how many parts are the SQL functions are divided into?
a) 1
b) 2
c) 3
d) 4
Answer
B
Question. In case to prevent the endless loop in CTE, ____ is added.
a) MAXLINEAR
b) MAXROUND
c) MAXRECURSION
d) None of the above
Answer
C
Question. Which operator is used to compare the NULL values in SQL?
a) Equal
b) IN
c) IS
d) None of Above
Answer
C
Question ______ is NOT a type of constraint in SQL language?
a) FOREIGN KEY
b) PRIMARY KEY
c) UNIQUE
d) ALTERNATE KEY
Answer
D
Question. What is the need for our query to execute successfully on an existing view?
a) The specified table must contain data.
b) We must have a SELECT privilege on the view.
c) We should have a SELECT privilege only on the specified table.
d) The specified table must be in the same database or schema.
Answer
B
Question. SQL BETWEEN is a ________operator.
a) Relational
b) Logical
c) Arithmetic
d) Assignment
Answer
B
Question. __________ are used for supporting encryption, decryption, digital signing and their validation.
a) Cryptographic functions
b) Cursor functions
c) Configuration functions
d) None of the mentioned
Answer
A
Question. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
a) Data Definition Language(DDL)
b) Data Manipulation Language(DML)
c) Both of above
d) None
Answer
A
Question. ______________ function returns current date and time.
a) SET DATEFIRST
b) SYSDATETIME
c) Cert_ID
d) GETDATE
Answer
D
Question. Which of the following is not a legal sub-language of SQL ?
a) DDL
b) QAL
c) DML
d) TCL
Answer
B
Question. What does SQL is used to perform operations on?
a) Update Records
b) Insert Records
c) Both A and B
d) None of the above
Answer
C
Question. Which clause is needed in CTE SQL syntax?
a) FOR
b) AS
c) WITH
d) TO
Answer
C
Question. What does AVG() function returns?
a) First value of the column
b) Last value of the column
c) Sum of rows of the table
d) Average value of the column
Answer
D
Question. In order to manage or store the data in the database, WEB SQL Database is used which is a –
a) Web site
b) Web page
c) Web browser
d) None of the above
Answer
B
Question. Which of the following attributes cannot be considered as a choice for Primary Key ?
a) Id
b) License number
c) Dept_Id
d) Street
Answer
D
Question. __________ SQL command changes one or more fields in a record.
a) LOOK-UP
b) INSERT
c) MODIFY
d) CHANGE
Answer
C
Question. In order to merge two or more strings, which string function is used?
a) CHAR
b) ALTER
c) CONCAT
d) MERGE
Answer
C
Question: Which of the following statements will delete all rows in a table namely mytablewithout deleting the table’s structure.
a) DELETE FROM mytable;’
b) DELETE TABLE mytable;
c) DROP TABLE mytable;
d) None of these.
Answer
A
Question: Which of the following requirement can be implemented using a CHECK constraint?
a) Student must be greater than 18 years old.
b) Student must be form a BRICS Country (Brazil, Russia, India, China, South Africa)
c) Student’s roll number must exist in another table(say, namely Eligible)
d) None of these
Answer
a) and c)
Question: Data integrity constraints are used to :
a) Control the access and rights for the table data.
b) Ensure the entry of unique records in a table.
c) Ensure the correctness of the data entered in the table as per some rule or condition etc.
d) Make data safe from accidental changes.
Answer
C
Question: An attribute in a relation is termed as a foreign key when it reference the _____ of another relation.
a) Foreign Key
b) Primary Key
c) Unique Key
d) Check Constraint
Answer
B
Question: A relationship is formed via _______ that relates two tables where one table references other table’s key.
a) Candidate Key
b) Primary Key
c) Foreign Key
d) Check Constraint
Answer
B
Question: What should be the data type for the column Pricestoring values less than Rs.1000 e.g. 200.21
a) VARCHAR(50)
b) NUMBER
c) NUMBER(5,2)
d) NUMBER(6)
Answer
C
Question: What is anamein the following SQL Statement ?
SELECT aname FROM table1 UNION SELECT aname FROM table2;
a) row name
b) column Name
c) table name
d) database name
Answer
B
Question: Data manipulation language (DML) includes statements that modify the_____ of the tables of database.
a) Structure
b) Data
c) User
d) Size
Answer
B
Question. ___ is not a category of SQL command.
a) TCL
b) SCL
c) DCL
d) DDL
Answer
B
Question: What is the maximum value that can be stored in NUMBERIC(4,2)?
a) 9999.99
b) 99.9999
c) 99.99
d) 9.99
Answer
C
CASE STUDY BASED QUESTIONS
A library uses database management system(DBMS) to store the details of the books that it stocks, its registered membes and the book-loan that the library has made. These details are
stored in a database using the following three relations. Name of the Database : KV Library
• Book (BookID : Char(5), Title : Varchar(25), Author :Varchar(25), Publisher :
Varchar(100))
• Member(MemberID:Char(5), LastName:Varchar(25), FirstName:Varchar(25),
Correspondence-Address : Varchar(100), Pincode : Char(6), DateofBirth : Date,
EmailID : Varchar(50))
• Loan(MemberID: Char(5), BookID:Char(5), LastDate:Date, DueBackDate:Date,
Returned :Boolean)
Note : The Library does not stock more than one copy of the same book.
Question: Can a relation have multiple foreign keys? Give example.
Answer: Yes, a relation can have multiple foreign keys, e.g., the loan relation given above has
two foreign keys – MemberID and BookID
Question: Can a foreign key be part of a primary key? Give example.
Answer: Yes, a foreign key can be a part of composite primary key, e.g., the primary key of
relation loan is : (MemberID, BookID, LoanDate), which contains two foreign keys :
MemberID and BookID.
Question: Identify following types of keys from all the relations of the given database Foreign keys along with parent relations.
Answer: Foreign Keys in Relation Loan
MemberID(Parent Table Member)
BookID (Parent Table Book)
Question: Write a SQL query to retrieve the names and email addresses of the members belonging to KVS (they have email ids as _____@kvs.in) and wo have not returned their books.
Answer: Select FristName,LastName, EmailID
From Member, Loan
Where Member.MemberID=Loan.MemberID
Fill in the Blanks
Question: The ________ command of SQL lets you make queries to fetch data from tables.
Answer
SELECT
Question: The SQL keyword _______ is used to specify the table(s) that contains the data to be retrieved.
Answer
FROM
Question: To obtain all columns, use a(n) _______ instead of listing all the column names in the select list.
Answer
ASTRIK(*)
Question: To remove duplicate rows from the result of a query, specify the SQL qualifier_____ in select list.
Answer
DISTINCT
Question: The SQL keyword _______ is used in SQL expressions to select records based on patterns.
Answer
6 LIKE
Question: The ________ operator is used for making range checks in SELECT queries.
Answer
BETWEEN
Question: The null values in a column can be searched for in a table using _____ ______ in the WHERE clause of SELECT query.
Answer
8 IS NULL
Question: The SQL _______ clause contains the condition that specifies which rows are to be selected.
Answer
5 WHERE
Question: Columns can be sorted in descending sequence by using the SQL keyword ________.
Answer
DESC
Question: To sort the rows of the result table, the _____ _____ clause is specified.
Answer
ORDER BY
True and False Questions
Question: SQL provides the AS keyword, which can be used to assign meaningful column name to the results of queries using the SQL built-in functions.
Answer
True
Question: SELECT DISTINCT is used if a user wishes to see duplicate columns in a query.
Answer
False
Question: SQL is a programing language.
Answer
False
Question: DELETE FROM <table> command is same as DROM TABLE <table> command.
Answer
False
Question: Unique and Primary Key constraints are the same.
Answer
False
Question: Tuple based constraints can use multiple columns of the table.
Answer
False
Question: Truncate() is a text function.
Answer
False
Question: The unique constraint can only be defined once in the CREATE TABLE command.
Answer
False
Question: The table based constraints can use multiple column of the table.
Answer
True
Question: You can add a column with a NOT NULL constraint using ALTER TABLE, only to a table that contains no rows.
Answer
True