Class 12 Computer Science Solution
Chapter 12 : Simple Queries in SQL
Check Point 12.1
Q1. Maximum how many characters can be stored in a (i) text (ii) numeric literal ?
Ans: (i) 4000 characters (ii) 53 digits
Q2. What is a datatype ? Name some datatypes available in MySQL.
Ans: Datatypes which identify the type of the data and associated operations for handling it.
MySQL datatypes are divided into the three categories :
(a) Numeric : INT, TINYINT, SMALLINT, BIGINT, FLOAT, DECIMAL, DOUBLE,
(b) String : CHAR, VARCHAT, TEXT OR BLOB ,
(c) Date and Time: DATE, TIME, DATETIME, TIMESTAMP, YEAR
Q3. What are fixed length fields ? What are variable length fields ?
Ans: Fixed length fields means a field having fixed number of characters i.e. always consume same amount of memory (bytes). For example CHAR data type filed.
Variable length field means a field can not consume always same number of bytes, it depends up on the size of value. For example, VARCHAR data type field.
Q4. Compare Char and Varchar datatypes.
Ans: CHAR is a fixed length character data type, which consume always same amount of memory, while VARCHAR is a variable length character data type, which does not consume same amount of memory always, it depends on the value.
In case of CHAR, if data entered having less characters compare to size of field, then SQL automatically append space to make it equal to the size, while in variable length its depend on the number of characters entered by user, does not append any space.
In CHAR wastage of memory occurs , while in VARCHAR does not.
Q5. What is null value in MySQL database ? Can you use nulls in arithmetic expressions ?
Ans: NULL is a legal empty value in MySQL. Yes we can use the NULL in arithmetic expressions, but the result of expressions is always NULL.
Q6. Which keyword eliminates the redundant data from a query result ?
Ans: DISTINCT
Q7. Which keyword retains duplicate output rows in a query result ?
Ans: ALL
Q8. How would you display system date as the result of a query ?
Ans: By using CURDATE() / CURRENT_DATE() / CURRENT_DATE with SELECT statement.
SELECT CURRENT_DATE();
Q9. How would you calculate 13 * 15 in SQL ?
Ans: SELECT 13*15;
Q10. Which function is used to substitute NULL values in a query result ?
Ans: IFNULL()
Q11. Which operator concatenates two strings in a query result ?
Ans: CONCAT( ) function is used in MySQL to concatenate.
In Oracle and PostgreSQL you can use the || operator to concatenate two or more strings. And in Microsoft SQL Server, you use the + operator.
Q12. Which comparison operator is used for comparing ?
(i) patterns (ii) character values (iii) null values (iv) ranges (v) list of values,
Ans: (i) LIKE
(ii) Relational Operator
(iii) IS
(iv) BETWEEN
(v) IN
Class 12 Computer Science : Sumita Arora Exercise Solution
- Class 12 Computer Science 083 Ch 2 Python Revision Tour II (Type – C) Sumita Arora Book Exercise Solution
- Class 12 Computer Science 083 Ch 2 Python Revision Tour II (Type – B) Sumita Arora Book Exercise Solution
- Class 12 Computer Science 083 Chapter 5 – File Handling in Python Sumita Arora Book Exercise Solution
- Chapter 3 Working with Functions | Sumita Arora Computer Science with Python CBSE Class 12 book
- Chapter 2 Python Revision Tour II | Sumita Arora Computer Science with Python CBSE Class 12 book
- Chapter 1 Python Revision Tour I | Sumita Arora Computer Science with Python CBSE Class 12 book
- Class 12 Computer Science Sumita Arora Exercise Solution of Ch 12 Simple Queries in SQL
- Class 12 Computer Science Solution Check Point 12.1 Simple Queries in SQL
Class 11 Computer Science : Sumita Arora Exercise Solution