PartB-Unit3-Database Management system(Answers)
PartB-Unit3-Database Management system(Answers)
Batch (2023-24)
Practice Worksheet (Answers)
Unit 3: Database Management System
Attempt all Questions:
1. ___________ is a constraint in the table to check that every record in the table is unique.
a. Primary Key
2. In which view you can enter the data in a table?
b. Datasheet view
3. An ___________ sign in the record selector indicates that the row is ready to receive a new
record.
a. Asterisk (*)
4. An attractive interface that accept data from the user and inserts it in the corresponding
table or query, is called?
c. Forms
5. ___________ data field is used to store links to web pages, websites or files.
b. Hyperlink
6. _____________ key moves the cursor to next record in the Datasheet view.
a. down arrow key
7. ______________ prevents the user from entering inconsistent data.
a. Referential Integrity
8. Which of the following is not a field property in Database system?
d. Text
9. Which relationship is used if we wish to divide a large table to secure sensitive data in
separate table.
a. One-to-one
10. The ____________ function groups the records that have the same values in a particular field
and returns the count of those values.
d. Group By
11. If a column in table does not have a value, it’s considered as ___________.
b. Null
13. The _________ datatype is used to insert alphanumeric values in the database.
a. VARCHAR
14. DDL stands for_____________________.
c. Data Definition language
15. If a column does not have any value in a table, it considered as ____________.
b. NULL
16. Which of the following SQL command will retrieve all records of failed student from table
RECORD?
b. SELECT * FROM RECORD WHERE RESULT= ‘FAIL’
20. A __________ is established between two or more tables to retrieve data, collectively.
c. Relationship
21. What is the name of the table in the given query- INSERT INTO SAMPLE (STU_ID,
STU_NAME, RESULT?
c. SAMPLE
22. Which SQL command is used to create a table in the database?
c. CREATE
23. A __________ command is a type of DML command.
a. INSERT b. SELECT
24. The properties of a form can be customised through the _________ dialog box.
d. Property Sheet
25. DBMS is a program that controls the creation, maintenance and use of database.
Here, DBMS refers to
d. Data Base Management System
26. Which of these is not a type of Database?
d. Translational Database
27. The Hierarchical Database is also known as ________ structure.
a. Tree
38. Anand is using MS Access for creating a database. He created a table with name Customer.
Help him write the correct query to enter data in the above table having fields- cust_ID,
cust_Name, cust_Contact, Company, cust_address.
Ans: INSERT INTO Customer (cust_ID, cust_Name, cust_Contact, Company, cust_address)
VALUES (value1, value2, value3, value4, value5);
39. Sara has entered 30 records of students in Student_Mark table. She wants to change some
values in the record. Suggest the view in which she can edit the data in the database.
Ans: Datasheet View
40. Honey entered 200 records in product table for his shop. He wants to sort the record in the
descending order according to product_rate field. Write a SQL query that will help him to
accomplish the task.
Ans: SELECT * FROM product ORDER BY product_rate DESC;
41. Consider the table STUDENT with the following details and answer the SQL queries.
STU_ID Name Stream Marks Class
1 Armaan Science 87.5 11A
2 Vickey Commerce 88.7 11B
3 Meeta Humanities 76.8 11C
4 Vanisha Science 79.5 11A
5 Kanika Science 77.9 11A
6 Anandi Commerce 86.7 11B
a) Write the command to select all commerce students from the table STUDENT.
Ans: Select *from STUDENT where Stream= “Commerce”;
b) Modify the marks of Kanika as 85.5
Ans: Update STUDENT set Marks= 85.5 where Name= “Kanika”;
c) Write command to delete all records that belong to SCIENCE stream.
Ans: Delete from STUDENT where Stream= “Science”;
d) Add the record of new student “Rashmi” of “Humanities” stream in class “11B”
and her marks are “70.9”.
Ans: Insert into STUDENT values (7, “Rashmi”, “Humanities”, 70.9, “11B”);
42. Answer the following SQL queries for the given table “EMPLOYEE”.
Emp_ID Emp_Name Salary
1 Suman 20000
2 Sanjay 32000
3 Ravi 30000
4 Raj 21000
a) Write an SQL query to create the above table EMPLOYEE.
Ans: Create table Employee(Emp_ID Integer not null Primary key, Emp_Name
Varchar(20), Salary Integer);
b) Display the salary of all employees less than 30000.
Ans: Select Emp_Name, Salary from Employee where Salary<30000.
c) Display all the details of the employee whose name is RAJ.
Ans: Select * from Employee where Emp_name= “Raj”;
d) Display the record of the employee having “j” as the last alphabet of his/her name.
Ans: Select * from Employee where Emp_Name like “*j”;
Very Short Questions:
Q43. Name any four categories of DBMS.
Ans 43: Four categories of DBMS are as follows:
i. Flat File based DBMS
ii. Hierarchical database management system
iii. Network database management system
iv. Relational database management system
Q44. Mention any two integer data types of a table field in database.
Ans 44. SMALLINT, INTEGER, TINYINT, NUMERIC, BIGINT.
Q45. Name the relationship in which one column of the primary key table is associated with all the
columns of the associated table and vice-versa.
Ans 45: One to many relationship or Many to one relationship.
Q46. What do you mean by Flat file DBMS?
Ans 46: Flat File Database management system also known as flat modes are the simplest database
management systems. These store information in flat files having rows and columns to store data. Flat files
cannot be linked to each other.
Q47. Give two examples each of:
a. Object-oriented DBMS Ans: IBM db40 and DTS/S1
b. Relational DBMS Ans: MS SQL Server, MS ACCESS, ORACLE, MY SQL
Q48. What is the use of following commands in SQL?
a. SELECT- This command allows us to view the records from a table. It also lets us view selected
records satisfying a condition from a table.
b. CREATE- This command defines the structure of a table. It describes the kind of data to be stored in
a table by declaring the number of fields, field name, field length and data type of fields of a table.
c. DROP- This command deletes a table or other database objects such as index or view.
Q49. Fill ups:
a. When a primary key constraint is applied to one or more columns in a table is known as
_______. (Ans- Composite Primary Key)
b. A row that represents a single, data item in a table is known as_______. (Ans: record or Tuple)
Q50. Define:
a. Database- Database is an organized collection of interrelated data of a specific type, in a systematic
manner i.e. in form of tables.
b. Reports- A report is a summary of your database. It is used to generate overall work outcome in a
clear format for printing.
c. Record- A row in a database table, containing all the data about a single item of the object is called a
record.
d. Table- A table is a grid of rows and columns that stores all the data about a single object.
e. Data types- Datatypes are keywords used to identify which type of data (values) are going to be
stored in a database.
f. Sorting- Sorting refers to arranging the table data in increasing or decreasing order.
g. Foreign Key- A foreign key is a field that stores or picks up the values from a primary key field in
another table to relate both table’s record to each other.
h. Datasheet view- Datasheet view helps to enter, edit or update the records in a table.
i. Design view- Design view helps us to create a table from scratch by defining the field names their
datatypes.
j. Query- A query is a database object that enables us to retrieve records from one or more tables of
database based on different criteria.
Q51. Differentiate between validation text and validation filter.
Ans 51. Validation Rule: It limits the value that the field will accept.
Validation Text: It is the error message that appears when we enter a wrong value.
Q52. Give two advantages and disadvantages of database.
Ans 52:
Advantages Disadvantages
1. Ensures Data Security 1. Highly complex for everyone to understand
2. Reduces Data Redundancy 2. In case of database failure, everything is lost.
Q53. Write the rules for naming a table.
Ans 53: A table name should not exceed 64 characters. A table name can only include spaces, letters and
numbers.
Q54. What do you mean by data consistency and data integrity?
Ans 54: Data Consistency means there should not be multiple matching copies of the same data in a
database.
Maintaining and assuring the accuracy and consistency of data is called Data Integrity.
Short Questions:
Q55. What is a primary key in a database? Give its significance.
Ans 55. A primary key is a set of one or more fields that uniquely identifies each record in a table. It does
not contain any duplicate data. a table can have only one primary key. The value in the primary key field is
different for every tuple and thus helps in uniquely identifying the records. Significance of using a primary
key is that it is a constraint in the table to check that every record in the table is unique.
Q56. What is a Database Management System? What are its advantages?
Ans 56. A database management system DBMS is an application program that is used to create and maintain
the database. It enables users to store, modify and view information from a database as per the requirements.
it provides a systematic approach to create, retrieve, update and message information in a database. DBMS
also prevents databases from unauthorized access. It is quite easy and simple to use a DBMS.
Few advantages of DBMS are:
1. It reduces data redundancy
2. It allows sharing of data
3. It helps to maintain Data integrity
4. It provides a strong framework to protect data privacy and security
5. It provides the capability to access the frequently access data as quickly as possible
Q57. Differentiate between primary key and foreign key.
Ans 57. A primary key is a unique value that identifies a row in a table whereas a foreign key identifies a
column or a set of columns in one table that refers to a column or set of columns in another table. a table can
have only one primary key but a table can have multiple foreign keys.
Q58. Explain the term Referential Integrity.
Ans 58. Referential integrity is a system of rules that MS Access uses, to make sure that relationships
between records in related tables are valid and you do not accidentally delete or change related data.
Referential integrity shows the accuracy and consistency of data within the tables. It prevents the user from
entering inconsistent data and makes sure that the information in one table matches the information in
another table.
Q59. Differentiate between One-to-one and Many-to-Many relationships.
Ans 59. On- to-Many relationship: In a one-to-many relationship is the most common kind of relationship
in this kind of relationship a row in table A can have many matching rows in table B. However,
in a row in table B can have only one matching row in table A
Many-to-Many relationship: In a many-to-many relationship , a row in table A can have many matching
rows in table B and vice versa. We create such a relationship by defining a third table that is called a
Junction table. The primary key of the junction table consists of the foreign keys from both table a and table
b.
Q60. What is the main purpose of DBMS?
Ans 60. The main purpose of a database system are as follows:
1. Storage of information.
2. Quick retrieval of information.
3. Sorting selecting data that satisfies certain criteria that is filtering.
4. Produces the report in some standardized and readable format.
1 Aman IX 3000
2 Anil X 3200
Table:Teacher
T_i T_Name T_Sal Stu_id Subject
d
Record Field
It is a collection of data items, which represent a It is an area within the record reserved for a
complete unit of information about a thing or a person. specific piece of data.
A record refers to a row in the table. A field refers to a column in the table.
Eg. If “Employee” is a table then the entire information Eg. If “Employee” is a table, then empID,
of an employee is called a record. empname, department, salary are the fields.
Q65. Consider the following table: STUDENT