Class 10 Computer Science Chapter 3 Question Answer

Class 10 Computer Science Chapter 3 Question Answer (SEBA):

In this chapter, we delve deeper into the world of databases, with a focus on MySQL, a powerful relational database management system. Building on the foundation laid in earlier lessons, we explore the intricacies of MySQL and its role in efficiently organizing and managing data. This chapter introduces key concepts such as data types, table structures, and the SQL commands specific to MySQL. As we navigate through Database Part II, we’ll unravel the versatility of MySQL and understand how it helps users interact with and manipulate data seamlessly. So buckle up for an insightful journey into the realm of MySQL, where we unlock the potential of databases for effective data handling.

Exercise Questions

I. MULTIPLE CHOICE QUESTIONS:

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

(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: (c) Alphabet.

4. The___command used to delete the database physically is:

(c) DELETE

(b) ERASE

(c) DROP

Ans: (c) DROP.

5. The___wildcard character allows finding a match for any string of any length, including zero length.

(a) * 

(b) % 

(c) #

Ans: (b) %

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

(a) AND

(b) OR

(c) NOT

Ans: (3) NOT.

Read Here

II. FILL IN THE BLANKS:

1. MySQL is named after co-founder Michael Widenius’s daughter, ____.

Ans: My.

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

Ans: Cardinality.

3. The number ___ denotes the degree of the table.

Ans: Columns.

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

Ans: Reserved.

5. A MySQL statement is terminated by a ___.

Ans: Semi-colon.

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

Ans: Single.

III. ANSWER THE FOLLOWING QUESTIONS:

1. Who were the developers of MySQL?

Ans: MySQL, an open-source relational database management system (RDBMS), was originally developed by a Swedish company called MySQL AB. The key individuals behind the creation of MySQL are Michael Widenius, David Axmark, and Allan Larsson.

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

Ans: MySQL is becoming popular for two main reasons:

  • Free and Open-Source: MySQL is free to use, and its open-source nature means anyone can access and improve its code. This encourages a large community of developers to contribute, making it a reliable and feature-rich database.
  • Scalability and Performance: MySQL is known for its scalability and high performance. MySQL is good at managing large amounts of data and handling complex tasks. Whether it’s a small website or a big business system, MySQL’s ability to handle big jobs efficiently makes it a go-to choice for many applications.

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

Ans: In databases, a constraint is a rule or condition applied to a set of columns in a table to control the type of data that can be stored in those columns.  They ensure only good, clean data gets in and stays consistent.

  • Primary Key Constraint: It makes sure each row in a table has a unique ID. Two rows’ names can be the same, and there can’t be empty IDs.
  • NOT NULL: This constraint acts like a “no empty spaces” rule. It means a column must always have a value, preventing missing information.

4. Give an example of a DML command.

Ans: Data Manipulation Language (DML) commands are used to interact with and manipulate data stored in a database. Here are a few examples of DML commands:

  • INSERT: [Purpose: Adds new data (rows) to a table.]
  • UPDATE: [Purpose: Modifies existing data (rows) in a table.]
  • DELETE: [Purpose: Removes data (rows) from a table.]
  • SELECT: [Purpose: Retrieves specific data (rows) from a table.]

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

Ans: Here are the key characteristics that guide the choice of data type in MySQL:

Numeric Types: Used for storing numbers like integers and decimals.

Textual Types: Designed for storing text data such as names and addresses.

Date and Time Types: Specifically for handling date and time information.

Boolean Type: Ideal for storing logical values, either true or false.

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

Ans: To display the structure of a table in MySQL, we can use the following query:

DESCRIBE table_name;

or

SHOW COLUMNS FROM table_name;

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

Ans: To display all the records in a table, we can use the following query:

SELECT * FROM table_name;

For example, if the table name is Student_Info, then the query is:

SELECT * FROM Student_Info;

8. List the Arithmetic Operators used in MySQL.

Ans: The Arithmetic Operators used in MySQL are:

OperatorMeaningExample
+AdditionA + B
SubtractionA – B
/DivisionA / B
*MultiplicationA * B

9. List the Relational Operators used in MySQL.

Ans: Relational operators compare two expressions or values and return a boolean result. The relational operators used in MySQL are:

OperatorMeaningExample
=Equal toA = B
!=Not equal toA != B
<Less thanA > B
>Greater thanA < B
<=Less than or equal toA <= B
>=Greater than or equal toA >= B

10. Differentiate between COUNT (*) and COUNT.

Ans: In SQL, COUNT(*) is used to count all rows in a table, including those with NULL values in any column, while COUNT(column_name) specifically counts the number of non-NULL values in the specified column.

In simple words, the count(*) is used when we want to count the total number of rows in a table, regardless of NULL values in any column. On the other hand, if we want to count the non-NULL values in a particular column, then we use COUNT(column_name).

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

Ans: The rules for naming a table in MySQL are:

i) Table names must be 64 characters or less

ii) A table name should begin with an alphabet.

iii) The special character (_) underscore is allowed.

iv) Reserved words are not allowed.

12. Explain the five categories of SQL commands.

Ans: SQL (Structured Query Language) commands can be broadly categorized into five main groups based on their functionality:

(1) DDL (Data Definition Language): It is used to define the database structure by creating, modifying, and dropping database objects like tables, columns, views, indexes, etc.

Here are some commands that come under DDL:

  • CREATE
  • ALTER
  • DROP
  • TRUNCATE.

(2) DML (Data Manipulation Language): It is used to modify existing data in the database, including inserting, updating, and deleting records.

Here are some commands that come under DML:

  • INSERT
  • UPDATE
  • DELETE.

(3) DCL (Data Control Language): DCL commands are used to grant, revoke, or manage access privileges for database objects. Here are some commands that come under DCL:

  • GRANT
  • REVOKE

(4) TCL (Transaction Control Language): It is used to manage groups of SQL statements as a single unit (transaction) to ensure data consistency.

Here are some commands that come under TCL:

  • COMMIT
  • ROLLBACK
  • SAVEPOINT.

(5) DQL (Data Query Language): It is used to retrieve data from the database without modifying it.

Here are some commands that come under DQL:

  • SELECT
  • SHOW
  • HELP.

Read also Chapter 2

2 thoughts on “Class 10 Computer Science Chapter 3 Question Answer”

Leave a Comment