Database-MySQL [3i Infotech Placement]: Sample Questions 3 - 4 of 162

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 3


Describe in Detail


When do you get constraint violation? What are the types of constraints?


Database returns an error message when a constraint is violated.

Different type of constrains:

  1. Domain Constraints: A Domain constraint deals with one or more columns
  2. Entity Constraints
  3. Referential Integrity Constraints.
  4. Key Constraints
    • Primary Key Constraints
    • Foreign Key Constraints
    • Unique key Constraints
    • Check constraint
    • Default constraint

Question 4


Write in Short

Short Answer▾

Why can a “group by” or “order by” clause be expensive to process?


  • GROUP BY, ORDER BY is executed by the Oracle engine. At the end, this leads to overhead, because whole data has to be rearranged again.
  • Group by: Combines all the similar rows and displays only the distinct data. Combining and displaying distinct data is an overhead.
  • Order by: Sorts the data either in ascending order or in descending order. Sorting the data is an overhead.
  • Processing of “group by” or “order by” clause requires creation of Temporary tables to process the results of the query, depending on the size of the result set can prove to be expensive.

Developed by: