Database Part -II MYSQL | Chapter 3 |  Class 10 Computer Science 571(NCERT) Question and Answer |    Class 10 Computer Science 571 (NCERT) Question and Answer Solutions English Medium |

Database Part -II MYSQL

Chapter 3


Exercise


1. MULTIPLE CHOICE QUESTIONS:


1. The command used to modify the content of a table is:

1. তালিকা এখনৰ সমল পৰিবৰ্তন কৰিবলৈ ব্যৱহৃত কমাণ্ডটো হৈছে:

a) ALTER TABLE

ক) তালিকা সলনি কৰক

b) SELECT

খ) বাছনি কৰক

c) UPDATE

গ) আপডেট

Ans: c) UPDATE (আপডেট)

2. The command used to display the table structure is:

টেবুল গঠন প্ৰদৰ্শন কৰিবলৈ ব্যৱহাৰ কৰা আদেশটো হ'ল:

a) DISPLAY

ক) প্ৰদৰ্শন কৰা

b) STRUCTURE

খ) গঠন

c) DESCRIBE

গ) বৰ্ণনা কৰা

Ans:  c) DESCRIBE (গ) বৰ্ণনা কৰা)

3. A table name should begin with:

(এটা টেবুলৰ নাম আৰম্ভ হ’ব লাগে:)

a) Number

ক) সংখ্যা

b) Alphabet

খ) বৰ্ণমালা

c) Symbol

গ) প্ৰতীক

Ans: b) Alphabet (খ বৰ্ণমালা)

4. The command used to delete the database physically:

(ডাটাবেছ দৈহিকভাৱে মচি পেলাবলৈ ব্যৱহৃত আদেশ:)

a) DELETE

ক) বিলোপ কৰক

b) ERASE

খ) মচি পেলোৱা

c) DROP

গ) ড্ৰপ

Ans: c) DROP (গ ড্ৰপ)

5. This wildcard character allows finding a match for any string of any length, including zero length:

(এই ৱাইল্ডকাৰ্ড আখৰে যিকোনো দৈৰ্ঘ্যৰ যিকোনো ষ্ট্ৰিঙৰ বাবে এটা মিল বিচাৰি উলিওৱাৰ অনুমতি দিয়ে, শূন্য দৈৰ্ঘ্য অন্তৰ্ভুক্ত কৰি:)

a) *

b) %

c) #

Ans: 

6. This operator displays only those records that do not satisfy the specified condition,

(এই অপাৰেটৰে কেৱল সেই ৰেকৰ্ডসমূহ প্ৰদৰ্শন কৰে যিয়ে নিৰ্দিষ্ট চৰ্ত পূৰণ নকৰে,)

a) AND

b) OR

c) NOT

Ans: C) NOT

II. FILL IN THE BLANKS:

(খালী ঠাই পূৰণ কৰক:)

1. MySQL is named after co-founder Michael Widenius's daughter, _____________.

MySQL ৰ নামকৰণ কৰা হৈছে সহ-প্ৰতিষ্ঠাপক মাইকেল ৱাইডেনিয়াছৰ কন্যা _____________ৰ নামেৰে।

Ans:

2. The number of rows denotes the               of the table.

 শাৰীৰ সংখ্যাই টেবুলৰ ______________ বুজায়।

Ans: The number of rows denotes the    cardinality  of the table

3. The number of _____________ denotes the Degree of the table.

_____________ সংখ্যাই টেবুলৰ ডিগ্ৰী বুজায়।

Ans: The number of column denotes the Degree of the table

4. _____________ words are not allowed in a table name.

টেবুলৰ নামত _____________ শব্দৰ অনুমতি নাই।

Ans: Reserved Words are not allowed in a table name. 

 5. A MySQL statement is terminated by a _______________.

এটা MySQL বিবৃতি এটা _______________ দ্বাৰা সমাপ্ত কৰা হয়।

Ans: A MySQL statement is terminated by a terminating semicolon.

6. The underscore wildcard allows finding a match for any ______________ character.

আণ্ডাৰস্কোৰ ৱাইল্ডকাৰ্ডে যিকোনো ______________ চৰিত্ৰৰ বাবে এটা মিল বিচাৰি উলিওৱাৰ অনুমতি দিয়ে।

Ans: The underscore wildcard allows finding a match for any single character.


III. ANSWER THE FOLLOWING QUESTIONS:

তলত দিয়া প্ৰশ্নবোৰৰ উত্তৰ দিয়ক:

1. Who were the developers of MySQL?

MySQL ৰ ডেভেলপাৰ কোন আছিল?

Ans: Mysql was created by a Swedish company, MySQL AB, founded by Swedish David Exmark, Alan Larsen, and Finnish Swedish Michael "Monty" Wydenius. The original development of MySQL by Weidenius and Xmark began in 1994. The first edition of MySQL was published on May 23, 1995.

( মাইএছকিউএল চুইডিছ ডেভিদ এক্সমাৰ্ক, এলান লাৰ্চেন আৰু ফিনিছ চুইডিছ মাইকেল "মণ্টি" ৱাইডেনিয়াছৰ দ্বাৰা প্ৰতিষ্ঠা কৰা মাইএছকিউএল এবি নামৰ এটা চুইডিছ কোম্পানীয়ে সৃষ্টি কৰিছিল। ৱেইডেনিয়াছ আৰু এক্সমাৰ্কৰ দ্বাৰা মাইএছকিউএলৰ মূল বিকাশ ১৯৯৪ চনত আৰম্ভ হৈছিল। মাইএছকিউএলৰ প্ৰথম সংস্কৰণ ১৯৯৫ চনৰ ২৩ মে তাৰিখে প্ৰকাশিত হৈছিল।)

2. Why is MySQL becoming so popular? Give two reasons.

MySQL কিয় ইমান জনপ্ৰিয় হৈ পৰিছে? দুটা কাৰণ কোৱা।

Ans: As an open-source solution, MySQL can be used independently without bearing the cost of the commercial database platform. This fact makes MySQL attractive to individuals and organizations looking for a path to economic growth. 

(এক মুক্ত-উৎস সমাধান হিচাপে, বাণিজ্যিক ডাটাবেচ প্লেটফৰ্মৰ ব্যয় বহন নকৰাকৈ মাইএছকিউএল স্বতন্ত্ৰভাৱে ব্যৱহাৰ কৰিব পাৰি। এই তথ্যটোৱে মাইএছকিউএলক অৰ্থনৈতিক বিকাশৰ পথ বিচাৰি থকা ব্যক্তি আৰু সংগঠনৰ বাবে আকৰ্ষণীয় কৰি তোলে)

3. What is a constraint? Name any two constraints.

বাধা কি? যিকোনো দুটা বাধাৰ নাম লিখা।

Ans: Moderation is used to ensure that the integrity of the information in the database is maintained. Unique, primary key, foreign key, test, default settings are barriers that can be applied frequently to the list. This is called a barrier.

The name of any two types constraints is

 1. NOT NULL constraints

2. Unique constraints.

4. Give examples of DML commands?

DML কমাণ্ডৰ উদাহৰণ দিয়ক?

Ans: Examples of DML commands are-

1. Insert 

2. Update

3. Delete

5. What are the characteristics by which you can determine the data type of MySQL?

(আপুনি MySQL ৰ ডাটা ধৰণ নিৰ্ণয় কৰিব পৰা বৈশিষ্ট্যসমূহ কি কি?)

Ans:  The features that can determine the data type of MySQL are accuracy, completeness, reliability, relevance, and timeline — keep reading to learn more.

( মাইএছকিউএলৰ ডাটা প্ৰকাৰ নিৰ্ধাৰণ কৰিব পৰা বিশেষত্ববোৰ হ'ল-শুদ্ধতা, সম্পূৰ্ণতা, নিৰ্ভৰযোগ্যতা, প্ৰাসংগিকতা, আৰু সময়ৰেখা – অধিক শিকিবলৈ পঢ়ি থাকিব।)

6. What is the query to display the table structure?

টেবুলৰ গঠন প্ৰদৰ্শন কৰিবলৈ প্ৰশ্নটো কি?

Ans: To show the structure of the table, the size is the description in sql or DESC is a statement that shows the structure of the table. Each column in the list specified here contains all the information, such as the name of the column, the type of the column, the default value, if it is zero or does not cancel, etc.

(মেজখনৰ গাঁথনি দেখুৱাবলৈ, আকাৰটো হ'ল এছকিউএল-ত বিৱৰণ বা ডিইএছচি হৈছে এক বিবৃতি যি তালিকাখনৰ গাঁথনি দেখুৱায়। ইয়াত নিৰ্ধাৰিত তালিকাৰ প্ৰতিটো স্তম্ভত সকলো তথ্য থাকে, যেনে স্তম্ভৰ নাম, স্তম্ভৰ প্ৰকাৰ, ডিফল্ট মান, যদি ই শূন্য হয় বা বাতিল নহয় ইত্যাদি।)

7. What is the query to display all the records in a table?

এটা টেবুলত সকলো ৰেকৰ্ড প্ৰদৰ্শন কৰিবলৈ প্ৰশ্নটো কি?

Ans: A description of the size, square or DESC, of the structure of the list, is a statement that shows the structure of the table to display all records in a table. Each column in the list specified here contains all the information, such as the name of the column, the type of the column, the default value, if it is zero or does not cancel, etc.

(টেবলএখনত সকলো ৰেকৰ্ড প্ৰদৰ্শন কৰিবলৈ তালিকাৰ গাঁথনিৰ আকাৰ, বৰ্গবা ডিইএছচি-ৰ বৰ্ণনা হৈছে এক বিবৃতি যি তালিকাখনৰ গাঁথনি দেখুৱায়। ইয়াত নিৰ্ধাৰিত তালিকাৰ প্ৰতিটো স্তম্ভত সকলো তথ্য থাকে, যেনে স্তম্ভৰ নাম, স্তম্ভৰ প্ৰকাৰ, ডিফল্ট মান, যদি ই শূন্য হয় বা বাতিল নকৰে ইত্যাদি।)

8. List the Arithmetic Operators used in MySQL.

এটা টেবুলত সকলো ৰেকৰ্ড প্ৰদৰ্শন কৰিবলৈ প্ৰশ্নটো কি?

Ans: List of Arithmetic Operators used in MySQL are-

 IN, it is used to compare a value of list of literal values

ALL, It compares a value to all values in another set of values.

ANY, It compares a value to any value in the list according to the condition specified.

9. List the Relational Operators used in MySQL.

(MySQL ত ব্যৱহৃত সম্পৰ্কীয় অপাৰেটৰসমূহ তালিকাভুক্ত কৰক।)

Ans: The List of Relational Operators used in MySQL -



10. Differentiate between COUNT(*) and COUNT.

গণনা(*) আৰু গণনাৰ মাজত পাৰ্থক্য কৰক।

Ans: The Differentiate between Count(*) and Count are- 

1. COUNT(*) will count the number of records. and Count will count the number of records where column name is not null.

 2. COUNT(*) includes rows its cancel values .and Count  does not include rows with cancelled ID. 

11. What are the rules for naming a table in MySQL?

MySQL ত এটা টেবুলৰ নামকৰণৰ নিয়ম কি কি?

Ans: The rules for naming a list in MySQL are- List prefixes and suffixes must be compatible with the type of list. List names must only contain letters from A to Z, from 0 to 9, and underline (_). The names on the list may contain several underlines. For more information, see the List Naming Convention section.

(মাইএছকিউএলত এখন তালিকাৰ নাম দিয়াৰ নিয়মবোৰ হ'ল- তালিকা উপসৰ্গ আৰু প্ৰত্যয় তালিকাৰ প্ৰকাৰৰ সৈতে সুসঙ্গত হ'ব লাগিব। তালিকাৰ নামবোৰত কেৱল এৰ পৰা জেড, 0 ৰ পৰা 9 লৈ কেৱল আখৰ থাকিব লাগিব, আৰু ৰেখাঙ্কিত কৰিব লাগিব (_)। তালিকাত থকা নামবোৰত কেইবাটাও ৰেখাঙ্কন থাকিব পাৰে। অধিক তথ্যৰ বাবে, তালিকা নামকৰণ সন্মিলন শাখাচাওক।)

12. Explain the five categories of SQL commands?

(SQL কমাণ্ডৰ পাঁচটা শ্ৰেণীৰ বিষয়ে ব্যাখ্যা কৰক?)

Ans: Example the five categories of SQL commands are-

 1.DDL

2.DQL

3.DNL

4.DCL

5. TCL

(SQL কমাণ্ডৰ পাঁচটা শ্ৰেণীৰ বিষয়ে হ'ল-)

 1.ডিডিএল

2.ডিকিউএল

3.ডিএনএল

4.ডিচিএল

5. টিচিএল

IV. PRACTICAL EXERCISE

ব্যৱহাৰিক অনুশীলন

1. Create a Table 'customer' in a database named 'Klubmart with the following fields:

(নিম্নলিখিত ক্ষেত্ৰবোৰৰ সৈতে 'ক্লুবমাৰ্ট' নামৰ ডাটাবেচত তালিকা 'গ্ৰাহক' সৃষ্টি কৰক:) 

Column Name

Data Type

Size

Constraints

Customer ID

INT

 

PRIMARY KEY

Customer Name

VARCHAR

20

NOT NULL

Customer Mobile

VARCHAR

11

NOT NULL

Customer Category

CHAR

1

It is either X, Y or Z


2. Display the structure of the table.

(টেবুলৰ গঠন প্ৰদৰ্শন কৰক।)

Ans: 

3. Insert five records in the table.

(টেবুলত পাঁচটা ৰেকৰ্ড সন্নিৱিষ্ট কৰক।)

Ans: 

4. Display all the records.

(সকলো ৰেকৰ্ড প্ৰদৰ্শন কৰক।)

Ans: 

5. Display the Customer Name & Customer Mobile.

(গ্ৰাহকৰ নাম আৰু গ্ৰাহকম'বাইল প্ৰদৰ্শন কৰক।)

Ans: 

 6. Display the Customer Name whose Customer Category is 'X'.

 (গ্ৰাহকৰ নাম প্ৰদৰ্শন কৰক যাৰ গ্ৰাহকশ্ৰেণী 'এক্স'।)

Ans: 

7. Display the Customer ID whose Customer Category is 'Y' OR 'Z'.

(গ্ৰাহকৰ শ্ৰেণী 'ৱাই' বা 'জেড' হোৱা গ্ৰাহকআইডি প্ৰদৰ্শন কৰক।)

Ans: 

8. Display the distinct Customer Category from the table.

(তালিকাৰ পৰা পৃথক গ্ৰাহক শ্ৰেণী প্ৰদৰ্শন কৰক।)

Ans: 

V. SOLUTION


1. The MySQL command to create the database is:

ডাটাবেইচ সৃষ্টি কৰিবলে MySQL আদেশটো হ'ল:

CREATE DATABASE Klubmart; 

To use the Database Klubmart, type:


    USE Klubmart;


To create the table 'customer' in the database 'Klubmart":

CREATE TABLE customer

(Customer ID INT PRIMARY KEY,

Customer Name VARCHAR (20) NOT NULL,

Customer Mobile VARCHAR (10) NOT NULL,

Customer Category CHAR);

ডাটাবেচ ক্লুবমাৰ্ট সৃষ্টি কৰক; 


ডাটাবেচ ক্লুবমাৰ্ট ব্যৱহাৰ কৰিবলৈ, প্ৰকাৰ:


ক্লুবমাৰ্ট ব্যৱহাৰ কৰক;


ডাটাবেচ 'ক্লুবমাৰ্ট'ত তালিকা 'গ্ৰাহক' সৃষ্টি কৰিবলৈ:


তালিকা গ্ৰাহক সৃষ্টি কৰক


(গ্ৰাহক আইডি আইএনটি প্ৰাথমিক কী,


গ্ৰাহকৰ নাম ভাৰ্চাৰ (20) বাতিল নহয়,


গ্ৰাহক ম'বাইল ভাৰ্চাৰ (10) বাতিল নহয়,


গ্ৰাহক শ্ৰেণী চাৰ);

2. To display the structure of the table type the command: 

(টেবুলৰ গঠন প্ৰদৰ্শন কৰিবলৈ আদেশ লিখক:)

    DESCRIBE customer;

(গ্ৰাহকক বৰ্ণনা কৰক;)

Ans: 

3. To insert the record type the following command:

 (ৰেকৰ্ড টো সুমুৱাবলৈ নিম্নলিখিত কমান্ডটো টাইপ কৰক:)

INSERT INTO customer values (1, 'Atul','9435110011", "X"); 

গ্ৰাহকৰ মূল্যত অন্তৰ্ভুক্ত কৰক (1, 'অতুল', '9435110011", "এক্স"); 

INSERT INTO customer values (2, 'Ashwini', '9864078011', 'Y');

গ্ৰাহকৰ মূল্যত অন্তৰ্ভুক্ত কৰক (2, 'অশ্বিনী', '9864078011', 'ৱাই');

INSERT INTO customer values (3, 'Anjana, 7086219344", "Z");

গ্ৰাহকৰ মূল্যত অন্তৰ্ভুক্ত কৰক (3, 'অঞ্জনা, 7086219344", "জেড");

 INSERT INTO customer values (4, 'Archana', '9435987611", "Y");

গ্ৰাহকৰ মূল্যত অন্তৰ্ভুক্ত কৰক (4, 'অৰ্চনা', '9435987611", "ৱাই");

INSERT INTO customer values (5, 'Amresh","9435110011", "X");

গ্ৰাহকৰ মূল্যত অন্তৰ্ভুক্ত কৰক (5, 'অমৰেশ", 9435110011", "এক্স");

4. SELECT * FROM customer;

 গ্ৰাহকৰ পৰা * বাছনি কৰক;

5. SELECT Customer Name, Customer Mobile FROM customer;

গ্ৰাহকৰ নাম, গ্ৰাহকৰ ম'বাইল গ্ৰাহকৰ পৰা বাছনি কৰক;

6. SELECT Customer Name FROM customer WHERE Customer Category = 'X';

গ্ৰাহকৰ পৰা গ্ৰাহকৰ নাম বাছনি কৰক য'ত গ্ৰাহক শ্ৰেণী = 'এক্স';

7. SELECT Customer ID FROM customer WHERE Customer Category = 'Y' OR

Customer Category = 'Z';

গ্ৰাহকৰ পৰা গ্ৰাহকৰ আইডি বাছনি কৰক য'ত গ্ৰাহক শ্ৰেণী = 'ৱাই' বা


গ্ৰাহক শ্ৰেণী = 'জেড';

8. SELECT DISTINCT(Customer Category) FROM customer;

গ্ৰাহকৰ পৰা পৃথক (গ্ৰাহক শ্ৰেণী) বাছনি কৰক;

2. Create a table Worker in a database named Organisation. Enter the records given in the table below.

সংগঠন নামৰ ডাটাবেচ এটাত টেবুল কৰ্মী এটা সৃষ্টি কৰক। তলৰ তালিকাত দিয়া ৰেকৰ্ডবোৰ প্ৰবিষ্ট কৰক।

Worker _ ID

First _ Name

Last _ Name

Salary

Joining _ Date

Department

001

Rebecca

Doungel

40000

2014-02-20

HR

002

Jahnavi

Borthakur

68000

2014-06-11

Admin

003

Digvijay

Goswami

50000

2014-02-20

HR

004

Krishang

Shandilya

50000

2014-02-20

Admin

005

Jaspal

Bhatti

55000

2014-06-11

Admin

006

Kankana

Devi

20000

2014-06-11

Account

007

Shristi

Goswami

75000

2014-01-20

Account

008

Geeta

sharma

90000

2014-04-11

Admin



Write the commands to do the following:

নিম্নলিখিতবোৰ কৰিবলৈ আদেশবোৰ লিখক:

1. Display Worker ID and Joining Date of Admin Department.

কৰ্মী আইডি প্ৰদৰ্শন কৰক আৰু প্ৰশাসক বিভাগৰ যোগদানৰ তাৰিখ।

2. Display records in ascending order of Salary.

দৰমহাৰ বৰ্ধিত ক্ৰমত ৰেকৰ্ড প্ৰদৰ্শন কৰক।

3. Display records having Salary in the range 50000 to 90000.

50000 ৰ পৰা 90000 পৰিসৰত দৰমহা থকা ৰেকৰ্ডপ্ৰদৰ্শন কৰক।

4. Display the record of persons who First Name ends with 'a'. 

প্ৰথম নাম 'এ'ৰ সৈতে সমাপ্ত হোৱা ব্যক্তিসকলৰ ৰেকৰ্ড প্ৰদৰ্শন কৰক। 

5. Display the records of HR and Account Department.

এইচআৰ আৰু একাউণ্ট বিভাগৰ ৰেকৰ্ডপ্ৰদৰ্শন কৰক।

6. The worker is given bonus as 1% of the Salary. Display the First Name, Last Name and Bonus.

শ্ৰমিকজনক দৰমহাৰ 1% হিচাপে বোনাচ দিয়া হয়। প্ৰথম নাম, অন্তিম নাম আৰু বোনাচ প্ৰদৰ্শন কৰক।

7. Display the sum, maximum, minimum and average Salary.

যোগফল, সৰ্বাধিক, নিম্নতম আৰু গড় দৰমহা প্ৰদৰ্শন কৰক।

8. Display the count of records where Department = 'HR'.

ৰেকৰ্ডৰ গণনা প্ৰদৰ্শন কৰক য'ত বিভাগ = 'এইচআৰ'।

Solution


1. SELECT Worker __ ID, Joining __ Date        FROM Worker WHERE Department = 'Admin'; 

চিলেক্ট ৱৰ্কাৰ __ আইডি, কৰ্মীৰ পৰা __ তাৰিখত যোগদান কৰা য'ত বিভাগ = 'প্ৰশাসক'; 

2. SELECT * FROM Worker ORDER BY Salary;

দৰমহাৰ দ্বাৰা কৰ্মীৰ অৰ্ডাৰৰ পৰা * বাছনি কৰক;


3. SELECT * FROM Worker BETWEEN 50000 AND 90000;

50000 আৰু 90000 ৰ ভিতৰত কৰ্মীৰ পৰা * বাছনি কৰক;

4. SELECT * FROM Worker WHERE First_Name LIKE "%a";

কৰ্মীৰ পৰা বাছনি কৰক য'ত First_Name "%ক" পছন্দ কৰে;

5. SELECT * FROM Worker WHERE Department = 'HR' OR Department = 'Account';

 কৰ্মীৰ পৰা বাছনি কৰক য'ত বিভাগ = 'এইচআৰ' বা বিভাগ = 'একাউণ্ট';

6. SELECT First_Name, Last_Name, 0.01 * Salary AS "BONUS" FROM Worker;

First_Name, Last_Name, 0.01 * কৰ্মীৰ পৰা "বোনাচ" হিচাপে দৰমহা বাছনি কৰক;

7. SELECT SUM(Salary), MAX(Salary), MIN(Salary), AVG(Salary);

চামিল (দৰমহা), সৰ্বাধিক (দৰমহা), এমআইএন(দৰমহা), গড় (দৰমহা);

8. SELECT COUNT(*) FROM Worker WHERE Department = 'HR';

 কৰ্মীৰ পৰা গণনা(*) বাছনি কৰক য'ত বিভাগ = 'এইচআৰ';



Type & Assamese Translate: Himashree Bora.

Author-DIKHA BORA


Post ID: DABP002205