ITRevise.in

Chapter library

DML Commands and Queries · Class XI · Part B

Open an answer to check your recall, or turn this topic into an MCQ quiz.

Relational Database Management System

DML Commands and Queries

Practice this chapter
Finding high scores. Student table. WHERE score > 70. ORDER BY score DESC. Names in score order.
Filtering chooses the rows. Sorting arranges the rows you kept.
1 Explain “INSERT” with an example.

INSERT adds rows.

Table structure defines how data is stored, while SQL statements work on that structure and its data. Check whether a statement retrieves information, adds it, changes it or removes it. UPDATE changes existing rows. DELETE removes selected rows. SELECT gets data.

Example. A teacher has a Student table with names and scores. A query can show names for scores higher than 70 and put the highest score first. The condition controls which rows appear, and sorting controls the order of the rows that pass the condition.

The important point is what “INSERT” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

154 words

2 Explain “UPDATE” with an example.

UPDATE changes existing rows.

Table structure defines how data is stored, while SQL statements work on that structure and its data. Check whether a statement retrieves information, adds it, changes it or removes it. DELETE removes selected rows. SELECT gets data. WHERE filters rows based on a condition.

Example. A teacher has a Student table with names and scores. A query can show names for scores higher than 70 and put the highest score first. The condition controls which rows appear, and sorting controls the order of the rows that pass the condition.

The important point is what “UPDATE” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

158 words

3 Explain “DELETE” with an example.

DELETE removes selected rows.

Table structure defines how data is stored, while SQL statements work on that structure and its data. Check whether a statement retrieves information, adds it, changes it or removes it. SELECT gets data. WHERE filters rows based on a condition. ORDER BY sorts query results.

Example. A teacher has a Student table with names and scores. A query can show names for scores higher than 70 and put the highest score first. The condition controls which rows appear, and sorting controls the order of the rows that pass the condition.

The important point is what “DELETE” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

159 words

4 Explain “SELECT” with an example.

SELECT gets data.

Table structure defines how data is stored, while SQL statements work on that structure and its data. Check whether a statement retrieves information, adds it, changes it or removes it. WHERE filters rows based on a condition. ORDER BY sorts query results. INSERT adds rows.

Example. A teacher has a Student table with names and scores. A query can show names for scores higher than 70 and put the highest score first. The condition controls which rows appear, and sorting controls the order of the rows that pass the condition.

The important point is what “SELECT” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

158 words

5 Explain “WHERE” with an example.

WHERE filters rows based on a condition.

Table structure defines how data is stored, while SQL statements work on that structure and its data. Check whether a statement retrieves information, adds it, changes it or removes it. ORDER BY sorts query results. INSERT adds rows. UPDATE changes existing rows.

Example. In SELECT name FROM Student WHERE score > 70, the WHERE clause keeps only students with marks above 70. Someone with exactly 70 is excluded by the greater-than sign. Use >= if the result should include the boundary value.

The important point is what “WHERE” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

152 words

6 Explain “ORDER BY” with an example.

ORDER BY sorts query results.

Table structure defines how data is stored, while SQL statements work on that structure and its data. Check whether a statement retrieves information, adds it, changes it or removes it. INSERT adds rows. UPDATE changes existing rows. DELETE removes selected rows.

Example. In an assessment query, ORDER BY score DESC puts higher scores before lower scores. This clause changes the order of the result. Use WHERE when you also need to limit which rows can appear.

The important point is what “ORDER BY” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it. State the expected result in your own words. A result is specific when another student can tell from the description whether the action succeeded.

171 words

7 Distinguish between INSERT and UPDATE.

INSERT adds rows. UPDATE changes existing rows.

Table structure defines how data is stored, while SQL statements work on that structure and its data. Check whether a statement retrieves information, adds it, changes it or removes it. DELETE removes selected rows. SELECT gets data. WHERE filters rows based on a condition.

Example. A teacher has a Student table with names and scores. A query can show names for scores higher than 70 and put the highest score first. The condition controls which rows appear, and sorting controls the order of the rows that pass the condition.

Compare the two ideas using the same situation. Describe which part of the situation each idea explains and how the result would differ if you used the other one. This gives the distinction a clearer basis than listing two definitions in isolation. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

163 words

8 Write a query to show the names of students scoring above 70, with the highest score first.

Use SELECT name FROM Student WHERE score > 70 ORDER BY score DESC. WHERE keeps only qualifying rows, and ORDER BY places higher scores before lower ones.

Table structure defines how data is stored, while SQL statements work on that structure and its data. Check whether a statement retrieves information, adds it, changes it or removes it. UPDATE changes existing rows. DELETE removes selected rows. SELECT gets data.

Example. A teacher has a Student table with names and scores. A query can show names for scores higher than 70 and put the highest score first. The condition controls which rows appear, and sorting controls the order of the rows that pass the condition.

Check your answer against the task. Identify the facts that matter, explain the steps in a sensible order and state the result you would expect. If your result differs from what you expected, revisit the input, condition or decision that produced it.

154 words

Reference book: 802-IT-Class-XI_PART_B.pdf