Viva Voice Questions Class 12 Ip
Viva Voice Questions Class 12 Ip
SQL
Q1. What is DBMS?
Ans. DBMS stands for Database Management System. It is a software which
help us to manage data effectively and efficiently.
Q2. What is the full form of RDBMS.
Ans. RDBMS stands for Relational Database Management System.
Q3. Give two example of DBMS.
Ans. Two examples of DBMS are : MySQL, Oracle, Microsoft Access etc.
Q4. What is table in DBMS?
Ans. A Table is a collection of data which is organized in the forms of rows
and columns.
Q5. What is record in a table?
Ans. The horizontal line in a table is called record. It is also known as tuple.
Q6. What is field in a table?
Ans. The vertical line in a table is called field. It is also known as attribute.
Q7. What are the advantages of DBMS?
Ans. Advantages of DBMS are:
1. It reduces data redundancy. 3. It help in sharing of data.
2. It reduces data inconsistency.
Q8. Name the three types of relationship that can be formed in RDBMS.
Ans. Three types of relationship are:
1. One-to-One relationship 3. Many-to-Many relationship
2. One-to-Many relationship
Q9. What do you mean by Degree and Cardinality?
Ans. The number of rows in a table is called Cardinality. The number of
columns i a table is called Degree.
Q10. What is Primary Key in a table?
Ans. A field which uniquely identifies each and every record in a table is
called primary key.
Q11. What do you mean by Candidate key?
Ans. Those field which can act as a primary key in a table is called candidate
key.
Q12. What is alternate key in a table?
Ans. Those candidate keys which are not primary key in a table is called
alternate keys.
Q13. Define Foreign Key.
Ans. A foreign key is a field or group of fields which references the primary
key of another table.
Q14. What is referential integrity in DBMS?
Ans. Referential integrity refers to the limitations which ensures the
relationship between tables. In simple words we can say that it refers to the
relationship between tables.
Q15. What is MySQL?
Ans. It is an open source RDBMS.
Q16. What is SQL?
Ans. SQL stands for Structured Query Language. It is used to perform
certain operations on database.
Q17. Expand DML and DDL.
Ans. DML stands for Data Manipulation Language. DDL stands for Data
Definition Language.
Q18. Give two example of DDL commands
Ans. DDL: Create, Alter, Drop
Q19. Give two examples of DML commands.
Ans. DML : Insert, Update, Delete
Q20. Define data type.
Ans. A data type refers to the type of data that a variable can store such as
integer, floating, string, etc.
Q21. Differentiate between Char and Varchar?
Ans.
Char Varchar
It is a fixed length data type It is a variable length data type
It uses static memory location It uses dynamic memory location
It can hold maximum of 255 characters It can hold maximum of 65535 characters
Q22. What is NULL value in MySQL?
Ans. Null Value means that data is missing or unknown.
Q23. What do you mean by comments in MySQL?
Ans. Non executable statements in MySQL are called comment.
Q24. Which symbols are used to give Single line and Multiple line comment in
MySQL?
Ans. For Single line comments we use # or — symbols
For Multiple line comment we use /*——-*/
Q25. Write a command to display all the existing databases in MySQL.
Ans. Show databases;
Q26. Define constraint in MySQL.
Ans. Constraints are referred to rules or limitations that we enforced on the
columns of a table.
Q27. Name any two commonly used constraint.
Ans. Commonly used constraints are :
1. Not Null 3. Primary Key
2. Unique 4. Default
Q28. What is the difference between Unique and Primary Key constraint?
Ans. Primary key will not accept NULL values whereas Unique key can
accept NULL values. A table can have only one primary key whereas there
can be multiple unique key in a table.
Q29. Write a command to display the structure of table “Stock”
Ans. Desc Stock;
Q30. Which constraint ensures that a column can not have a NULL value?
Ans. NOT NULL
Q31. What is the difference between Update and Alter command in MySQL?
Ans. Update command is used to modify the data of the table and Alter
command is used to modify the structure of the table.
Q32. What is the difference between the following queries?
1. Delete from Book;
2. Delete from Book where price > 400;
Ans. The first query will delete all the records from table book while the
second command will delete only those records from table Book whose price
is more than 400.
Q33. Write a command to make Book_id as primary key after creating the table.
Ans. Alter table Book add Primary Key (Book_id);
Q35. Write a command to add a new column “Price” in a table “Book”.
Ans. Alter table Book add Price float(6,2);
Q36. What is the meaning of float(6,2)?
Ans. float(6,2) refers to a decimal number with total 6 digits including 2
decimal places.
Q37. Write a command to delete a column “Price” from table “Book”.
Ans. Alter table Book drop column Price;
Q38. Write a command to rename a column “Price” to “Amount” of table
“Book”.
Ans. Alter table Book change Price Amount float(6,2);
Q39. What is the difference between Delete and Drop command?
Ans. Delete command is used to delete one or more records from the table
while Drop command is used to delete the complete data along with the
structure of the table.
Q40. Write a command to delete the table “Book”.
Ans. Drop table Book;
Q41. Which command is used to remove the database?
Ans. Drop
Q42. Name the command used to fetch data from the table.
Ans. Select Command
Q43. What is the purpose of Order by Clause?
Ans. Order by Clause is used to arrange the data of the table in ascending or
descending order. This clause is used along with Select command.
Q44. What is the output of the following command?
Select 5 + NULL;
Ans. NULL
Q45. Which operator is used for pattern matching?
Ans. Like
Q46. Name two wildcard symbols which are used in MySQL for pattern
matching.
Ans. Underscore ( _ ) and Percentage (%)
Q47. Which wildcard character is used for single character?
Ans. Underscore ( _ )
Q48. Correct the following query
Select * from Book where Price = NULL;
Ans. Select * from Book where Price is NULL;
Q49. By default Order by clause arrange records in _________________ order.
Ans. Ascending
Q50. Which pattern is used along with Like operator to display only those names
which ends with ‘na’?
Ans. “%na