Class 12 IT CRM Domestic Voice session 2 Structured Query Language Questions Answers

Class 12 IT CRM Domestic Voice session 2 Structured Query Language Questions Answers

Dear students, In this page you will get, the questions answers of Class 12 IT CRM Domestic Voice session 2 Structured Query Language. The questions answers have been prepared taking the reference of class 12 IT book CRM Domestic Voice published by NCERT.

Check Your Progress

A. Multiple Choice Questions

  1. Which of the following is not a valid aggregate function ?

(a) COUNT

(b) COMPUTE

(c) SUM

(d) MAX

Ans : (b) COMPUTE

2. DDL stands for ___________

(a) Data Describe Language

(b) Definition Data Language

(c) Data Definition Language

(d) Data Distinct Language

Ans: (c) Data Definition Language.

3. Which of the following SQL command is used to remove data from table ?

(a) Collapse

(b) Remove

(c) Alter

(d) Delete

Ans: (d) Delete

4. The records and structure of a table may be removed or deleted from the database using which command ?

(a) Remove

(b) Delete

(c) Drop

(d) Truncate

Ans: (c) Drop

5. SQL ____________ statement can be used to delete or drop existing databases in a SQL schema.

(a) Create Database

(b) Rename Database

(c) Drop Database

(d) Select Database

Ans: (c) Drop Database

6. Using DROP TABLE command in SQL

(a) Drop the table structure

(b) Drop the Integrity constraints

(c) Drop the Relationship

(d) All of the above

Ans: (d) All of the above

8. TRUNCATE TABLE requires

(a) Where Clause

(b) Having Clause

(c) Both A and B

(d) None of the above.

Ans: (d) None of the above.

9. Which of the following clause is used to add a Primary Key constraint after creating table ?

(a) Update

(b) Add

(c) Alter

(d) Join

Ans: (b) Add

10. Which of the following Clause is used to remove a primary key constraint ?

(a) Delete

(b) Drop

(c) Alter

(d) Remove

Ans: (b) Drop

11. Which of the following SQL statement is used to give result in sorted order ?

(a) Sort By

(b) Order

(c) Order By

(d) Sort

Ans: (c) Order By

12. Commands under DCL are ……………

(a) GRANT

(b) REVOKE

(c) Both A and B

(d) None of the above

Ans: (c) Both A and B

13. The SQL command to retrieve table records is ………..

(a) RETRIEVE

(b) SELECT

(c) CREATE

(d) ALTER

Ans: (b) SELECT

14. Which of the following operator is used for pattern matching in SQL ?

(a) BETWEEN operator

(b) LIKE operator

(c) EXISTS operator

(d) None of these

Ans: (b) LIKE operator

15. Which operator is used to check the absence of data in any column ?

(a) EXISTS operator

(b) NOT operator

(c) IS NULL operator

(d) None of these

Ans: (c) IS NULL operator

16. Which of the following keyword is used to select only unique values from any column ?

(a) DISTINCTIVE

(b) UNIQUE

(c) DISTINCT

(d) DIFFERENT

Ans: (c) DISTINCT

B. Fill in the blanks

  1. SQL is divided in ………………………… 5 category.

Ans: 5

2. The ………………….. command is used to see the structure of table.

Ans: Desc

3. The ……………….. command is used to remove all records.

Ans: Drop table

4. The ………………. command is used to add an attribute in an existing table.

Ans: Alter

5. The ……………. command is used to remove all records only from a table.

Ans: Truncate

6. The ………….. command is used to remove an attribute from a table.

Ans: Drop

7. A view is a special kind of ……………. table.

Ans: virtual

8. Views can be created from ……………… or more tables.

Ans: one

9. Grant and Revoke are part of ……………. in SQL.

Ans: DCL

10. Commit and Savepoint are part of ……………… in SQL.

Ans: TCL

11. To sort the result of a query in descending order, we can use clause …………..

Ans: order by desc

12. To extract unique values from a column, user can use ……………. clause.

Ans: distinct.

C. State whether true or false

  1. INSERT clause is used to add a Foreign constraint.

Ans: False

2. ALTER clause is used to add a primary key constraint after table is created.

Ans: True

3. DROP command is used to delete the structure of a table from the database.

Ans: True

4. Updation and deletion of records are part of DDL.

Ans: False

5. Insert into statement is useful to insert a new field in any table.

Ans: False

6. Aggregate functions are mostly used with the SELECT statement.

Ans: True

7. DML is used to create a new database objects like table and view.

Ans: False

8. A new table can be created from existing tables.

Ans: False

9. The name of any tables once its created and records are inserted cannot be changed.

Ans: False

10. The name of any tables once its created and records are inserted can not be changed.

Ans: False

D. Short answer questions

  1. What do you understand by SQL ?

Ans: SQL stands for Structured Query Language. SQL is a special kind of query language used to access and manipulate data from the database. It is used to search, store, modify records in database management system.

SQL মানে Structured Query Language। SQL হৈছে বিশেষ ধৰণৰ অনুসন্ধান ভাষা যি ডাটাবেছৰ পৰা তথ্য লাভ আৰু ডাটাবেছত তথ্য পৰিৱৰ্তন কৰে। এইটো ব্যৱহাৰ কৰা হয় ডাটাবেছ পৰিচালনা ব্যৱস্থাত ৰেকৰ্ড চাবলৈ, সাঁচিবলৈ, পৰিৱৰ্তন কৰিবলৈ।

2. SQL Statements are classified in how many ways ?

Ans: SQL statements are classified in 5 ways such as DDL, DML, DQL, TCL and DCL.

SQL Statement ৫টা ভাগত ভাগ কৰা হৈছে, যেন DDL, DML, DQL, TCL আৰু DCL.

3. Differentiate between DDL and DML.

Ans: i. DDL stands for Data Definition Language whereas DML stands for Data Manipulation Language.

DDL ৰ সম্পুৰ্ণ ৰুপ হৈছে Data Definition Language আনহাতে DML ৰ সম্পুৰ্ণ ৰুপ হৈছে Data Manipulation Language.

ii. DDL provides the commands for defining the relation schema, modifying relation schema and deleting relations on the other hand DML include commands to insert, delete and update records in tables.

DDL relation schema সংজ্ঞায়িত কৰোঁতাৰ বাবে কমাণ্ডসমূহ, relation schema সলনি কৰোঁতাৰ বাবে আৰু টেবুল delete কৰাৰ বাবে command সমুহ সংজ্ঞায়িত থাকে আনহাতে DML ত টেবুলত ৰেকৰ্ড সংযোজন, মুচি পেলোৱা আৰু আপডেট কৰিবলৈ কমাণ্ডসমূহ অন্তৰ্ভুক্ত থাকে।

4. Differentiate between DCL and TCL

Ans: i. DCL stands for Data Control Language whereas TCL stands for Transaction Control Language.

ii. DCL provides the commands to manage users for their work permission. The user will be able to work as per the permissions granted to them by DBA. DCL include the commands GRANT and REVOKE which are used to provide rights and permissions to user. On the other hand, TCL include the commands to permanently change the databases or undo the databases transactions. It is similar to save the database or undo the current changes. The COMMIT, ROLL BACK and SAVEPOINT are the statements come under this category.

DCL ব্যৱহাৰকাৰীসকলৰ কাৰ্যৰ অনুমতিৰ ব্যৱস্থাপনা কৰিবলৈ আদেশসমূহ প্রদান কৰে। ব্যৱহাৰকাৰীজনে DBA-ৰ দ্বাৰা প্ৰদান কৰা অনুমতিৰ আধাৰত কাম কৰিব পাৰে। DCL-ত GRANT আৰু REVOKE আদেশসমূহ অন্তর্ভুক্ত থাকে, যি ব্যৱহাৰকাৰীলৈ অধিকাৰ আৰু অনুমতি প্ৰদান কৰিবলৈ ব্যৱহৃত হয়। আনহাতে, TCL-ত স্থায়ীভাৱে ডাটাবেছসমূহৰ পৰিবৰ্তন কৰিবলৈ অথবা ডাটাবেছৰ লেনদেনসমূহ undo কৰাৰ আদেশসমূহ অন্তর্ভুক্ত থাকে। ইয়াৰ ফলত, এইটো ডাটাবেছ সংৰক্ষণ কৰা বা বৰ্তমানৰ পৰিৱৰ্তনসমূহ উলটাৰ দৰে। COMMIT, ROLL BACK আৰু SAVE POINT এই শ্ৰেণীত অহা statement

5. What is the difference between ALTER and UPDATE command ?

Ans: i. ALTER command is a DDL statement whereas UPDATE command is a DML statement.

ALTER কমাণ্ড এটা DDL স্টেটমেন্ট আৰু UPDATE কমাণ্ড এটা DML স্টেটমেন্ট।

ii. ALTER command is used to make changes in the structure of a table like adding, removing column and constraint such as primary key, foreign key and changing datatype of column(s) on the other hand, UPDATE command is used to make changes in existing data value(s) of one or more columns of existing records in a table.

ALTER কমাণ্ডটো টেবুলৰ গঠন সলনি কৰিবলৈ ব্যৱহাৰ হয় যেনে নতুন column সংযোগ কৰা, column আৰু constraint যেনে primary key, foreign key আঁতৰোৱা আৰু column ৰ ডেটাটাইপ সলনি কৰাটো UPDATE কমাণ্ডটো টেবুলৰ বিদ্যমান ৰেকৰ্ডৰ এক বা অধিক column ৰ বিদ্যমান ডেটা value সলনি কৰিবলৈ ব্যৱহাৰ হয়।

6. Differentiate between DELETE and DROP command.

Ans: i. DELETE command is a DML statement whereas DROP command is a DDL statement.

ii. DELETE command is used to delete one or more records from a table on the other hand DROP command is used to remove a database or a table permanently from the database system.

DELETE command এক বা ততোধিক ৰেকৰ্ড একেটা টেবুলৰ পৰা মচাৰ বাবে ব্যৱহাৰ কৰা হয়, আনহাতে DROP command টোৱে এটা ডেটাবেচ বা এটা টেবুল ডেটাবেচ প্ৰণালী পৰা স্থায়ীভাৱে মচাৰ বাবে ব্যৱহাৰ কৰা হয়।

7. What is create statement ? How many database objects can be created using this ?

Ans: Create statement is used to create database and its objects.

Create statement ডেটাবেছ আৰু ইয়াৰ object বোৰ সৃষ্টি কৰিবলৈ ব্যৱহাৰ কৰা হয়।

Create statement is used to create 2 database objects like Table and View

Create Statement ডেটাবেচৰ ২টা object যেনে টেবুল (table) আৰু ভিউ (view) সৃষ্টি কৰিবলৈ ব্যৱহাৰ কৰা হয় ।

8. Write the CREATE statement to create the following relations with given constraints.

Book(ISBN Text), Title(Text), Author(Text), PubID(Text), Price( Numeric), Pages (Numeric)

Here ISBN is primary key field and remaining all are Not Null.

Ans:

9. Modify the Book table in previous question and add one more new field Discount (Numeric).

Ans:

10. Shyam has created one database name Mycontacts but he is not able to create new table in this database. What command should Shyam be used before creating the table?

Ans:

11. Mr. Sachin Agrawal created two tables with Course as Primary key in Table 1 and Foreign Key in Table 2 while inserting new row in second Table 2, Mr. Agrawal is not able to insert new value in the column City. What could be the possible reason for this ?

Ans:

Leave a Comment